2008-12-17 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / collection.c
index a687deb..304ed62 100644 (file)
 
 /* collection.c: implements the Collection interface */
 
-#include "accessible.h"
-#include "bitarray.h"
 #include <string.h>
 
-#define get_object(message) spi_dbus_get_object(dbus_message_get_path(message))
+#include <atk/atk.h>
+#include <droute/droute.h>
+
+#include "atk-dbus.h"
+
+#include "spi-common/bitarray.h"
+#include "spi-common/spi-dbus.h"
+
+#define get_object(message) atk_dbus_get_object(dbus_message_get_path(message))
 
 typedef struct _MatchRulePrivate MatchRulePrivate;
 struct _MatchRulePrivate
@@ -671,7 +677,7 @@ return_and_free_list(DBusMessage *message, GList *ls)
   if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "o", &iter_array)) goto oom;
   for (item = ls; item; item = g_list_next(item))
   {
-    char *path = spi_dbus_get_path((AtkObject *)item->data);
+      char *path = (char *) spi_dbus_get_path((AtkObject *)item->data);
       dbus_message_iter_append_basic(&iter_array, DBUS_TYPE_OBJECT_PATH, &path);
       g_free(path);
   }
@@ -788,7 +794,7 @@ getMatchesInOrder (DBusMessage *message,
 
   ls = g_list_append (ls, current_object);
 
-  obj = spi_dbus_get_object (dbus_message_get_path (message));
+  obj = atk_dbus_get_object (dbus_message_get_path (message));
   
   kount = inorder (obj, mrp, ls, 0, count, 
                    current_object, TRUE, NULL, traverse);
@@ -820,7 +826,7 @@ getMatchesInBackOrder (DBusMessage *message,
 
   ls = g_list_append (ls, current_object);
 
-  collection = spi_dbus_get_object (dbus_message_get_path (message));
+  collection = atk_dbus_get_object (dbus_message_get_path (message));
 
   kount = sort_order_rev_canonical (mrp, ls, 0, count, current_object, 
                                    FALSE, collection);
@@ -856,7 +862,7 @@ getMatchesTo (DBusMessage *message,
                          obj, 0, TRUE, current_object, TRUE, traverse);
   }
   else{ 
-    obj = spi_dbus_get_object (dbus_message_get_path (message));
+    obj = atk_dbus_get_object (dbus_message_get_path (message));
     kount = query_exec (mrp,  sortby, ls, 0, count,
                         obj, 0, TRUE, current_object, TRUE, traverse); 
 
@@ -886,7 +892,7 @@ impl_getMatchesFrom (DBusConnection *bus, DBusMessage *message, void *user_data)
 
   dbus_message_iter_init(message, &iter);
   dbus_message_iter_get_basic (&iter, current_object_path);
-  current_object = spi_dbus_get_object (current_object_path);
+  current_object = atk_dbus_get_object (current_object_path);
   if (!current_object)
   {
     // TODO: object-not-found error
@@ -939,7 +945,7 @@ impl_getMatchesTo (DBusConnection *bus, DBusMessage *message, void *user_data)
 
   dbus_message_iter_init(message, &iter);
   dbus_message_iter_get_basic (&iter, current_object_path);
-  current_object = spi_dbus_get_object (current_object_path);
+  current_object = atk_dbus_get_object (current_object_path);
   if (!current_object)
   {
     // TODO: object-not-found error
@@ -1014,13 +1020,15 @@ impl_getMatches(DBusConnection *bus, DBusMessage *message, void *user_data)
 static DRouteMethod methods[] = {
   { impl_getMatchesFrom, "getMatchesFrom" },
   { impl_getMatchesTo, "getMatchesTo" },
-  {impl_getMatches, "getMatches" },
+  { impl_getMatches, "getMatches" },
   {NULL, NULL}
 };
 
 void
-spi_initialize_collection (DRouteData * data)
+spi_initialize_collection (DRoutePath *path)
 {
-  droute_add_interface (data, SPI_DBUS_INTERFACE_COLLECTION,
-                       methods, NULL, NULL, NULL);
+  droute_path_add_interface (path,
+                             SPI_DBUS_INTERFACE_COLLECTION,
+                             methods,
+                             NULL);
 };