Fix some issues within codereview.
authorPeng Huang <shawn.p.huang@gmail.com>
Wed, 3 Nov 2010 04:37:57 +0000 (13:37 +0900)
committerPeng Huang <shawn.p.huang@gmail.com>
Wed, 3 Nov 2010 04:37:57 +0000 (13:37 +0900)
24 files changed:
bus/connection.c
bus/dbusimpl.c
bus/dbusimpl.h
bus/engineproxy.c
bus/factoryproxy.h
bus/ibusimpl.c
bus/inputcontext.c
bus/main.c
bus/matchrule.c
bus/registry.c
bus/server.c
bus/server.h
bus/test-client.c
client/gtk2/ibusimcontext.c
debian/rules
docs/reference/ibus/ibus-sections.txt
gconf/config.c
memconf/config.c
src/ibusbus.c
src/ibusconfigservice.c
src/ibusengine.c
src/ibusfactory.c
src/ibuspanelservice.c
src/ibusservice.c

index 0b8bec7..ab29b16 100644 (file)
@@ -61,9 +61,9 @@ static GQuark   bus_connection_quark        (void);
 G_DEFINE_TYPE (BusConnection, bus_connection, IBUS_TYPE_OBJECT)
 
 static void
-bus_connection_class_init (BusConnectionClass *klass)
+bus_connection_class_init (BusConnectionClass *class)
 {
-    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
+    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (class);
 
     ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_connection_destroy;
 }
