Remove unused file
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-main.c
index 246bd33..0cbb6bd 100644 (file)
@@ -100,9 +100,9 @@ static const char *interfaces[] =
   SPI_DBUS_INTERFACE_HYPERLINK,
   SPI_DBUS_INTERFACE_HYPERTEXT,
   SPI_DBUS_INTERFACE_IMAGE,
-  "org.freedesktop.atspi.LoginHelper",
+  "org.a11y.atspi.LoginHelper",
   SPI_DBUS_INTERFACE_SELECTION,
-  "org.freedesktop.atspi.Selector",
+  "org.a11y.atspi.Selector",
   SPI_DBUS_INTERFACE_TABLE,
   SPI_DBUS_INTERFACE_TEXT,
   SPI_DBUS_INTERFACE_VALUE,
@@ -258,7 +258,7 @@ ref_accessible (CSpiApplication *app, const char *path)
   int id;
   guint *id_val;
 
-  if (sscanf (path, "/org/freedesktop/atspi/accessible/%d", &id) != 1)
+  if (sscanf (path, "/org/a11y/atspi/accessible/%d", &id) != 1)
   {
     return NULL;
   }
@@ -293,7 +293,7 @@ cspi_get_application (const char *bus_name)
   if (!app_hash)
   {
     app_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_hash_table_unref);
-    if (!app_hash) return;
+    if (!app_hash) return NULL;
   }
   app = g_hash_table_lookup (app_hash, bus_name);
   if (app) return app;
@@ -301,7 +301,11 @@ cspi_get_application (const char *bus_name)
   if (!bus_name_dup) return NULL;
   // TODO: change below to something that will send state-change:defunct notification if necessary */
   app = g_new (CSpiApplication, 1);
-  if (!app) return NULL;
+  if (!app)
+  {
+    g_free (bus_name_dup);
+    return NULL;
+  }
   app->bus_name = bus_name_dup;
   if (APP_IS_REGISTRY (app))
   {
@@ -405,7 +409,7 @@ cspi_dbus_handle_remove_accessible (DBusConnection *bus, DBusMessage *message, v
   if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID))
   {
     g_warning ("Received RemoveAccessible with invalid arguments");
-    return;
+    return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
   }
   a = ref_accessible (app, path);
   if (a->parent && g_list_find (a->parent->children, a))
@@ -416,6 +420,7 @@ cspi_dbus_handle_remove_accessible (DBusConnection *bus, DBusMessage *message, v
   }
   g_hash_table_remove (app->hash, &a->v.id);
   cspi_object_unref_internal (a, TRUE);        /* unref our own ref */
+  return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 static gboolean
@@ -425,7 +430,7 @@ add_app_to_desktop (Accessible *a, const char *bus_name)
   char *root_path;
 
   dbus_error_init (&error);
-  if (dbind_method_call_reentrant (bus, bus_name, "/org/freedesktop/atspi/tree", spi_interface_tree, "getRoot", &error, "=>o", &root_path))
+  if (dbind_method_call_reentrant (bus, bus_name, "/org/a11y/atspi/tree", spi_interface_tree, "getRoot", &error, "=>o", &root_path))
   {
     Accessible *obj = cspi_ref_accessible (bus_name, root_path);
     if (obj)
@@ -532,7 +537,7 @@ ref_accessible_desktop (CSpiApplication *app)
     CSpiApplication *app = cspi_get_application (app_name);
     additions = NULL;
     dbus_error_init (&error);
-    dbind_method_call_reentrant (bus, app_name, "/org/freedesktop/atspi/tree", spi_interface_tree, "getTree", &error, "=>a(ooaoassusau)", &additions);
+    dbind_method_call_reentrant (bus, app_name, "/org/a11y/atspi/tree", spi_interface_tree, "getTree", &error, "=>a(ooaoassusau)", &additions);
     if (error.message)
     {
       g_warning ("getTree (%s): %s", app_name, error.message);
@@ -577,12 +582,13 @@ cspi_dbus_handle_update_accessible (DBusConnection *bus, DBusMessage *message, v
   if (!app)
   {
     g_warning ("UpdateAccessible from unknown app.  Should we add it?", sender);
-    return;
+    return DBUS_HANDLER_RESULT_HANDLED;
   }
   dbus_message_iter_init (message, &iter);
   // TODO: Check signature
   dbind_any_demarshal (&iter, &type, &p);      /* additions */
   handle_addition (app, &ca);
+  return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 static DBusHandlerResult
@@ -635,7 +641,7 @@ cspi_dbus_filter (DBusConnection *bus, DBusMessage *message, void *data)
   char *bus_name;
 
   if (type == DBUS_MESSAGE_TYPE_SIGNAL &&
-      !strncmp (interface, "org.freedesktop.atspi.Event.", 28))
+      !strncmp (interface, "org.a11y.atspi.Event.", 28))
   {
     return cspi_dbus_handle_event (bus, message, data);
   }
@@ -664,12 +670,12 @@ cspi_dbus_filter (DBusConnection *bus, DBusMessage *message, void *data)
 
 static const char *signal_interfaces[] =
 {
-  "org.freedesktop.atspi.Event.Object",
-  "org.freedesktop.atspi.Event.Window",
-  "org.freedesktop.atspi.Event.Mouse",
-  "org.freedesktop.atspi.Event.Terminal",
-  "org.freedesktop.atspi.Event.Document",
-  "org.freedesktop.atspi.Event.Focus",
+  "org.a11y.atspi.Event.Object",
+  "org.a11y.atspi.Event.Window",
+  "org.a11y.atspi.Event.Mouse",
+  "org.a11y.atspi.Event.Terminal",
+  "org.a11y.atspi.Event.Document",
+  "org.a11y.atspi.Event.Focus",
   NULL
 };
 
@@ -1035,7 +1041,7 @@ get_path (Accessible *obj)
   {
     return g_strdup_printf (SPI_DBUS_PATH_REGISTRY);
   }
-  return g_strdup_printf ("/org/freedesktop/atspi/accessible/%d", obj->v.id);
+  return g_strdup_printf ("/org/a11y/atspi/accessible/%d", obj->v.id);
 }
 
 dbus_bool_t