From: Peng Huang Date: Tue, 12 Jan 2010 09:07:21 +0000 (+0800) Subject: Remove Class IBusFactoryInfo X-Git-Tag: 1.2.99.20100202~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e7a45b333ae667e79647842d3e8c3e6412c33d7;p=platform%2Fupstream%2Fibus.git Remove Class IBusFactoryInfo --- diff --git a/docs/reference/ibus/ibus.types b/docs/reference/ibus/ibus.types index bb6c539..f992c65 100644 --- a/docs/reference/ibus/ibus.types +++ b/docs/reference/ibus/ibus.types @@ -14,7 +14,6 @@ ibus_capabilite_get_type ibus_orientation_get_type ibus_service_get_type ibus_factory_get_type -ibus_factory_info_get_type ibus_text_get_type ibus_config_service_get_type ibus_server_get_type diff --git a/src/ibusfactory.c b/src/ibusfactory.c index 91ff588..738c150 100644 --- a/src/ibusfactory.c +++ b/src/ibusfactory.c @@ -50,25 +50,9 @@ static gboolean ibus_factory_ibus_message (IBusFactory *factory, 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) { @@ -276,213 +260,3 @@ ibus_factory_add_engine (IBusFactory *factory, 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 diff --git a/src/ibusfactory.h b/src/ibusfactory.h index a88538c..4293d7d 100644 --- a/src/ibusfactory.h +++ b/src/ibusfactory.h @@ -35,12 +35,13 @@ #include "ibusservice.h" #include "ibusserializable.h" +G_BEGIN_DECLS + /* * Type macros. */ /* define GOBJECT macros */ - /** * IBUS_TYPE_FACTORY: * @@ -96,31 +97,9 @@ #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: * @@ -142,43 +121,6 @@ struct _IBusFactoryClass { 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); /** @@ -202,41 +144,6 @@ void ibus_factory_add_engine (IBusFactory *factory, 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. - * - * This function is currently commented out - */ -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