static guint context_signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_input_context_class_init (BusInputContextClass *klass);
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,
static void _engine_destroy_cb (BusEngineProxy *factory,
BusInputContext *context);
-static IBusServiceClass *parent_class = NULL;
static guint id = 0;
static IBusText *text_empty = NULL;
static IBusLookupTable *lookup_table_empty = NULL;
static IBusPropList *props_empty = NULL;
-GType
-bus_input_context_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (BusInputContextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) bus_input_context_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (BusInputContext),
- 0,
- (GInstanceInitFunc) bus_input_context_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVICE,
- "BusInputContext",
- &type_info,
- (GTypeFlags) 0);
- }
- return type;
-}
+G_DEFINE_TYPE (BusInputContext, bus_input_context, IBUS_TYPE_SERVICE)
static void
_connection_destroy_cb (BusConnection *connection,
{
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusServiceClass *) g_type_class_peek_parent (klass);
-
ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_input_context_destroy;
- IBUS_SERVICE_CLASS (klass)->ibus_message = (ServiceIBusMessageFunc) bus_input_context_ibus_message;
+ IBUS_SERVICE_CLASS (klass)->ibus_message =
+ (ServiceIBusMessageFunc) bus_input_context_ibus_message;
/* install signals */
context_signals[PROCESS_KEY_EVENT] =
context->client = NULL;
}
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (context));
+ IBUS_OBJECT_CLASS(bus_input_context_parent_class)->destroy (IBUS_OBJECT (context));
}
/* introspectable interface */
}
}
- return parent_class->ibus_message ((IBusService *)context,
- (IBusConnection *)connection,
- message);
+ return IBUS_SERVICE_CLASS (bus_input_context_parent_class)->ibus_message (
+ (IBusService *)context,
+ (IBusConnection *)connection,
+ message);
}
(G_TYPE_INSTANCE_GET_PRIVATE ((o), BUS_TYPE_CONFIG_PROXY, BusMatchRulePrivate))
-static void bus_match_rule_class_init (BusMatchRuleClass *klass);
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 IBusObjectClass *parent_class = NULL;
-GType
-bus_match_rule_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (BusMatchRuleClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) bus_match_rule_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (BusMatchRule),
- 0,
- (GInstanceInitFunc) bus_match_rule_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "BusMatchRule",
- &type_info,
- (GTypeFlags)0);
- }
- return type;
-}
+G_DEFINE_TYPE (BusMatchRule, bus_match_rule, IBUS_TYPE_OBJECT)
static void
bus_match_rule_class_init (BusMatchRuleClass *klass)
{
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_match_rule_destroy;
}
}
g_list_free (rule->recipients);
- IBUS_OBJECT_CLASS(parent_class)->destroy (IBUS_OBJECT (rule));
+ IBUS_OBJECT_CLASS(bus_match_rule_parent_class)->destroy (IBUS_OBJECT (rule));
}
static guint _signals[LAST_SIGNAL] = { 0 };
/* functions prototype */
-static void bus_registry_class_init (BusRegistryClass *klass);
static void bus_registry_init (BusRegistry *registry);
static void bus_registry_destroy (BusRegistry *registry);
static void bus_registry_load (BusRegistry *registry);
static gboolean bus_registry_check_modification(BusRegistry *registry);
static void bus_registry_remove_all (BusRegistry *registry);
-static IBusObjectClass *parent_class = NULL;
-
-GType
-bus_registry_get_type (void)
-{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (BusRegistryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) bus_registry_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (BusRegistry),
- 0,
- (GInstanceInitFunc) bus_registry_init,
- };
-
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_OBJECT,
- "BusRegistry",
- &type_info,
- (GTypeFlags)0);
- }
-
- return type;
-}
-
+G_DEFINE_TYPE (BusRegistry, bus_registry, IBUS_TYPE_OBJECT)
static void
bus_registry_class_init (BusRegistryClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
_signals[CHANGED] =
g_signal_new (I_("changed"),
G_TYPE_FROM_CLASS (gobject_class),
registry->mutex = NULL;
#endif
- IBUS_OBJECT_CLASS (parent_class)->destroy (IBUS_OBJECT (registry));
+ IBUS_OBJECT_CLASS (bus_registry_parent_class)->destroy (IBUS_OBJECT (registry));
}
#include "ibusimpl.h"
/* functions prototype */
-static void bus_server_class_init (BusServerClass *klass);
static void bus_server_init (BusServer *server);
static void bus_server_destroy (BusServer *server);
static void bus_server_new_connection
(BusServer *server,
BusConnection *connection);
-static IBusObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (BusServer, bus_server, IBUS_TYPE_SERVER)
-GType
-bus_server_get_type (void)
+static void
+bus_server_class_init (BusServerClass *klass)
{
- static GType type = 0;
-
- static const GTypeInfo type_info = {
- sizeof (BusServerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) bus_server_class_init,
- NULL, /* class finalize */
- NULL, /* class data */
- sizeof (BusServer),
- 0,
- (GInstanceInitFunc) bus_server_init,
- };
+ IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
- if (type == 0) {
- type = g_type_register_static (IBUS_TYPE_SERVER,
- "BusServer",
- &type_info,
- (GTypeFlags)0);
- }
+ ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_server_destroy;
- return type;
+ IBUS_SERVER_CLASS (klass)->new_connection =
+ (IBusNewConnectionFunc) bus_server_new_connection;
}
BusServer *
}
static void
-bus_server_class_init (BusServerClass *klass)
-{
- IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
-
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (klass);
-
- ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_server_destroy;
-
- IBUS_SERVER_CLASS (klass)->new_connection = (IBusNewConnectionFunc) bus_server_new_connection;
-}
-
-static void
bus_server_init (BusServer *server)
{
server->loop = g_main_loop_new (NULL, FALSE);
}
g_main_loop_unref (server->loop);
- IBUS_OBJECT_CLASS (parent_class)->destroy (IBUS_OBJECT (server));
+ IBUS_OBJECT_CLASS (bus_server_parent_class)->destroy (IBUS_OBJECT (server));
}