|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* bus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2017 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
|
|
Packit Service |
1d8f1c |
#error "Only <ibus.h> can be included directly"
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#ifndef __IBUS_EMOJI_H_
|
|
Packit Service |
1d8f1c |
#define __IBUS_EMOJI_H_
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* SECTION: ibusemoji
|
|
Packit Service |
1d8f1c |
* @short_description: emoji utility.
|
|
Packit Service |
1d8f1c |
* @stability: Unstable
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* miscellaneous emoji APIs.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include "ibusserializable.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*
|
|
Packit Service |
1d8f1c |
* Type macros.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
/* define GOBJECT macros */
|
|
Packit Service |
1d8f1c |
#define IBUS_TYPE_EMOJI_DATA (ibus_emoji_data_get_type ())
|
|
Packit Service |
1d8f1c |
#define IBUS_EMOJI_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_EMOJI_DATA, IBusEmojiData))
|
|
Packit Service |
1d8f1c |
#define IBUS_EMOJI_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_EMOJI_DATA, IBusEmojiDataClass))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_EMOJI_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
Packit Service |
1d8f1c |
IBUS_TYPE_EMOJI_DATA))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEmojiData IBusEmojiData;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEmojiDataPrivate IBusEmojiDataPrivate;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusEmojiDataClass IBusEmojiDataClass;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusEmojiData:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Emoji data likes emoji unicode, annotations, description, category.
|
|
Packit Service |
1d8f1c |
* You can get extended values with g_object_get_properties.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
struct _IBusEmojiData {
|
|
Packit Service |
1d8f1c |
IBusSerializable parent;
|
|
Packit Service |
1d8f1c |
/* instance members */
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*< public >*/
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusEmojiDataPrivate *priv;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _IBusEmojiDataClass {
|
|
Packit Service |
1d8f1c |
IBusSerializableClass parent;
|
|
Packit Service |
1d8f1c |
/* class members */
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType ibus_emoji_data_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_new:
|
|
Packit Service |
1d8f1c |
* @first_property_name: Name of the first property.
|
|
Packit Service |
1d8f1c |
* @...: the NULL-terminated arguments of the properties and values.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Creates a new #IBusEmojiData.
|
|
Packit Service |
1d8f1c |
* emoji property is required. e.g.
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_new ("emoji", "😁", NULL)
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: A newly allocated #IBusEmojiData.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
IBusEmojiData * ibus_emoji_data_new (const gchar *first_property_name,
|
|
Packit Service |
1d8f1c |
...);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_get_emoji:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets the emoji character in #IBusEmojiData. It should not be freed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: emoji property in #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
const gchar * ibus_emoji_data_get_emoji (IBusEmojiData *emoji);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_get_annotations:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets the annotation list in #IBusEmojiData. It should not be freed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer none) (element-type utf8):
|
|
Packit Service |
1d8f1c |
* annotation list property in #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GSList * ibus_emoji_data_get_annotations (IBusEmojiData *emoji);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_set_annotations:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
* @annotations: (transfer full) (element-type utf8): List of emoji annotations
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Sets the annotation list in #IBusEmojiData.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_emoji_data_set_annotations (IBusEmojiData *emoji,
|
|
Packit Service |
1d8f1c |
GSList *annotations);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_get_description:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets the emoji description in #IBusEmojiData. It should not be freed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: description property in #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
const gchar * ibus_emoji_data_get_description (IBusEmojiData *emoji);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_set_description:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
* @description: An emoji description
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Sets the description in #IBusEmojiData.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_emoji_data_set_description (IBusEmojiData *emoji,
|
|
Packit Service |
1d8f1c |
const gchar *description);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_get_category:
|
|
Packit Service |
1d8f1c |
* @emoji : An #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets the emoji category in #IBusEmojiData. It should not be freed.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: category property in #IBusEmojiData
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
const gchar * ibus_emoji_data_get_category (IBusEmojiData *emoji);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_dict_save:
|
|
Packit Service |
1d8f1c |
* @path: A path of the saved dictionary file.
|
|
Packit Service |
1d8f1c |
* @dict: (element-type utf8 gpointer) (transfer none): An Emoji dictionary
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Saves the Emoji dictionary to the cache file.
|
|
Packit Service |
1d8f1c |
* Recommend to use ibus_emoji_data_save() instead becase GSList in
|
|
Packit Service |
1d8f1c |
* GHashTable does not work with Gir and Vala.
|
|
Packit Service |
1d8f1c |
* Calls ibus_emoji_data_save() internally. The format of the hash table
|
|
Packit Service |
1d8f1c |
* changed and now is { emoji character, #IBusEmojiData object }.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_emoji_dict_save (const gchar *path,
|
|
Packit Service |
1d8f1c |
GHashTable *dict);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_dict_load:
|
|
Packit Service |
1d8f1c |
* @path: A path of the saved dictionary file.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (element-type utf8 gpointer) (transfer none): An Emoji dictionary
|
|
Packit Service |
1d8f1c |
* file loaded from the saved cache file.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* A hash table of { emoji character, #IBusEmojiData object } is loaded
|
|
Packit Service |
1d8f1c |
* from the saved cache file.
|
|
Packit Service |
1d8f1c |
* Recommend to use ibus_emoji_data_load() instead becase GSList in
|
|
Packit Service |
1d8f1c |
* GHashTable does not work with Gir and Vala.
|
|
Packit Service |
1d8f1c |
* Calls ibus_emoji_data_load() internally.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GHashTable * ibus_emoji_dict_load (const gchar *path);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_dict_lookup:
|
|
Packit Service |
1d8f1c |
* @dict: (element-type utf8 IBusEmojiData) (transfer full): An Emoji dictionary
|
|
Packit Service |
1d8f1c |
* @emoji: an emoji character
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer none): An #IBusEmojiData of @emoji.
|
|
Packit Service |
1d8f1c |
* This API was prepared for the old dict foramat with Gir and Vala
|
|
Packit Service |
1d8f1c |
* but no longer needed.
|
|
Packit Service |
1d8f1c |
* Use ibus_emoji_data_load() instead.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
IBusEmojiData * ibus_emoji_dict_lookup (GHashTable *dict,
|
|
Packit Service |
1d8f1c |
const gchar *emoji);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_save:
|
|
Packit Service |
1d8f1c |
* @path: A path of the saved emoji data.
|
|
Packit Service |
1d8f1c |
* @list: (element-type IBusEmojiData) (transfer none): A list of emoji data.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Save the list of #IBusEmojiData to the cache file.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_emoji_data_save (const gchar *path,
|
|
Packit Service |
1d8f1c |
GSList *list);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_emoji_data_load:
|
|
Packit Service |
1d8f1c |
* @path: A path of the saved dictionary file.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (element-type IBusEmojiData) (transfer container):
|
|
Packit Service |
1d8f1c |
* An #IBusEmojiData list loaded from the saved cache file.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GSList * ibus_emoji_data_load (const gchar *path);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
#endif
|