static void _engine_destroy_cb (IBusEngine *engine,
IBusFactory *factory);
-#if 0
-static void ibus_factory_info_class_init(IBusFactoryInfoClass *klass);
-static void ibus_factory_info_init (IBusFactoryInfo *info);
-static void ibus_factory_info_destroy (IBusFactoryInfo *info);
-static gboolean ibus_factory_info_serialize (IBusFactoryInfo *info,
- IBusMessageIter *iter);
-static gboolean ibus_factory_info_deserialize
- (IBusFactoryInfo *info,
- IBusMessageIter *iter);
-static gboolean ibus_factory_info_copy (IBusFactoryInfo *dest,
- const IBusFactoryInfo *src);
-#endif
static IBusServiceClass *factory_parent_class = NULL;
-#if 0
-static IBusSerializableClass *factory_info_parent_class = NULL;
-#endif
-
GType
ibus_factory_get_type (void)
{
g_hash_table_insert (priv->engine_table, g_strdup (engine_name), (gpointer) engine_type);
}
-
-#if 0
-IBusFactoryInfo *
-ibus_factory_get_info (IBusFactory *factory)
-{
- IBusFactoryPrivate *priv;
- priv = IBUS_FACTORY_GET_PRIVATE (factory);
-
- return priv->info;
-}
-
-GType
-ibus_factory_info_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusFactoryInfoClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_factory_info_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusFactoryInfo),
- 0,
- (GInstanceInitFunc) ibus_factory_info_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusFactoryInfo",
- &type_info,
- 0);
- }
-
- return type;
-}
-
-static void
-ibus_factory_info_class_init (IBusFactoryInfoClass *klass)
-{
- IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
- IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
-
- factory_info_parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
- object_class->destroy = (IBusObjectDestroyFunc) ibus_factory_info_destroy;
-
- serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_factory_info_serialize;
- serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_factory_info_deserialize;
- serializable_class->copy = (IBusSerializableCopyFunc) ibus_factory_info_copy;
-
- g_string_append (serializable_class->signature, "osssss");
-}
-
-static void
-ibus_factory_info_init (IBusFactoryInfo *info)
-{
- info->path = NULL;
- info->name = NULL;
- info->lang = NULL;
- info->icon = NULL;
- info->authors = NULL;
- info->credits = NULL;
-}
-
-static void
-ibus_factory_info_destroy (IBusFactoryInfo *info)
-{
- g_free (info->path);
- g_free (info->name);
- g_free (info->lang);
- g_free (info->icon);
- g_free (info->authors);
- g_free (info->credits);
-
- info->path = NULL;
- info->lang = NULL;
- info->name = NULL;
- info->icon = NULL;
- info->authors = NULL;
- info->credits = NULL;
-
- IBUS_OBJECT_CLASS (factory_info_parent_class)->destroy ((IBusObject *)info);
-}
-
-static gboolean
-ibus_factory_info_serialize (IBusFactoryInfo *info,
- IBusMessageIter *iter)
-{
- gboolean retval;
-
- retval = factory_info_parent_class->serialize ((IBusSerializable *)info, iter);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, IBUS_TYPE_OBJECT_PATH, &info->path);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, G_TYPE_STRING, &info->name);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, G_TYPE_STRING, &info->lang);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, G_TYPE_STRING, &info->icon);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, G_TYPE_STRING, &info->authors);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_append (iter, G_TYPE_STRING, &info->credits);
- g_return_val_if_fail (retval, FALSE);
-
- return TRUE;
-}
-
-static gboolean
-ibus_factory_info_deserialize (IBusFactoryInfo *info,
- IBusMessageIter *iter)
-{
- gboolean retval;
-
- retval = factory_info_parent_class->deserialize ((IBusSerializable *)info, iter);
- g_return_val_if_fail (retval, FALSE);
-
- retval = ibus_message_iter_get (iter, IBUS_TYPE_OBJECT_PATH, &info->path);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->path = g_strdup (info->path);
-
- retval = ibus_message_iter_get (iter, G_TYPE_STRING, &info->name);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->name = g_strdup (info->name);
-
- retval = ibus_message_iter_get (iter, G_TYPE_STRING, &info->lang);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->lang = g_strdup (info->lang);
-
- retval = ibus_message_iter_get (iter, G_TYPE_STRING, &info->icon);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->icon = g_strdup (info->icon);
-
- retval = ibus_message_iter_get (iter, G_TYPE_STRING, &info->authors);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->authors = g_strdup (info->authors);
-
- retval = ibus_message_iter_get (iter, G_TYPE_STRING, &info->credits);
- g_return_val_if_fail (retval, FALSE);
- ibus_message_iter_next (iter);
- info->credits = g_strdup (info->credits);
-
- return TRUE;
-}
-
-static gboolean
-ibus_factory_info_copy (IBusFactoryInfo *dest,
- const IBusFactoryInfo *src)
-{
- gboolean retval;
-
- retval = factory_info_parent_class->copy ((IBusSerializable *)dest,
- (IBusSerializable *)src);
- g_return_val_if_fail (retval, FALSE);
-
- g_return_val_if_fail (IBUS_IS_FACTORY_INFO (dest), FALSE);
- g_return_val_if_fail (IBUS_IS_FACTORY_INFO (src), FALSE);
-
- dest->path = g_strdup (src->path);
- dest->name = g_strdup (src->name);
- dest->lang = g_strdup (src->lang);
- dest->icon = g_strdup (src->icon);
- dest->authors = g_strdup (src->authors);
- dest->credits = g_strdup (src->credits);
-
- return TRUE;
-}
-
-IBusFactoryInfo *
-ibus_factory_info_new (const gchar *path,
- const gchar *name,
- const gchar *lang,
- const gchar *icon,
- const gchar *authors,
- const gchar *credits)
-{
- g_assert (path);
- g_assert (name);
- g_assert (lang);
- g_assert (icon);
- g_assert (authors);
- g_assert (credits);
-
- IBusFactoryInfo *info;
-
- info = (IBusFactoryInfo *) g_object_new (IBUS_TYPE_FACTORY_INFO, NULL);
-
- info->path = g_strdup (path);
- info->name = g_strdup (name);
- info->lang = g_strdup (lang);
- info->icon = g_strdup (icon);
- info->authors = g_strdup (authors);
- info->credits = g_strdup (credits);
-
- return info;
-}
-#endif
#include "ibusservice.h"
#include "ibusserializable.h"
+G_BEGIN_DECLS
+
/*
* Type macros.
*/
/* define GOBJECT macros */
-
/**
* IBUS_TYPE_FACTORY:
*
#define IBUS_FACTORY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY, IBusFactoryClass))
-#if 0
-#define IBUS_TYPE_FACTORY_INFO \
- (ibus_factory_info_get_type ())
-#define IBUS_FACTORY_INFO(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactoryInfo))
-#define IBUS_FACTORY_INFO_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY_INFO, IBusFactoryInfoClass))
-#define IBUS_IS_FACTORY_INFO(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY_INFO))
-#define IBUS_IS_FACTORY_INFO_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY_INFO))
-#define IBUS_FACTORY_INFO_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY_INFO, IBusFactoryInfoClass))
-#endif
-
-G_BEGIN_DECLS
-
typedef struct _IBusFactory IBusFactory;
typedef struct _IBusFactoryClass IBusFactoryClass;
-#if 0
-typedef struct _IBusFactoryInfo IBusFactoryInfo;
-typedef struct _IBusFactoryInfoClass IBusFactoryInfoClass;
-#endif
-
/**
* IBusFactory:
*
gpointer pdummy[8];
};
-#if 0
-/**
- * IBusFactoryInfo:
- * @path: D-Bus path for the IME.
- * @name: D-Bus name for the IME.
- * @lang: Supporting language of the IME.
- * @icon: Icon file of the IME.
- * @authors: Authors of the IME.
- * @credits: Credits of the IME.
- *
- * An IBusFactoryInfo stores information about an IME.
- * So CreateEngine method can create instances of that IME.
- */
-struct _IBusFactoryInfo {
- IBusSerializable parent;
-
- /* instance members */
- /*< public >*/
- gchar *path;
- gchar *name;
- gchar *lang;
- gchar *icon;
- gchar *authors;
- gchar *credits;
-};
-
-struct _IBusFactoryInfoClass {
- IBusSerializableClass parent;
-
- /* signals */
-
- /*< private >*/
- /* padding */
- gpointer pdummy[8];
-};
-#endif
-
GType ibus_factory_get_type (void);
/**
const gchar *engine_name,
GType engine_type);
-#if 0
-/**
- * ibus_factory_get_info:
- * @factory: An IBusFactory.
- * @returns: A corresponding IbusFactoryInfo.
- *
- * Get IBusFactoryInfo out of IBusFactory.
- *
- * <note><para>This function is currently commented out</para></note>
- */
-IBusFactoryInfo *ibus_factory_get_info (IBusFactory *factory);
-
-GType ibus_factory_info_get_type (void);
-
-/**
- * ibus_factory_info_new:
- * @path: D-Bus path for the IME.
- * @name: IME name.
- * @lang: Supporting language of the IME.
- * @icon: Icon file of the IME.
- * @authors: Authors of the IME.
- * @credits: Credits of the IME.
- * @returns: A newly allocated IBusFactoryInfo.
- *
- * New an IBusFactoryInfo.
- */
-IBusFactoryInfo *ibus_factory_info_new (const gchar *path,
- const gchar *name,
- const gchar *lang,
- const gchar *icon,
- const gchar *authors,
- const gchar *credits);
-
-#endif
-
G_END_DECLS
#endif