Update to correspond with dbus spec
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / bridge.c
index 361d52b..36d32c7 100644 (file)
@@ -148,7 +148,7 @@ register_application (SpiAppData *app)
   message = dbus_message_new_method_call (SPI_DBUS_NAME_REGISTRY,
                                           SPI_DBUS_PATH_REGISTRY,
                                           SPI_DBUS_INTERFACE_REGISTRY,
-                                          "registerApplication");
+                                          "RegisterApplication");
   dbus_message_set_no_reply (message, TRUE);
 
   uname = dbus_bus_get_unique_name(app->bus);
@@ -174,7 +174,7 @@ deregister_application (SpiAppData *app)
   message = dbus_message_new_method_call (SPI_DBUS_NAME_REGISTRY,
                                           SPI_DBUS_PATH_REGISTRY,
                                           SPI_DBUS_INTERFACE_REGISTRY,
-                                          "deregisterApplication");
+                                          "DeregisterApplication");
   dbus_message_set_no_reply (message, TRUE);
 
   uname = dbus_bus_get_unique_name(app->bus);
@@ -240,6 +240,12 @@ adaptor_init (gint *argc, gchar **argv[])
   DBusConnection *bus;
   AtkObject *root;
   gchar *introspection_directory;
+  static gboolean inited = FALSE;
+
+  if (inited)
+    return 0;
+
+  inited = TRUE;
 
   DRoutePath *treepath, *accpath;
 
@@ -291,7 +297,7 @@ adaptor_init (gint *argc, gchar **argv[])
   accpath = droute_add_many (atk_adaptor_app_data->droute,
                              "/org/freedesktop/atspi/accessible",
                              NULL,
-                             (DRouteGetDatumFunction) atk_dbus_path_to_object);
+                             (DRouteGetDatumFunction) atk_dbus_path_to_gobject);
 
   /* Register all interfaces with droute and set up application accessible db */
   spi_initialize_tree (treepath);
@@ -336,6 +342,29 @@ gtk_module_init (gint *argc, gchar **argv[])
     {
        return adaptor_init (argc, argv);
     }
+  return 0;
 }
 
+void
+gnome_accessibility_module_init (void)
+{
+  const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE");
+
+  if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0)
+    {
+      adaptor_init (NULL, NULL);
+
+      if (g_getenv ("AT_SPI_DEBUG"))
+        {
+           g_print("Atk Accessibility bridge initialized\n");
+        }
+    }
+}
+
+void
+gnome_accessibility_module_shutdown (void)
+{
+  spi_atk_deregister_event_listeners ();
+  exit_func ();
+}
 /*END------------------------------------------------------------------------*/