@@ -133,7 +133,7 @@ bus_connection_set_dbus_connection (BusConnection   *connection,
 static GQuark
 bus_connection_quark (void)
 {
-    GQuark quark = 0;
+    static GQuark quark = 0;
     if (quark == 0) {
         quark = g_quark_from_static_string ("BUS_CONNECTION");
     }
@@ -226,14 +226,6 @@ bus_connection_add_match (BusConnection  *connection,
     return TRUE;
 }
 
-gboolean
-bus_connection_remove_match (BusConnection  *connection,
-                             const gchar    *rule)
-{
-    g_assert (BUS_IS_CONNECTION (connection));
-    return FALSE;
-}
-
 GDBusConnection *
 bus_connection_get_dbus_connection (BusConnection *connection)
 {
@@ -241,7 +233,6 @@ bus_connection_get_dbus_connection (BusConnection *connection)
     return connection->connection;
 }
 
-
 void
 bus_connection_set_filter (BusConnection             *connection,
                            GDBusMessageFilterFunction filter_func,
index 49fd388..5eb96d8 100644 (file)
@@ -44,7 +44,7 @@ struct _BusDBusImpl {
     GList *objects;
     GList *connections;
     GList *rules;
-    gint id;
+    guint id;
 
     GMutex *dispatch_lock;
     GList *dispatch_queue;
@@ -350,7 +350,15 @@ bus_dbus_impl_name_has_owner (BusDBusImpl           *dbus,
     g_variant_get (parameters, "(&s)", &name);
 
     gboolean has_owner;
-    if (name[0] == ':') {
+    if (!g_dbus_is_name (name)) {
+        g_dbus_method_invocation_return_error (invocation,
+                                               G_DBUS_ERROR,
+                                               G_DBUS_ERROR_FAILED,
+                                               "'%s' is not a legal bus name");
+        return;
+    }
+
+    if (g_dbus_is_unique_name (name)) {
         has_owner = g_hash_table_lookup (dbus->unique_names, name) != NULL;
     }
     else {
@@ -403,8 +411,8 @@ bus_dbus_impl_get_id (BusDBusImpl           *dbus,
                       GVariant              *parameters,
                       GDBusMethodInvocation *invocation)
 {
-    /* FXIME */
-    const gchar *uuid = "FXIME";
+    /* FIXME */
+    const gchar *uuid = "FIXME";
     g_dbus_method_invocation_return_value (invocation,
                     g_variant_new ("(s)", uuid));
 }
@@ -490,7 +498,9 @@ bus_dbus_impl_request_name (BusDBusImpl           *dbus,
     guint flags = 0;
     g_variant_get (parameters, "(&su)", &name, &flags);
 
-    if (name[0] == ':' || !g_dbus_is_name (name)) {
+    if (name == NULL ||
+        !g_dbus_is_name (name) ||
+        g_dbus_is_unique_name (name)) {
         g_dbus_method_invocation_return_error (invocation,
                         G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
                         "'%s' is not a legal service name.", name);
@@ -534,7 +544,9 @@ bus_dbus_impl_release_name (BusDBusImpl           *dbus,
     const gchar *name= NULL;
     g_variant_get (parameters, "(&s)", &name);
 
-    if (name[0] == ':' || !g_dbus_is_name (name)) {
+    if (name == NULL ||
+        !g_dbus_is_name (name) ||
+        g_dbus_is_unique_name (name)) {
         g_dbus_method_invocation_return_error (invocation,
                         G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
                         "'%s' is not a legal service name.", name);
@@ -687,54 +699,6 @@ bus_dbus_impl_service_set_property (IBusService        *service,
 
 }
 
-#if 1
-static void
-message_print(GDBusMessage *message)
-{
-    switch (g_dbus_message_get_message_type (message)) {
-    case G_DBUS_MESSAGE_TYPE_METHOD_CALL:
-        g_debug ("From %s to %s, CALL(%u) %s.%s (%s)",
-            g_dbus_message_get_sender (message),
-            g_dbus_message_get_destination (message),
-            g_dbus_message_get_serial (message),
-            g_dbus_message_get_interface (message),
-            g_dbus_message_get_member (message),
-            g_dbus_message_get_signature (message)
-            );
-        break;
-    case G_DBUS_MESSAGE_TYPE_METHOD_RETURN:
-        g_debug ("From %s to %s, RETURN(%u) (%s)",
-            g_dbus_message_get_sender (message),
-            g_dbus_message_get_destination (message),
-            g_dbus_message_get_reply_serial (message),
-            g_dbus_message_get_signature (message)
-            );
-        break;
-    case G_DBUS_MESSAGE_TYPE_ERROR:
-        g_debug ("From %s to %s, ERROR(%u) %s",
-            g_dbus_message_get_sender (message),
-            g_dbus_message_get_destination (message),
-            g_dbus_message_get_reply_serial (message),
-            g_dbus_message_get_error_name (message)
-            );
-        break;
-    case G_DBUS_MESSAGE_TYPE_SIGNAL:
-        g_debug ("From %s to %s, SIGNAL %s.%s (%s) @ %s",
-            g_dbus_message_get_sender (message),
-            g_dbus_message_get_destination (message),
-            g_dbus_message_get_interface (message),
-            g_dbus_message_get_member (message),
-            g_dbus_message_get_signature (message),
-            g_dbus_message_get_path (message)
-            );
-        break;
-    default:
-        break;
-    }
-
-}
-#endif
-
 static GDBusMessage *
 bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
                                     GDBusMessage    *message,
@@ -778,7 +742,6 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
             default:
                 /* dispatch signal messages by match rule */
                 bus_dbus_impl_dispatch_message_by_rule (dbus, message, NULL);
-                message_print (message);
                 g_object_unref (message);
                 g_return_val_if_reached (NULL);
             }
@@ -796,7 +759,6 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
             default:
                 /* dispatch signal messages by match rule */
                 bus_dbus_impl_dispatch_message_by_rule (dbus, message, NULL);
-                message_print (message);
                 g_object_unref (message);
                 g_return_val_if_reached (NULL);
             }
@@ -814,7 +776,6 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
             default:
                 /* dispatch signal messages by match rule */
                 bus_dbus_impl_dispatch_message_by_rule (dbus, message, NULL);
-                message_print (message);
                 g_object_unref (message);
                 g_return_val_if_reached (NULL);
             }
@@ -928,7 +889,7 @@ bus_dbus_impl_get_connection_by_name (BusDBusImpl    *dbus,
     g_assert (BUS_IS_DBUS_IMPL (dbus));
     g_assert (name != NULL);
 
-    if (G_LIKELY (name[0] == ':')) {
+    if (G_LIKELY (g_dbus_is_unique_name (name))) {
         return (BusConnection *)g_hash_table_lookup (dbus->unique_names, name);
     }
     else {
@@ -963,12 +924,12 @@ bus_dbus_impl_forward_message_idle_cb (BusDBusImpl   *dbus)
                                         NULL, &error);
         if (!retval) {
             g_warning ("send error failed:  %s.", error->message);
-            // message_print (message);
             g_error_free (error);
         }
     }
     else {
-        /* FIXME can not get destination */
+        /* FIXME What should we do, if can not get destination.
+         * It should not happen */
 #if 0
         if (g_dbus_message_get_message_type (message) == G_DBUS_MESSAGE_TYPE_METHOD_CALL) {
             /* reply an error message, if the destination does not exist */
index 6eb37a8..7bae195 100644 (file)
@@ -59,7 +59,6 @@ gboolean         bus_dbus_impl_new_connection   (BusDBusImpl    *dbus,
 BusConnection   *bus_dbus_impl_get_connection_by_name
                                                 (BusDBusImpl    *dbus,
                                                  const gchar    *name);
-/* FIXME */
 void             bus_dbus_impl_forward_message  (BusDBusImpl    *dbus,
                                                  BusConnection  *connection,
                                                  GDBusMessage   *message);
index 506e23f..f0ddd28 100644 (file)
@@ -85,15 +85,15 @@ static void     bus_engine_proxy_g_signal       (GDBusProxy         *proxy,
 G_DEFINE_TYPE (BusEngineProxy, bus_engine_proxy, IBUS_TYPE_PROXY)
 
 static void
-bus_engine_proxy_class_init (BusEngineProxyClass *klass)
+bus_engine_proxy_class_init (BusEngineProxyClass *class)
 {
-    IBUS_PROXY_CLASS (klass)->destroy = bus_engine_proxy_real_destroy;
-    G_DBUS_PROXY_CLASS (klass)->g_signal = bus_engine_proxy_g_signal;
+    IBUS_PROXY_CLASS (class)->destroy = bus_engine_proxy_real_destroy;
+    G_DBUS_PROXY_CLASS (class)->g_signal = bus_engine_proxy_g_signal;
 
     /* install signals */
     engine_signals[COMMIT_TEXT] =
         g_signal_new (I_("commit-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -104,7 +104,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[FORWARD_KEY_EVENT] =
         g_signal_new (I_("forward-key-event"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -117,7 +117,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[DELETE_SURROUNDING_TEXT] =
         g_signal_new (I_("delete-surrounding-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -129,7 +129,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[UPDATE_PREEDIT_TEXT] =
         g_signal_new (I_("update-preedit-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -143,7 +143,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[SHOW_PREEDIT_TEXT] =
         g_signal_new (I_("show-preedit-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -153,7 +153,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[HIDE_PREEDIT_TEXT] =
         g_signal_new (I_("hide-preedit-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -163,7 +163,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[UPDATE_AUXILIARY_TEXT] =
         g_signal_new (I_("update-auxiliary-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -175,7 +175,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[SHOW_AUXILIARY_TEXT] =
         g_signal_new (I_("show-auxiliary-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -185,7 +185,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[HIDE_AUXILIARY_TEXT] =
         g_signal_new (I_("hide-auxiliary-text"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -195,7 +195,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[UPDATE_LOOKUP_TABLE] =
         g_signal_new (I_("update-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -207,7 +207,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[SHOW_LOOKUP_TABLE] =
         g_signal_new (I_("show-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -217,7 +217,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[HIDE_LOOKUP_TABLE] =
         g_signal_new (I_("hide-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -227,7 +227,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[PAGE_UP_LOOKUP_TABLE] =
         g_signal_new (I_("page-up-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -237,7 +237,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[PAGE_DOWN_LOOKUP_TABLE] =
         g_signal_new (I_("page-down-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -247,7 +247,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[CURSOR_UP_LOOKUP_TABLE] =
         g_signal_new (I_("cursor-up-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -257,7 +257,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[CURSOR_DOWN_LOOKUP_TABLE] =
         g_signal_new (I_("cursor-down-lookup-table"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -267,7 +267,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[REGISTER_PROPERTIES] =
         g_signal_new (I_("register-properties"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
@@ -278,7 +278,7 @@ bus_engine_proxy_class_init (BusEngineProxyClass *klass)
 
     engine_signals[UPDATE_PROPERTY] =
         g_signal_new (I_("update-property"),
-            G_TYPE_FROM_CLASS (klass),
+            G_TYPE_FROM_CLASS (class),
             G_SIGNAL_RUN_LAST,
             0,
             NULL, NULL,
index 2437be4..af93292 100644 (file)
@@ -59,15 +59,6 @@ BusFactoryProxy *bus_factory_proxy_get_from_component
                                                 (IBusComponent      *component);
 BusFactoryProxy *bus_factory_proxy_get_from_engine
                                                 (IBusEngineDesc     *desc);
-
-#if 0
-const gchar     *bus_factory_proxy_get_name     (BusFactoryProxy    *factory);
-const gchar     *bus_factory_proxy_get_lang     (BusFactoryProxy    *factory);
-const gchar     *bus_factory_proxy_get_icon     (BusFactoryProxy    *factory);
-const gchar     *bus_factory_proxy_get_authors  (BusFactoryProxy    *factory);
-const gchar     *bus_factory_proxy_get_credits  (BusFactoryProxy    *factory);
-#endif
-
 G_END_DECLS
 #endif
 
index a6f47e4..3a3ad23 100644 (file)
@@ -284,7 +284,7 @@ bus_ibus_impl_set_trigger (BusIBusImpl *ibus,
         bus_ibus_impl_set_hotkey (ibus, hotkey, value);
     }
     else {
-        /* set defaint trigger */
+        /* set default trigger */
         ibus_hotkey_profile_add_hotkey (ibus->hotkey_profile,
                                         IBUS_space,
                                         IBUS_CONTROL_MASK,
@@ -754,8 +754,8 @@ _ibus_get_address (BusIBusImpl           *ibus,
                    GVariant              *parameters,
                    GDBusMethodInvocation *invocation)
 {
-    /* FIXME */
-    g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "FIXME"));
+    g_dbus_method_invocation_return_value (invocation,
+                                           g_variant_new ("(s)", bus_server_get_address ()));
 }
 
 
index 53143f0..56fc27f 100644 (file)
@@ -667,7 +667,7 @@ _ic_process_key_event_reply_cb (GObject      *source,
     GVariant *retval = g_dbus_proxy_call_finish ((GDBusProxy *)source,
                     result, &error);
     if (retval != NULL) {
-        /* XXX: need check retval is floating? */
+        /* FIXME: need check retval is floating? */
         g_dbus_method_invocation_return_value ((GDBusMethodInvocation *)user_data, retval);
         g_variant_unref (retval);
     }
@@ -1699,12 +1699,6 @@ bus_input_context_new (BusConnection    *connection,
                                                 NULL);
     g_free (path);
 
-
-#if 0
-    ibus_service_add_to_connection (IBUS_SERVICE (context),
-                                 IBUS_CONNECTION (connection));
-#endif
-
     g_object_ref_sink (connection);
     context->connection = connection;
     context->client = g_strdup (client);
index 1b2ba64..da26bf8 100644 (file)
@@ -213,7 +213,6 @@ main (gint argc, gchar **argv)
     ibus_set_log_handler(g_verbose);
 
     /* check if ibus-daemon is running in this session */
-#if 0
     if (ibus_get_address () != NULL) {
         IBusBus *bus = ibus_bus_new ();
 
@@ -230,7 +229,7 @@ main (gint argc, gchar **argv)
         g_object_unref (bus);
         bus = NULL;
     }
-#endif
+
     bus_server_init ();
     /* FIXME */
     if (!single) {
index b084872..995ab5f 100644 (file)
@@ -105,9 +105,9 @@ bus_recipient_unref (BusRecipient *recipient)
 G_DEFINE_TYPE (BusMatchRule, bus_match_rule, IBUS_TYPE_OBJECT)
 
 static void
-bus_match_rule_class_init (BusMatchRuleClass *klass)
+bus_match_rule_class_init (BusMatchRuleClass *class)
 {
-    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
+    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (class);
 
     ibus_object_class->destroy = (IBusObjectDestroyFunc) bus_match_rule_destroy;
 }
@@ -339,18 +339,26 @@ bus_match_rule_new (const gchar *text)
                 goto failed;
         }
         else if (g_strcmp0 (p->key, "sender") == 0) {
+            if (!g_dbus_is_name (p->value))
+                goto failed;
             bus_match_rule_set_sender (rule, p->value);
         }
         else if (g_strcmp0 (p->key, "interface") == 0) {
+            if (!g_dbus_is_interface_name (p->value))
+                goto failed;
             bus_match_rule_set_interface (rule, p->value);
         }
         else if (g_strcmp0 (p->key, "member") == 0) {
+            if (!g_dbus_is_member_name (p->value))
+                goto failed;
             bus_match_rule_set_member (rule, p->value);
         }
         else if (g_strcmp0 (p->key, "path") == 0) {
             bus_match_rule_set_path (rule, p->value);
         }
         else if (g_strcmp0 (p->key, "destination") == 0) {
+            if (!g_dbus_is_name (p->value))
+                goto failed;
             bus_match_rule_set_destination (rule, p->value);
         }
         else if (strncmp (p->key, "arg", 3) == 0) {
@@ -485,7 +493,7 @@ static gboolean
 bus_match_rule_match_name (const gchar *name,
                            const gchar *match_name)
 {
-    if (name[0] == ':' && match_name[0] != ':') {
+    if (g_dbus_is_unique_name (name) && !g_dbus_is_unique_name (match_name)) {
         BusConnection *connection =
                 bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, match_name);
         if (connection == NULL)
index d5dc89c..c817b26 100644 (file)
@@ -48,10 +48,10 @@ static void              bus_registry_remove_all        (BusRegistry        *reg
 G_DEFINE_TYPE (BusRegistry, bus_registry, IBUS_TYPE_OBJECT)
 
 static void
-bus_registry_class_init (BusRegistryClass *klass)
+bus_registry_class_init (BusRegistryClass *class)
 {
-    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
+    GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (class);
 
     _signals[CHANGED] =
         g_signal_new (I_("changed"),
@@ -192,7 +192,9 @@ bus_registry_load (BusRegistry *registry)
     bus_registry_load_in_dir (registry, dirname);
 
     g_free (dirname);
+
 #if 0
+    /* FIXME Should we support install some IME in user dir? */
     dirname = g_build_filename (g_get_user_data_dir (), "ibus", "component", NULL);
 
     path = ibus_observed_path_new (dirname, TRUE);
index ebc76d7..c333c41 100644 (file)
@@ -29,6 +29,7 @@ static GDBusServer *server = NULL;
 static GMainLoop *mainloop = NULL;
 static BusDBusImpl *dbus = NULL;
 static BusIBusImpl *ibus = NULL;
+static gchar *address = NULL;
 
 static gboolean
 bus_new_connection_cb (GDBusServer     *server,
@@ -63,14 +64,18 @@ bus_server_init (void)
 
     g_dbus_server_start (server);
 
-    gchar *address = g_strdup_printf ("%s,guid=%s",
-                            g_dbus_server_get_client_address (server),
-                            g_dbus_server_get_guid (server));
+    address = g_strdup_printf ("%s,guid=%s",
+                               g_dbus_server_get_client_address (server),
+                               g_dbus_server_get_guid (server));
 
     /* write address to file */
     ibus_write_address (address);
+}
 
-    g_free (address);
+const gchar *
+bus_server_get_address (void)
+{
+    return address;
 }
 
 void
index c7d9282..531877d 100644 (file)
 
 G_BEGIN_DECLS
 
-void    bus_server_init     (void);
-void    bus_server_run      (void);
-void    bus_server_quit     (void);
+void         bus_server_init        (void);
+void         bus_server_run         (void);
+void         bus_server_quit        (void);
+const gchar *bus_server_get_address (void);
 
 G_END_DECLS
 #endif
-
index 4d903e0..31be28d 100644 (file)
@@ -31,7 +31,7 @@
 #  define IDEBUG(a...)
 #endif
 /* functions prototype */
-static void          bus_test_client_class_init      (BusTestClientClass *klass);
+static void          bus_test_client_class_init      (BusTestClientClass *class);
 static void          bus_test_client_destroy         (IBusObject         *object);
 
 /* static methods*/
@@ -57,11 +57,11 @@ static Display      *_xdisplay = NULL;
 G_DEFINE_TYPE (BusTestClient, bus_test_client, IBUS_TYPE_OBJECT)
 
 static void
-bus_test_client_class_init (BusTestClientClass *klass)
+bus_test_client_class_init (BusTestClientClass *class)
 {
     IDEBUG ("%s", __FUNCTION__);
 
-    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
+    IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (class);
 
     ibus_object_class->destroy = bus_test_client_destroy;
 
index fd91015..6570473 100644 (file)
@@ -90,7 +90,7 @@ static IBusInputContext *_fake_context = NULL;
 static GdkWindow *_input_window = NULL;
 
 /* functions prototype */
-static void     ibus_im_context_class_init  (IBusIMContextClass    *klass);
+static void     ibus_im_context_class_init  (IBusIMContextClass    *class);
 static void     ibus_im_context_init        (GObject               *obj);
 static void     ibus_im_context_finalize    (GObject               *obj);
 static void     ibus_im_context_reset       (GtkIMContext          *context);
@@ -274,14 +274,14 @@ _key_snooper_cb (GtkWidget   *widget,
 }
 
 static void
-ibus_im_context_class_init     (IBusIMContextClass *klass)
+ibus_im_context_class_init     (IBusIMContextClass *class)
 {
     IDEBUG ("%s", __FUNCTION__);
 
-    GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (klass);
-    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+    GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class);
+    GObjectClass *gobject_class = G_OBJECT_CLASS (class);
 
-    parent_class = (GtkIMContextClass *) g_type_class_peek_parent (klass);
+    parent_class = (GtkIMContextClass *) g_type_class_peek_parent (class);
 
     im_context_class->reset = ibus_im_context_reset;
     im_context_class->focus_in = ibus_im_context_focus_in;
@@ -294,27 +294,27 @@ ibus_im_context_class_init     (IBusIMContextClass *klass)
     gobject_class->finalize = ibus_im_context_finalize;
 
     _signal_commit_id =
-        g_signal_lookup ("commit", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("commit", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_commit_id != 0);
 
     _signal_preedit_changed_id =
-        g_signal_lookup ("preedit-changed", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("preedit-changed", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_preedit_changed_id != 0);
 
     _signal_preedit_start_id =
-        g_signal_lookup ("preedit-start", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("preedit-start", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_preedit_start_id != 0);
 
     _signal_preedit_end_id =
-        g_signal_lookup ("preedit-end", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("preedit-end", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_preedit_end_id != 0);
 
     _signal_delete_surrounding_id =
-        g_signal_lookup ("delete-surrounding", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("delete-surrounding", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_delete_surrounding_id != 0);
 
     _signal_retrieve_surrounding_id =
-        g_signal_lookup ("retrieve-surrounding", G_TYPE_FROM_CLASS (klass));
+        g_signal_lookup ("retrieve-surrounding", G_TYPE_FROM_CLASS (class));
     g_assert (_signal_retrieve_surrounding_id != 0);
 
     const gchar *ibus_disable_snooper = g_getenv ("IBUS_DISABLE_SNOOPER");
index 85f4f61..85c88c8 100755 (executable)
@@ -6,7 +6,7 @@ build: patch
        ln -sf /usr/share/misc/config.sub config.sub
        ln -sf /usr/share/misc/config.guess config.guess
        dh $@ --before auto_configure
-       dh_auto_configure -- --enable-static LDFLAGS="-Wl,--as-needed" --enable-key-snooper
+       dh_auto_configure -- --enable-static LDFLAGS="-Wl,--as-needed"
        dh $@ --before auto_test
        cd po; make ibus10.pot # https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/188690
        dh $@ --after auto_test
index b8cc06f..f77a29a 100644 (file)
@@ -111,15 +111,6 @@ ibus_component_stop
 ibus_component_is_running
 ibus_component_get_from_engine
 ibus_component_set_restart
->>>>>>> wip.
-<SUBSECTION Standard>
-IBUS_KEYMAP
-IBUS_IS_KEYMAP
-IBUS_TYPE_KEYMAP
-ibus_keymap_get_type
-IBUS_KEYMAP_CLASS
-IBUS_IS_KEYMAP_CLASS
-IBUS_KEYMAP_GET_CLASS
 </SECTION>
 
 <SECTION>
index 5f671e9..df1976c 100644 (file)
@@ -18,7 +18,7 @@ struct _IBusConfigGConfClass {
 };
 
 /* functions prototype */
-static void         ibus_config_gconf_class_init    (IBusConfigGConfClass   *klass);
+static void         ibus_config_gconf_class_init    (IBusConfigGConfClass   *class);
 static void         ibus_config_gconf_init          (IBusConfigGConf        *config);
 static void         ibus_config_gconf_destroy       (IBusConfigGConf        *config);
 static gboolean     ibus_config_gconf_set_value     (IBusConfigService      *config,
@@ -40,9 +40,9 @@ static GVariant     *_from_gconf_value              (const GConfValue       *gva
 G_DEFINE_TYPE (IBusConfigGConf, ibus_config_gconf, IBUS_TYPE_CONFIG_SERVICE)
 
 static void
-ibus_config_gconf_class_init (IBusConfigGConfClass *klass)
+ibus_config_gconf_class_init (IBusConfigGConfClass *class)
 {
-    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (class);
 
     IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus_config_gconf_destroy;
     IBUS_CONFIG_SERVICE_CLASS (object_class)->set_value   = ibus_config_gconf_set_value;
index 4fb8936..a5aa190 100644 (file)
@@ -36,7 +36,7 @@ struct _IBusConfigMemconfClass {
 };
 
 /* functions prototype */
-static void         ibus_config_memconf_class_init  (IBusConfigMemconfClass *klass);
+static void         ibus_config_memconf_class_init  (IBusConfigMemconfClass *class);
 static void         ibus_config_memconf_init        (IBusConfigMemconf      *config);
 static void         ibus_config_memconf_destroy     (IBusConfigMemconf      *config);
 static gboolean     ibus_config_memconf_set_value   (IBusConfigService      *config,
@@ -56,9 +56,9 @@ static gboolean     ibus_config_memconf_unset_value (IBusConfigService      *con
 G_DEFINE_TYPE (IBusConfigMemconf, ibus_config_memconf, IBUS_TYPE_CONFIG_SERVICE)
 
 static void
-ibus_config_memconf_class_init (IBusConfigMemconfClass *klass)
+ibus_config_memconf_class_init (IBusConfigMemconfClass *class)
 {
-    GObjectClass *object_class = G_OBJECT_CLASS (klass);
+    GObjectClass *object_class = G_OBJECT_CLASS (class);
 
     IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus_config_memconf_destroy;
     IBUS_CONFIG_SERVICE_CLASS (object_class)->set_value   = ibus_config_memconf_set_value;
index 6b0a72e..7de055f 100644 (file)
@@ -141,6 +141,7 @@ ibus_bus_class_init (IBusBusClass *class)
 
     g_type_class_add_private (class, sizeof (IBusBusPrivate));
 }
+
 #if 0
 static gboolean
 _connection_ibus_signal_cb (GDBusConnection *connection,
@@ -469,7 +470,7 @@ const gchar *
 ibus_bus_hello (IBusBus *bus)
 {
     g_return_val_if_fail (IBUS_IS_BUS (bus), NULL);
-    /* FIXME */
+    /* FIXME gdbus connection will say hello by self. */
 #if 1
     if (bus->priv->connection)
         return g_dbus_connection_get_unique_name (bus->priv->connection);
index e237f5a..5374a76 100644 (file)
@@ -22,9 +22,6 @@
 #include "ibusshare.h"
 #include "ibusconfigservice.h"
 
-#define IBUS_CONFIG_SERVICE_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_CONFIG_SERVICE, IBusConfigServicePrivate))
-
 enum {
     LAST_SIGNAL,
 };
@@ -128,19 +125,11 @@ ibus_config_service_class_init (IBusConfigServiceClass *class)
     class->set_value   = ibus_config_service_set_value;
     class->get_value   = ibus_config_service_get_value;
     class->unset_value = ibus_config_service_unset_value;
-
-    /* install properties */
-    /*
-     * g_type_class_add_private (class, sizeof (IBusConfigServicePrivate));
-     */
 }
 
 static void
 ibus_config_service_init (IBusConfigService *config)
 {
-    /*
-     * config->priv = IBUS_CONFIG_SERVICE_GET_PRIVATE (config);
-     */
 }
 
 static void
@@ -150,12 +139,6 @@ ibus_config_service_set_property (IBusConfigService *config,
                                   GParamSpec        *pspec)
 {
     switch (prop_id) {
-    #if 0
-    case PROP_CONNECTION:
-        ibus_service_add_to_connection ((IBusService *) config,
-                                        g_value_get_object (value));
-        break;
-    #endif
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (config, prop_id, pspec);
     }
index ab66a2b..ae07393 100644 (file)
@@ -962,35 +962,6 @@ ibus_engine_emit_signal (IBusEngine  *engine,
                               NULL);
 }
 
-#if 0
-static void
-_send_signal (IBusEngine  *engine,
-              const gchar *name,
-              GType        first_arg_type,
-              ...)
-{
-    g_assert (IBUS_IS_ENGINE (engine));
-    g_assert (name != NULL);
-
-    va_list args;
-    const gchar *path;
-    IBusEnginePrivate *priv;
-
-    priv = IBUS_ENGINE_GET_PRIVATE (engine);
-
-    path = ibus_service_get_path ((IBusService *)engine);
-
-    va_start (args, first_arg_type);
-    ibus_connection_send_signal_valist (priv->connection,
-                                        path,
-                                        IBUS_INTERFACE_ENGINE,
-                                        name,
-                                        first_arg_type,
-                                        args);
-    va_end (args);
-}
-#endif
-
 IBusEngine *
 ibus_engine_new (const gchar     *engine_name,
                  const gchar     *object_path,
index 1133997..11d9a6d 100644 (file)
@@ -151,14 +151,6 @@ ibus_factory_set_property (IBusFactory  *factory,
                            GParamSpec   *pspec)
 {
     switch (prop_id) {
-    #if 0
-    case PROP_CONNECTION:
-        priv->connection = g_value_get_object (value);
-        g_object_ref_sink (priv->connection);
-        ibus_service_add_to_connection ((IBusService *) factory,
-                                        priv->connection);
-        break;
-    #endif
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (factory, prop_id, pspec);
     }
@@ -171,11 +163,6 @@ ibus_factory_get_property (IBusFactory *factory,
                            GParamSpec  *pspec)
 {
     switch (prop_id) {
-    #if 0
-    case PROP_CONNECTION:
-        g_value_set_object (value, priv->connection);
-        break;
-    #endif
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (factory, prop_id, pspec);
     }
index 300b8db..df89a24 100644 (file)
@@ -129,22 +129,6 @@ ibus_panel_service_class_init (IBusPanelServiceClass *class)
     class->show_preedit_text        = ibus_panel_service_not_implemented;
     class->start_setup              = ibus_panel_service_not_implemented;
     class->state_changed            = ibus_panel_service_not_implemented;
-
-    /* install properties */
-    #if 0
-    /**
-     * IBusPanelService:connection:
-     *
-     * Connection of this IBusPanelService.
-     */
-    g_object_class_install_property (gobject_class,
-                                     PROP_CONNECTION,
-                                     g_param_spec_object ("connection",
-                                                          "connection",
-                                                          "The connection of service object",
-                                                          IBUS_TYPE_CONNECTION,
-                                                          G_PARAM_READWRITE |  G_PARAM_CONSTRUCT_ONLY));
-    #endif
 }
 
 static void
@@ -159,12 +143,6 @@ ibus_panel_service_set_property (IBusPanelService *panel,
                                  GParamSpec       *pspec)
 {
     switch (prop_id) {
-    #if 0
-    case PROP_CONNECTION:
-        ibus_service_add_to_connection ((IBusService *) panel,
-                                        g_value_get_object (value));
-        break;
-    #endif
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (panel, prop_id, pspec);
     }
@@ -177,10 +155,6 @@ ibus_panel_service_get_property (IBusPanelService *panel,
                                  GParamSpec       *pspec)
 {
     switch (prop_id) {
-    #if 0
-    case PROP_CONNECTION:
-        break;
-    #endif
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (panel, prop_id, pspec);
     }
index 8209da7..276eff8 100644 (file)
@@ -25,7 +25,6 @@
 #define IBUS_SERVICE_GET_PRIVATE(o)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_SERVICE, IBusServicePrivate))
 
-/* XXX */
 enum {
     LAST_SIGNAL
 };