// static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_connection_init (BusConnection *connection);
static void bus_connection_destroy (BusConnection *connection);
static gboolean bus_connection_authenticate_unix_user
(IBusConnection *connection,
static guint dbus_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_dbus_impl_init (BusDBusImpl *dbus);
static void bus_dbus_impl_destroy (BusDBusImpl *dbus);
static gboolean bus_dbus_impl_ibus_message (BusDBusImpl *dbus,
BusConnection *connection,
// static guint engine_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_engine_proxy_init (BusEngineProxy *engine);
static void bus_engine_proxy_real_destroy (BusEngineProxy *engine);
static gboolean bus_engine_proxy_ibus_signal (IBusProxy *proxy,
#include "option.h"
/* functions prototype */
-static void bus_factory_proxy_init (BusFactoryProxy *factory);
static void bus_factory_proxy_destroy (BusFactoryProxy *factory);
G_DEFINE_TYPE (BusFactoryProxy, bus_factory_proxy, IBUS_TYPE_PROXY)
// static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_ibus_impl_init (BusIBusImpl *ibus);
static void bus_ibus_impl_destroy (BusIBusImpl *ibus);
static gboolean bus_ibus_impl_ibus_message (BusIBusImpl *ibus,
BusConnection *connection,
static guint context_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_input_context_init (BusInputContext *context);
static void bus_input_context_destroy (BusInputContext *context);
static gboolean bus_input_context_ibus_message (BusInputContext *context,
BusConnection *connection,
(G_TYPE_INSTANCE_GET_PRIVATE ((o), BUS_TYPE_CONFIG_PROXY, BusMatchRulePrivate))
-static void bus_match_rule_init (BusMatchRule *rule);
static void bus_match_rule_destroy (BusMatchRule *rule);
static void _connection_destroy_cb (BusConnection *connection,
BusMatchRule *rule);
static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_registry_init (BusRegistry *registry);
static void bus_registry_destroy (BusRegistry *registry);
static void bus_registry_load (BusRegistry *registry);
static void bus_registry_load_in_dir (BusRegistry *registry,
#include "ibusimpl.h"
/* functions prototype */
-static void bus_server_init (BusServer *server);
static void bus_server_destroy (BusServer *server);
static void bus_server_new_connection
(BusServer *server,
#include "ibusattribute.h"
/* functions prototype */
-static void ibus_attribute_class_init (IBusAttributeClass *klass);
-static void ibus_attribute_init (IBusAttribute *attr);
// static void ibus_attribute_destroy (IBusAttribute *attr);
static gboolean ibus_attribute_serialize (IBusAttribute *attr,
IBusMessageIter *iter);
static gboolean ibus_attribute_copy (IBusAttribute *dest,
const IBusAttribute *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_attribute_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusAttributeClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_attribute_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusAttribute),
- 0,
- (GInstanceInitFunc) ibus_attribute_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusAttribute",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusAttribute, ibus_attribute, IBUS_TYPE_SERIALIZABLE)
static void
ibus_attribute_class_init (IBusAttributeClass *klass)
{
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
// object_class->destroy = (IBusObjectDestroyFunc) ibus_attribute_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_attribute_serialize;
// static void
// ibus_attribute_destroy (IBusAttribute *attr)
// {
-// IBUS_OBJECT (parent_class)->destroy ((IBusObject *)attr);
+// IBUS_OBJECT (ibus_attribute_parent_class)->destroy ((IBusObject *)attr);
// }
static gboolean
{
gboolean retval;
- retval = parent_class->serialize ((IBusSerializable *) attr, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attribute_parent_class)->serialize ((IBusSerializable *) attr, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_ATTRIBUTE (attr), FALSE);
{
gboolean retval;
- retval = parent_class->deserialize ((IBusSerializable *) attr, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attribute_parent_class)->deserialize ((IBusSerializable *) attr, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_ATTRIBUTE (attr), FALSE);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest,
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attribute_parent_class)->copy ((IBusSerializable *)dest,
(IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
#include "ibusattrlist.h"
/* functions prototype */
-static void ibus_attr_list_class_init (IBusAttrListClass *klass);
-static void ibus_attr_list_init (IBusAttrList *attr_list);
static void ibus_attr_list_destroy (IBusAttrList *attr_list);
static gboolean ibus_attr_list_serialize (IBusAttrList *attr_list,
IBusMessageIter *iter);
static gboolean ibus_attr_list_copy (IBusAttrList *dest,
const IBusAttrList *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_attr_list_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusAttrListClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_attr_list_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusAttrList),
- 0,
- (GInstanceInitFunc) ibus_attr_list_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusAttrList",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusAttrList, ibus_attr_list, IBUS_TYPE_SERIALIZABLE)
static void
ibus_attr_list_class_init (IBusAttrListClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_attr_list_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_attr_list_serialize;
g_array_free (attr_list->attributes, TRUE);
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)attr_list);
+ IBUS_OBJECT_CLASS (ibus_attr_list_parent_class)->destroy ((IBusObject *)attr_list);
}
static gboolean
gboolean retval;
guint i;
- retval = parent_class->serialize ((IBusSerializable *)attr_list, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->serialize ((IBusSerializable *)attr_list, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_ATTR_LIST (attr_list), FALSE);
DBusMessageIter array_iter;
gboolean retval;
- retval = parent_class->deserialize ((IBusSerializable *)attr_list, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->deserialize ((IBusSerializable *)attr_list, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_recurse (iter, IBUS_TYPE_ARRAY, &array_iter);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest,
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->copy ((IBusSerializable *)dest,
(IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
static guint bus_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_bus_class_init (IBusBusClass *klass);
-static void ibus_bus_init (IBusBus *bus);
static void ibus_bus_destroy (IBusObject *object);
static void ibus_bus_watch_dbus_signal
(IBusBus *bus);
static void ibus_bus_unwatch_dbus_signal
(IBusBus *bus);
-static IBusObjectClass *parent_class = NULL;
-GType
-ibus_bus_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusBusClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_bus_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusBus),
- 0,
- (GInstanceInitFunc) ibus_bus_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusBus",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusBus, ibus_bus, IBUS_TYPE_OBJECT)
IBusBus *
ibus_bus_new (void)
{
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusBusPrivate));
ibus_object_class->destroy = ibus_bus_destroy;
priv->connection = NULL;
}
- IBUS_OBJECT_CLASS (parent_class)->destroy (object);
+ IBUS_OBJECT_CLASS (ibus_bus_parent_class)->destroy (object);
}
gboolean
// static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_component_class_init (IBusComponentClass *klass);
-static void ibus_component_init (IBusComponent *component);
static void ibus_component_destroy (IBusComponent *component);
static gboolean ibus_component_serialize (IBusComponent *component,
IBusMessageIter *iter);
XMLNode *node,
gboolean access_fs);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_component_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusComponentClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_component_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusComponent),
- 0,
- (GInstanceInitFunc) ibus_component_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusComponent",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
-
+G_DEFINE_TYPE (IBusComponent, ibus_component, IBUS_TYPE_SERIALIZABLE)
static void
ibus_component_class_init (IBusComponentClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_component_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_component_serialize;
g_list_free (component->engines);
component->engines = NULL;
- IBUS_OBJECT_CLASS (parent_class)->destroy (IBUS_OBJECT (component));
+ IBUS_OBJECT_CLASS (ibus_component_parent_class)->destroy (IBUS_OBJECT (component));
}
static gboolean
IBusMessageIter array_iter;
GList *p;
- retval = parent_class->serialize ((IBusSerializable *)component, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_component_parent_class)->serialize ((IBusSerializable *)component, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_append (iter, G_TYPE_STRING, &component->name);
gchar *str;
IBusMessageIter array_iter;
- retval = parent_class->deserialize ((IBusSerializable *)component, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_component_parent_class)->deserialize ((IBusSerializable *)component, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_get (iter, G_TYPE_STRING, &str);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest,
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_component_parent_class)->copy ((IBusSerializable *)dest,
(IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
static guint connection_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_connection_class_init (IBusConnectionClass *klass);
-static void ibus_connection_init (IBusConnection *connection);
static void ibus_connection_destroy (IBusConnection *connection);
static gboolean ibus_connection_authenticate_unix_user
IBusMessage *message,
IBusConnection *connection);
-static IBusObjectClass *parent_class = NULL;
static GHashTable *_connections = NULL;
-GType
-ibus_connection_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusConnectionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_connection_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusConnection),
- 0,
- (GInstanceInitFunc) ibus_connection_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusConnection",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusConnection, ibus_connection, IBUS_TYPE_OBJECT)
IBusConnection *
ibus_connection_new (void)
{
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusConnectionPrivate));
object_class->destroy = (IBusObjectDestroyFunc) ibus_connection_destroy;
}
} while (0);
- parent_class->destroy (IBUS_OBJECT (connection));
+ IBUS_OBJECT_CLASS (ibus_connection_parent_class)->destroy (IBUS_OBJECT (connection));
}
static gboolean
static guint engine_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_engine_class_init (IBusEngineClass *klass);
-static void ibus_engine_init (IBusEngine *engine);
static void ibus_engine_destroy (IBusEngine *engine);
static void ibus_engine_set_property (IBusEngine *engine,
guint prop_id,
const gchar *prop_name);
-static IBusServiceClass *parent_class = NULL;
-
-GType
-ibus_engine_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusEngineClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_engine_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusEngine),
- 0,
- (GInstanceInitFunc) ibus_engine_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVICE,
- "IBusEngine",
- &type_info,
- (GTypeFlags) 0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusEngine, ibus_engine, IBUS_TYPE_SERVICE)
IBusEngine *
ibus_engine_new (const gchar *name,
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusServiceClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusEnginePrivate));
gobject_class->set_property = (GObjectSetPropertyFunc) ibus_engine_set_property;
priv->connection = NULL;
}
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (engine));
+ IBUS_OBJECT_CLASS(ibus_engine_parent_class)->destroy (IBUS_OBJECT (engine));
}
static void
name = ibus_message_get_member (message);
if (interface != NULL && g_strcmp0 (interface, IBUS_INTERFACE_ENGINE) != 0)
- return parent_class->ibus_message ((IBusService *) engine, connection, message);
+ return IBUS_SERVICE_CLASS (ibus_engine_parent_class)->ibus_message (
+ (IBusService *) engine, connection, message);
do {
if (g_strcmp0 (name, "ProcessKeyEvent") == 0) {
// static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_engine_desc_class_init (IBusEngineDescClass *klass);
-static void ibus_engine_desc_init (IBusEngineDesc *desc);
static void ibus_engine_desc_destroy (IBusEngineDesc *desc);
static gboolean ibus_engine_desc_serialize (IBusEngineDesc *desc,
IBusMessageIter *iter);
static gboolean ibus_engine_desc_parse_xml_node (IBusEngineDesc *desc,
XMLNode *node);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_engine_desc_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusEngineDescClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_engine_desc_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusEngineDesc),
- 0,
- (GInstanceInitFunc) ibus_engine_desc_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusEngineDesc",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusEngineDesc, ibus_engine_desc, IBUS_TYPE_SERIALIZABLE)
static void
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_engine_desc_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_engine_desc_serialize;
g_free (desc->icon);
g_free (desc->layout);
- IBUS_OBJECT_CLASS (parent_class)->destroy (IBUS_OBJECT (desc));
+ IBUS_OBJECT_CLASS (ibus_engine_desc_parent_class)->destroy (IBUS_OBJECT (desc));
}
static gboolean
{
gboolean retval;
- retval = parent_class->serialize ((IBusSerializable *)desc, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_engine_desc_parent_class)->serialize ((IBusSerializable *)desc, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_append (iter, G_TYPE_STRING, &desc->name);
gboolean retval;
gchar *str;
- retval = parent_class->deserialize ((IBusSerializable *)desc, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_engine_desc_parent_class)->deserialize ((IBusSerializable *)desc, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_get (iter, G_TYPE_STRING, &str);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest,
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_engine_desc_parent_class)->copy ((IBusSerializable *)dest,
(IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
typedef struct _IBusFactoryPrivate IBusFactoryPrivate;
/* functions prototype */
-static void ibus_factory_class_init (IBusFactoryClass *klass);
-static void ibus_factory_init (IBusFactory *factory);
static void ibus_factory_destroy (IBusFactory *factory);
static gboolean ibus_factory_ibus_message (IBusFactory *factory,
IBusConnection *connection,
static void _engine_destroy_cb (IBusEngine *engine,
IBusFactory *factory);
-static IBusServiceClass *factory_parent_class = NULL;
-
-GType
-ibus_factory_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusFactoryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_factory_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusFactory),
- 0,
- (GInstanceInitFunc) ibus_factory_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVICE,
- "IBusFactory",
- &type_info,
- (GTypeFlags) 0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusFactory, ibus_factory, IBUS_TYPE_SERVICE)
IBusFactory *
ibus_factory_new (IBusConnection *connection)
// GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- factory_parent_class = (IBusServiceClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusFactoryPrivate));
ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_factory_destroy;
g_object_unref (priv->connection);
}
- IBUS_OBJECT_CLASS(factory_parent_class)->destroy (IBUS_OBJECT (factory));
+ IBUS_OBJECT_CLASS(ibus_factory_parent_class)->destroy (IBUS_OBJECT (factory));
}
static void
return TRUE;
}
- return factory_parent_class->ibus_message ((IBusService *)factory,
- connection,
- message);
+ return IBUS_SERVICE_CLASS (ibus_factory_parent_class)->ibus_message (
+ (IBusService *)factory,
+ connection,
+ message);
}
void
// static guint context_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_input_context_class_init (IBusInputContextClass *klass);
-static void ibus_input_context_init (IBusInputContext *context);
static void ibus_input_context_real_destroy (IBusInputContext *context);
static gboolean ibus_input_context_ibus_signal (IBusProxy *proxy,
DBusMessage *message);
-static IBusProxyClass *parent_class = NULL;
-
-GType
-ibus_input_context_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusInputContextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_input_context_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusInputContext),
- 0,
- (GInstanceInitFunc) ibus_input_context_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_PROXY,
- "IBusInputContext",
- &type_info,
- (GTypeFlags)0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusInputContext, ibus_input_context, IBUS_TYPE_PROXY)
IBusInputContext *
ibus_input_context_new (const gchar *path,
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
IBusProxyClass *proxy_class = IBUS_PROXY_CLASS (klass);
-
- parent_class = (IBusProxyClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusInputContextPrivate));
ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_input_context_real_destroy;
G_TYPE_INVALID);
}
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (context));
+ IBUS_OBJECT_CLASS(ibus_input_context_parent_class)->destroy (IBUS_OBJECT (context));
}
static gboolean
#include "ibuskeymap.h"
/* functions prototype */
-static void ibus_keymap_class_init (IBusKeymapClass *klass);
-static void ibus_keymap_init (IBusKeymap *keymap);
static void ibus_keymap_destroy (IBusKeymap *keymap);
static gboolean ibus_keymap_load (const gchar *name,
KEYMAP keymap);
-static IBusObjectClass *parent_class = NULL;
static GHashTable *keymaps = NULL;
-GType
-ibus_keymap_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusKeymapClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_keymap_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusKeymap),
- 0,
- (GInstanceInitFunc) ibus_keymap_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusKeymap",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusKeymap, ibus_keymap, IBUS_TYPE_OBJECT)
static void
ibus_keymap_class_init (IBusKeymapClass *klass)
{
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_keymap_destroy;
}
g_free (keymap->name);
keymap->name = NULL;
}
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)keymap);
+ IBUS_OBJECT_CLASS (ibus_keymap_parent_class)->destroy ((IBusObject *)keymap);
}
#define SKIP_SPACE(p) \
#include "ibuslookuptable.h"
/* functions prototype */
-static void ibus_lookup_table_class_init (IBusLookupTableClass *klass);
-static void ibus_lookup_table_init (IBusLookupTable *table);
static void ibus_lookup_table_destroy (IBusLookupTable *table);
static gboolean ibus_lookup_table_serialize (IBusLookupTable *table,
IBusMessageIter *iter);
static gboolean ibus_lookup_table_copy (IBusLookupTable *dest,
IBusLookupTable *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_lookup_table_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusLookupTableClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_lookup_table_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusLookupTable),
- 0,
- (GInstanceInitFunc) ibus_lookup_table_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusLookupTable",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusLookupTable, ibus_lookup_table, IBUS_TYPE_SERIALIZABLE)
static void
ibus_lookup_table_class_init (IBusLookupTableClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_lookup_table_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_lookup_table_serialize;
g_free (p);
}
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *) table);
+ IBUS_OBJECT_CLASS (ibus_lookup_table_parent_class)->destroy ((IBusObject *) table);
}
static gboolean
gboolean retval;
guint i;
- retval = parent_class->serialize ((IBusSerializable *)table, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_lookup_table_parent_class)->serialize ((IBusSerializable *)table, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_LOOKUP_TABLE (table), FALSE);
DBusMessageIter array_iter;
gboolean retval;
- retval = parent_class->deserialize ((IBusSerializable *)table, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_lookup_table_parent_class)->deserialize ((IBusSerializable *)table, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_LOOKUP_TABLE (table), FALSE);
gboolean retval;
guint i;
- retval = parent_class->copy ((IBusSerializable *)dest, (IBusSerializable *)src);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_lookup_table_parent_class)->copy ((IBusSerializable *)dest, (IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_LOOKUP_TABLE (dest), FALSE);
#endif
/* functions prototype */
-static void ibus_object_class_init (IBusObjectClass *klass);
-static void ibus_object_init (IBusObject *obj);
static GObject *ibus_object_constructor (GType type,
guint n,
GObjectConstructParam
static void ibus_object_finalize (IBusObject *obj);
static void ibus_object_real_destroy (IBusObject *obj);
-static GObjectClass *parent_class = NULL;
-
-
-GType
-ibus_object_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusObjectClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_object_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusObject),
- 0,
- (GInstanceInitFunc) ibus_object_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (G_TYPE_INITIALLY_UNOWNED,
- "IBusObject",
- &type_info,
- G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusObject, ibus_object, G_TYPE_INITIALLY_UNOWNED)
/**
* ibus_object_new:
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- parent_class = (GObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusObjectPrivate));
gobject_class->constructor = ibus_object_constructor;
{
GObject *object;
- object = parent_class->constructor (type, n ,args);
+ object = G_OBJECT_CLASS (ibus_object_parent_class)->constructor (type, n ,args);
#ifdef DEBUG_MEMORY
if (object != NULL) {
IBUS_OBJECT_UNSET_FLAGS (obj, IBUS_IN_DESTRUCTION);
}
- G_OBJECT_CLASS(parent_class)->dispose (G_OBJECT (obj));
+ G_OBJECT_CLASS(ibus_object_parent_class)->dispose (G_OBJECT (obj));
}
static void
g_debug ("Finalize %s, count = %d, all = %d", G_OBJECT_TYPE_NAME (obj), count, _count);
#endif
- G_OBJECT_CLASS(parent_class)->finalize (G_OBJECT (obj));
+ G_OBJECT_CLASS(ibus_object_parent_class)->finalize (G_OBJECT (obj));
}
static void
// static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_observed_path_class_init (IBusObservedPathClass *klass);
-static void ibus_observed_path_init (IBusObservedPath *path);
static void ibus_observed_path_destroy (IBusObservedPath *path);
static gboolean ibus_observed_path_serialize (IBusObservedPath *path,
IBusMessageIter *iter);
static gboolean ibus_observed_path_parse_xml_node (IBusObservedPath *path,
XMLNode *node);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_observed_path_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusObservedPathClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_observed_path_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusObservedPath),
- 0,
- (GInstanceInitFunc) ibus_observed_path_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusObservedPath",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
-
+G_DEFINE_TYPE (IBusObservedPath, ibus_observed_path, IBUS_TYPE_SERIALIZABLE)
static void
ibus_observed_path_class_init (IBusObservedPathClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
// g_type_class_add_private (klass, sizeof (IBusObservedPathPrivate));
object_class->destroy = (IBusObjectDestroyFunc) ibus_observed_path_destroy;
ibus_observed_path_destroy (IBusObservedPath *path)
{
g_free (path->path);
- IBUS_OBJECT_CLASS (parent_class)->destroy (IBUS_OBJECT (path));
+ IBUS_OBJECT_CLASS (ibus_observed_path_parent_class)->destroy (IBUS_OBJECT (path));
}
static gboolean
{
gboolean retval;
- retval = parent_class->serialize ((IBusSerializable *)path, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->serialize ((IBusSerializable *)path, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_append (iter, G_TYPE_STRING, &(path->path));
gboolean retval;
gchar *str;
- retval = parent_class->deserialize ((IBusSerializable *)path, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->deserialize ((IBusSerializable *)path, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_get (iter, G_TYPE_STRING, &str);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest, (IBusSerializable *)src);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->copy ((IBusSerializable *)dest, (IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
dest->path = g_strdup (src->path);
};
/* functions prototype */
-static void ibus_panel_service_class_init (IBusPanelServiceClass *klass);
-static void ibus_panel_service_init (IBusPanelService *panel);
static void ibus_panel_service_service_set_property (IBusPanelService *panel,
guint prop_id,
const GValue *value,
IBusProperty *prop,
IBusError **error);
-static IBusServiceClass *parent_class = NULL;
-
-GType
-ibus_panel_service_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusPanelServiceClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_panel_service_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusPanelService),
- 0,
- (GInstanceInitFunc) ibus_panel_service_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVICE,
- "IBusPanelService",
- &type_info,
- (GTypeFlags)0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusPanelService, ibus_panel_service, IBUS_TYPE_SERVICE)
IBusPanelService *
ibus_panel_service_new (IBusConnection *connection)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- parent_class = (IBusServiceClass *) g_type_class_peek_parent (klass);
-
gobject_class->set_property = (GObjectSetPropertyFunc) ibus_panel_service_service_set_property;
gobject_class->get_property = (GObjectGetPropertyFunc) ibus_panel_service_service_get_property;
static void
ibus_panel_service_real_destroy (IBusPanelService *panel)
{
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (panel));
+ IBUS_OBJECT_CLASS(ibus_panel_service_parent_class)->destroy (IBUS_OBJECT (panel));
}
static gboolean
#include "ibusproplist.h"
/* functions prototype */
-static void ibus_property_class_init (IBusPropertyClass *klass);
-static void ibus_property_init (IBusProperty *prop);
static void ibus_property_destroy (IBusProperty *prop);
static gboolean ibus_property_serialize (IBusProperty *prop,
IBusMessageIter *iter);
static gboolean ibus_property_copy (IBusProperty *dest,
const IBusProperty *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_property_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusPropertyClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_property_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusProperty),
- 0,
- (GInstanceInitFunc) ibus_property_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusProperty",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusProperty, ibus_property, IBUS_TYPE_SERIALIZABLE)
static void
ibus_property_class_init (IBusPropertyClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_property_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_property_serialize;
prop->sub_props = NULL;
}
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)prop);
+ IBUS_OBJECT_CLASS (ibus_property_parent_class)->destroy ((IBusObject *)prop);
}
gboolean
{
gboolean retval;
- retval = parent_class->serialize ((IBusSerializable *) prop, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->serialize ((IBusSerializable *) prop, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_PROPERTY (prop), FALSE);
gboolean retval;
gchar *p;
- retval = parent_class->deserialize ((IBusSerializable *) prop, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->deserialize ((IBusSerializable *) prop, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_get (iter, G_TYPE_STRING, &p);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *) dest, (IBusSerializable *) src);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_property_parent_class)->copy ((IBusSerializable *) dest, (IBusSerializable *) src);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_PROPERTY (dest), FALSE);
#include "ibusproplist.h"
/* functions prototype */
-static void ibus_prop_list_class_init (IBusPropListClass *klass);
-static void ibus_prop_list_init (IBusPropList *prop_list);
static void ibus_prop_list_destroy (IBusPropList *prop_list);
static gboolean ibus_prop_list_serialize (IBusPropList *prop_list,
IBusMessageIter *iter);
static gboolean ibus_prop_list_copy (IBusPropList *dest,
const IBusPropList *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_prop_list_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusPropListClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_prop_list_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusProperty),
- 0,
- (GInstanceInitFunc) ibus_prop_list_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusPropList",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusPropList, ibus_prop_list, IBUS_TYPE_SERIALIZABLE)
static void
ibus_prop_list_class_init (IBusPropListClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
-
object_class->destroy = (IBusObjectDestroyFunc) ibus_prop_list_destroy;
serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_prop_list_serialize;
}
g_free (p);
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *) prop_list);
+ IBUS_OBJECT_CLASS (ibus_prop_list_parent_class)->destroy ((IBusObject *) prop_list);
}
static gboolean
IBusProperty *prop;
guint i;
- retval = parent_class->serialize ((IBusSerializable *) prop_list, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_prop_list_parent_class)->serialize ((IBusSerializable *) prop_list, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_open_container (iter, IBUS_TYPE_ARRAY, "v", &array_iter);
IBusMessageIter array_iter;
IBusProperty *prop;
- retval = parent_class->deserialize ((IBusSerializable *) prop_list, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_prop_list_parent_class)->deserialize ((IBusSerializable *) prop_list, iter);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_PROP_LIST (prop_list), FALSE);
IBusProperty *prop;
guint i;
- retval = parent_class->copy ((IBusSerializable *) dest,
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_prop_list_parent_class)->copy ((IBusSerializable *) dest,
(const IBusSerializable *) src);
g_return_val_if_fail (retval, FALSE);
static guint proxy_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_proxy_class_init (IBusProxyClass *klass);
-static void ibus_proxy_init (IBusProxy *proxy);
static GObject *ibus_proxy_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params);
static gboolean ibus_proxy_ibus_signal (IBusProxy *proxy,
IBusMessage *message);
-static IBusObjectClass *parent_class = NULL;
-
-GType
-ibus_proxy_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusProxyClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_proxy_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusProxy),
- 0,
- (GInstanceInitFunc) ibus_proxy_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusProxy",
- &type_info,
- (GTypeFlags)0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusProxy, ibus_proxy, IBUS_TYPE_OBJECT)
IBusProxy *
ibus_proxy_new (const gchar *name,
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusProxyPrivate));
gobject_class->constructor = ibus_proxy_constructor;
IBusProxy *proxy;
IBusProxyPrivate *priv;
- obj = G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_params, construct_params);
+ obj = G_OBJECT_CLASS (ibus_proxy_parent_class)->constructor (type, n_construct_params, construct_params);
proxy = IBUS_PROXY (obj);
priv = IBUS_PROXY_GET_PRIVATE (proxy);
priv->connection = NULL;
}
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (proxy));
+ IBUS_OBJECT_CLASS(ibus_proxy_parent_class)->destroy (IBUS_OBJECT (proxy));
}
static void
static IBusObjectClass *parent_class = NULL;
-
GType
ibus_serializable_get_type (void)
{
static guint server_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_server_class_init (IBusServerClass *klass);
-static void ibus_server_init (IBusServer *server);
static void ibus_server_destroy (IBusServer *server);
static void ibus_server_set_property(IBusServer *server,
guint prop_id,
(IBusServer *server,
IBusConnection *connection);
-static IBusObjectClass *parent_class = NULL;
-
-GType
-ibus_server_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusServerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_server_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusServer),
- 0,
- (GInstanceInitFunc) ibus_server_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusServer",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusServer, ibus_server, IBUS_TYPE_OBJECT)
IBusServer *
ibus_server_new (void)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusServerPrivate));
gobject_class->set_property = (GObjectSetPropertyFunc) ibus_server_set_property;
priv->server = NULL;
}
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (server));
+ IBUS_OBJECT_CLASS(ibus_server_parent_class)->destroy (IBUS_OBJECT (server));
}
static void
static guint service_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void ibus_service_class_init (IBusServiceClass *klass);
-static void ibus_service_init (IBusService *service);
static void ibus_service_destroy (IBusService *service);
static void ibus_service_set_property (IBusService *service,
guint prop_id,
IBusConnection *connection,
IBusMessage *message);
-static IBusObjectClass *parent_class = NULL;
-
-GType
-ibus_service_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusServiceClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_service_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (IBusService),
- 0,
- (GInstanceInitFunc) ibus_service_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "IBusService",
- &type_info,
- (GTypeFlags) 0);
- }
- return type;
-}
+G_DEFINE_TYPE (IBusService, ibus_service, IBUS_TYPE_OBJECT)
IBusService *
ibus_service_new (const gchar *path)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
g_type_class_add_private (klass, sizeof (IBusServicePrivate));
gobject_class->set_property = (GObjectSetPropertyFunc) ibus_service_set_property;
g_free (priv->path);
priv->path = NULL;
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (service));
+ IBUS_OBJECT_CLASS(ibus_service_parent_class)->destroy (IBUS_OBJECT (service));
}
static void
#include "ibustext.h"
/* functions prototype */
-static void ibus_text_class_init (IBusTextClass *klass);
-static void ibus_text_init (IBusText *text);
static void ibus_text_destroy (IBusText *text);
static gboolean ibus_text_serialize (IBusText *text,
IBusMessageIter *iter);
static gboolean ibus_text_copy (IBusText *dest,
const IBusText *src);
-static IBusSerializableClass *parent_class = NULL;
-
-GType
-ibus_text_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (IBusTextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ibus_text_class_init,
- NULL, /* class finialize */
- NULL, /* class data */
- sizeof (IBusText),
- 0,
- (GInstanceInitFunc) ibus_text_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
- "IBusText",
- &type_info,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (IBusText, ibus_text, IBUS_TYPE_SERIALIZABLE)
static void
ibus_text_class_init (IBusTextClass *klass)
IBusObjectClass *object_class = IBUS_OBJECT_CLASS (klass);
IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (klass);
- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
+ ibus_text_parent_class = (IBusSerializableClass *) g_type_class_peek_parent (klass);
object_class->destroy = (IBusObjectDestroyFunc) ibus_text_destroy;
text->attrs = NULL;
}
- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)text);
+ IBUS_OBJECT_CLASS (ibus_text_parent_class)->destroy ((IBusObject *)text);
}
static gboolean
{
gboolean retval;
- retval = parent_class->serialize ((IBusSerializable *)text, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_text_parent_class)->serialize (
+ (IBusSerializable *)text, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_append (iter, G_TYPE_STRING, &text->text);
gboolean retval;
gchar *str;
- retval = parent_class->deserialize ((IBusSerializable *)text, iter);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_text_parent_class)->deserialize (
+ (IBusSerializable *)text, iter);
g_return_val_if_fail (retval, FALSE);
retval = ibus_message_iter_get (iter, G_TYPE_STRING, &str);
{
gboolean retval;
- retval = parent_class->copy ((IBusSerializable *)dest,
- (IBusSerializable *)src);
+ retval = IBUS_SERIALIZABLE_CLASS (ibus_text_parent_class)->copy (
+ (IBusSerializable *)dest,
+ (IBusSerializable *)src);
g_return_val_if_fail (retval, FALSE);
g_return_val_if_fail (IBUS_IS_TEXT (dest), FALSE);