X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=atk-adaptor%2Ftree-adaptor.c;h=89a065f6eba95e19a1032a13af59168a3aaec9ba;hb=e9d9fedb0c914825a3ccd8b390deb52a93800415;hp=c3c6c1194257446183c5a1f4c9b6b6fcf1be5f63;hpb=5d374cf95f2447a712f94dd2efe2b294ecab58ca;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/atk-adaptor/tree-adaptor.c b/atk-adaptor/tree-adaptor.c index c3c6c11..89a065f 100644 --- a/atk-adaptor/tree-adaptor.c +++ b/atk-adaptor/tree-adaptor.c @@ -37,53 +37,68 @@ /* For use as a GHFunc */ static void -append_accessible_hf (gpointer key, gpointer obj_data, gpointer iter) +append_accessible_hf (gpointer key, gpointer obj_data, gpointer data) { - spi_atk_append_accessible (ATK_OBJECT(obj_data), iter); + /* Make sure it isn't a hyperlink */ + if (ATK_IS_OBJECT (obj_data)) + spi_atk_append_accessible (ATK_OBJECT (obj_data), data); } /*---------------------------------------------------------------------------*/ void -spi_emit_cache_removal (guint ref, DBusConnection *bus) +spi_emit_cache_removal (guint ref, DBusConnection * bus) { DBusMessage *message; - DBusMessageIter iter; - gchar *path; - message = dbus_message_new_signal ("/org/freedesktop/atspi/tree", SPI_DBUS_INTERFACE_TREE, "removeAccessible"); + if ((message = dbus_message_new_signal ("/org/freedesktop/atspi/tree", + SPI_DBUS_INTERFACE_TREE, + "RemoveAccessible"))) + { + DBusMessageIter iter; + gchar *path; + + dbus_message_iter_init_append (message, &iter); - dbus_message_iter_init_append (message, &iter); + path = atk_dbus_ref_to_path (ref); + dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &path); - path = atk_dbus_ref_to_path (ref); - dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &path); + dbus_connection_send (bus, message, NULL); - dbus_connection_send(bus, message, NULL); + dbus_message_unref (message); + } } void -spi_emit_cache_update (AtkObject *accessible, DBusConnection *bus) +spi_emit_cache_update (AtkObject * accessible, DBusConnection * bus) { - DBusMessage *message; - DBusMessageIter iter; - message = dbus_message_new_signal ("/org/freedesktop/atspi/tree", SPI_DBUS_INTERFACE_TREE, "updateAccessible"); + DBusMessage *message; - dbus_message_iter_init_append (message, &iter); - spi_atk_append_accessible (accessible, &iter); + if ((message = dbus_message_new_signal ("/org/freedesktop/atspi/tree", + SPI_DBUS_INTERFACE_TREE, + "UpdateAccessible"))) + { + DBusMessageIter iter; + + dbus_message_iter_init_append (message, &iter); + spi_atk_append_accessible (accessible, &iter); - dbus_connection_send(bus, message, NULL); + dbus_connection_send (bus, message, NULL); + + dbus_message_unref (message); + } } /*---------------------------------------------------------------------------*/ static DBusMessage * -impl_getRoot (DBusConnection *bus, DBusMessage *message, void *user_data) +impl_GetRoot (DBusConnection * bus, DBusMessage * message, void *user_data) { - AtkObject *root = atk_get_root(); + AtkObject *root = atk_get_root (); char *path; DBusMessage *reply; - gchar *errmsg; + gchar *errmsg; if (!root) { @@ -91,7 +106,7 @@ impl_getRoot (DBusConnection *bus, DBusMessage *message, void *user_data) DBUS_ERROR_FAILED, "No root accessible available"); } - path = atk_dbus_object_to_path (root); + path = atk_dbus_object_to_path (root, FALSE); if (!path) { reply = dbus_message_new_error (message, @@ -99,7 +114,8 @@ impl_getRoot (DBusConnection *bus, DBusMessage *message, void *user_data) "No root accessible available"); } reply = dbus_message_new_method_return (message); - dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); + dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &path, + DBUS_TYPE_INVALID); g_free (path); return reply; } @@ -107,7 +123,7 @@ impl_getRoot (DBusConnection *bus, DBusMessage *message, void *user_data) /*---------------------------------------------------------------------------*/ static DBusMessage * -impl_getTree (DBusConnection *bus, DBusMessage *message, void *user_data) +impl_GetTree (DBusConnection * bus, DBusMessage * message, void *user_data) { DBusMessage *reply; DBusMessageIter iter, iter_array; @@ -115,27 +131,25 @@ impl_getTree (DBusConnection *bus, DBusMessage *message, void *user_data) reply = dbus_message_new_method_return (message); dbus_message_iter_init_append (reply, &iter); - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(ooaoassusau)", &iter_array); - atk_dbus_foreach_registered(append_accessible_hf, &iter_array); - dbus_message_iter_close_container(&iter, &iter_array); + dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, + "(o(so)a(so)assusau)", &iter_array); + atk_dbus_foreach_registered (append_accessible_hf, &iter_array); + dbus_message_iter_close_container (&iter, &iter_array); return reply; } /*---------------------------------------------------------------------------*/ static DRouteMethod methods[] = { - {impl_getRoot, "getRoot"}, - {impl_getTree, "getTree"}, + {impl_GetRoot, "GetRoot"}, + {impl_GetTree, "GetTree"}, {NULL, NULL} }; void -spi_initialize_tree (DRoutePath *path) +spi_initialize_tree (DRoutePath * path) { - droute_path_add_interface (path, - SPI_DBUS_INTERFACE_TREE, - methods, - NULL); + droute_path_add_interface (path, SPI_DBUS_INTERFACE_TREE, methods, NULL); }; /*END------------------------------------------------------------------------*/