2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008, 2010 Codethink Ltd.
6 * Copyright 2001, 2002 Sun Microsystems Inc.,
7 * Copyright 2001, 2002 Ximian, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
27 #include <dbus/dbus-glib-lowlevel.h>
31 #include "introspection.h"
34 children_added_listener (DBusConnection * bus,
40 children_removed_listener (DBusConnection * bus,
45 /*---------------------------------------------------------------------------*/
47 typedef struct _SpiReference
54 spi_reference_new (const gchar *name, const gchar *path)
58 ref = g_new0 (SpiReference, 1);
59 ref->name = g_strdup (name);
60 ref->path = g_strdup (path);
66 spi_reference_free (SpiReference *ref)
73 /*---------------------------------------------------------------------------*/
75 G_DEFINE_TYPE(SpiRegistry, spi_registry, G_TYPE_OBJECT)
78 spi_registry_class_init (SpiRegistryClass *klass)
80 GObjectClass * object_class = (GObjectClass *) klass;
82 spi_registry_parent_class = g_type_class_ref (G_TYPE_OBJECT);
86 spi_registry_init (SpiRegistry *registry)
88 registry->apps = g_ptr_array_new_with_free_func ((GDestroyNotify) spi_reference_free);
91 /*---------------------------------------------------------------------------*/
94 return_v_string (DBusMessageIter * iter, const gchar * str)
96 DBusMessageIter variant;
98 dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "s",
100 dbus_message_iter_append_basic (&variant, DBUS_TYPE_STRING, &str);
101 dbus_message_iter_close_container (iter, &variant);
105 append_reference (DBusMessageIter * iter, const char * name, const char * path)
107 DBusMessageIter iter_struct;
109 dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, NULL,
111 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_STRING, &name);
112 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &path);
113 dbus_message_iter_close_container (iter, &iter_struct);
116 /*---------------------------------------------------------------------------*/
119 compare_reference (SpiReference *one, SpiReference *two)
121 if (g_strcmp0 (one->name, two->name) == 0 &&
122 g_strcmp0 (one->path, two->path) == 0)
129 find_index_of_reference (GPtrArray *arr, const gchar *name, const gchar * path, guint *index)
132 gboolean found = FALSE;
135 ref = spi_reference_new (name, path);
137 for (i = 0; i < arr->len && found == FALSE; i++)
139 if (compare_reference (ref, g_ptr_array_index (arr, i)));
145 spi_reference_free (ref);
152 add_application (SpiRegistry *reg, DBusConnection *bus, const gchar *name, const gchar *path)
154 g_ptr_array_add (reg->apps, spi_reference_new (name, path));
155 children_added_listener (bus, reg->apps->len - 1, name, path);
159 remove_application (SpiRegistry *reg, DBusConnection *bus, guint index)
161 const gchar *name = "";
162 g_ptr_array_remove_index (reg->apps, index);
163 /*TODO spi_remove_device_listeners (registry->de_controller, old);*/
164 children_removed_listener (bus, index, name, SPI_DBUS_PATH_NULL);
168 handle_disconnection (DBusConnection *bus, DBusMessage *message, void *user_data)
170 char *name, *old, *new;
171 SpiRegistry *reg = SPI_REGISTRY (user_data);
173 if (dbus_message_get_args (message, NULL,
174 DBUS_TYPE_STRING, &name,
175 DBUS_TYPE_STRING, &old,
176 DBUS_TYPE_STRING, &new,
179 if (*old != '\0' && *new == '\0')
181 /* Remove all children with the application name the same as the disconnected application. */
183 for (i = 0; i < reg->apps->len; i++)
185 SpiReference *ref = g_ptr_array_index (reg->apps, i);
186 while (!g_strcmp0 (old, ref->name))
188 g_ptr_array_remove_index (reg->apps, i);
189 children_removed_listener (bus, i, old, SPI_DBUS_PATH_NULL);
196 static DBusHandlerResult
197 signal_filter (DBusConnection *bus, DBusMessage *message, void *user_data)
199 SpiRegistry *registry = SPI_REGISTRY (user_data);
200 guint res = DBUS_HANDLER_RESULT_HANDLED;
201 const char *iface = dbus_message_get_interface (message);
202 const char *member = dbus_message_get_member (message);
204 if (!g_strcmp0(iface, DBUS_INTERFACE_DBUS) && !g_strcmp0(member, "NameOwnerChanged"))
205 handle_disconnection (bus, message, user_data);
207 res = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
212 /* org.at_spi.Socket interface */
213 /*---------------------------------------------------------------------------*/
216 impl_Embed (DBusConnection *bus, DBusMessage *message, void *user_data)
218 SpiRegistry *reg = SPI_REGISTRY (user_data);
219 DBusMessageIter iter, iter_struct;
220 gchar *app_name, *obj_path;
222 DBusMessage *reply = NULL;
223 DBusMessageIter reply_iter;
225 dbus_message_iter_init (message, &iter);
226 dbus_message_iter_recurse (&iter, &iter_struct);
227 if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_STRING))
229 dbus_message_iter_get_basic (&iter_struct, &app_name);
230 if (!dbus_message_iter_next (&iter_struct))
232 if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_OBJECT_PATH))
234 dbus_message_iter_get_basic (&iter_struct, &obj_path);
236 add_application(reg, bus, app_name, obj_path);
238 reply = dbus_message_new_method_return (message);
239 dbus_message_iter_init_append (reply, &reply_iter);
240 append_reference (&reply_iter,
241 dbus_bus_get_unique_name (bus),
246 return dbus_message_new_error (message, DBUS_ERROR_FAILED, "Invalid arguments");
250 impl_Unembed (DBusConnection *bus, DBusMessage *message, void *user_data)
252 SpiRegistry *reg = SPI_REGISTRY (user_data);
253 DBusMessageIter iter, iter_struct;
254 gchar *app_name, *obj_path;
257 dbus_message_iter_init (message, &iter);
258 dbus_message_iter_recurse (&iter, &iter_struct);
259 if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_STRING))
261 dbus_message_iter_get_basic (&iter_struct, &app_name);
262 if (!dbus_message_iter_next (&iter_struct))
264 if (!(dbus_message_iter_get_arg_type (&iter_struct) == DBUS_TYPE_OBJECT_PATH))
266 dbus_message_iter_get_basic (&iter_struct, &obj_path);
268 if (find_index_of_reference (reg->apps, app_name, obj_path, &index))
269 remove_application(reg, bus, index);
273 return dbus_message_new_error (message, DBUS_ERROR_FAILED, "Invalid arguments");
276 /* org.at_spi.Component interface */
277 /*---------------------------------------------------------------------------*/
280 impl_Contains (DBusConnection * bus, DBusMessage * message, void *user_data)
282 dbus_bool_t retval = FALSE;
285 reply = dbus_message_new_method_return (message);
286 dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval,
292 impl_GetAccessibleAtPoint (DBusConnection * bus, DBusMessage * message,
295 DBusMessage *reply = NULL;
296 DBusMessageIter iter;
298 reply = dbus_message_new_method_return (message);
299 dbus_message_iter_init_append (reply, &iter);
300 append_reference (&iter,
301 dbus_bus_get_unique_name (bus),
308 impl_GetExtents (DBusConnection * bus, DBusMessage * message, void *user_data)
310 dbus_uint32_t coord_type;
311 dbus_int32_t x = 0, y = 0, width = 1024, height = 768;
313 DBusMessageIter iter, iter_struct;
315 reply = dbus_message_new_method_return (message);
316 dbus_message_iter_init_append (reply, &iter);
317 dbus_message_iter_open_container (&iter, DBUS_TYPE_STRUCT, NULL,
319 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_INT32, &x);
320 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_INT32, &y);
321 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_INT32, &width);
322 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_INT32, &height);
323 dbus_message_iter_close_container (&iter, &iter_struct);
328 impl_GetPosition (DBusConnection * bus, DBusMessage * message,
332 dbus_int32_t x = 0, y = 0;
334 reply = dbus_message_new_method_return (message);
335 dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32,
336 &y, DBUS_TYPE_INVALID);
341 impl_GetSize (DBusConnection * bus, DBusMessage * message, void *user_data)
343 /* TODO - Get the screen size */
345 dbus_int32_t width = 1024, height = 768;
347 reply = dbus_message_new_method_return (message);
348 dbus_message_append_args (reply, DBUS_TYPE_INT32, &width,
349 DBUS_TYPE_INT32, &height, DBUS_TYPE_INVALID);
353 #define LAYER_WIDGET 3;
356 impl_GetLayer (DBusConnection * bus, DBusMessage * message, void *user_data)
359 dbus_uint32_t rv = LAYER_WIDGET;
361 reply = dbus_message_new_method_return (message);
362 dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv,
368 impl_GetMDIZOrder (DBusConnection * bus, DBusMessage * message,
374 reply = dbus_message_new_method_return (message);
375 dbus_message_append_args (reply, DBUS_TYPE_INT16, &rv,
381 impl_GrabFocus (DBusConnection * bus, DBusMessage * message, void *user_data)
384 dbus_bool_t retval = FALSE;
386 reply = dbus_message_new_method_return (message);
387 dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval,
393 impl_GetAlpha (DBusConnection * bus, DBusMessage * message, void *user_data)
398 reply = dbus_message_new_method_return (message);
399 dbus_message_append_args (reply, DBUS_TYPE_DOUBLE, &rv,
404 /* org.at_spi.Accessible interface */
405 /*---------------------------------------------------------------------------*/
408 impl_get_Name (DBusMessageIter * iter, void *user_data)
410 const gchar *name = "main";
411 return return_v_string (iter, name);
415 impl_get_Description (DBusMessageIter * iter, void *user_data)
417 const gchar *description = "";
418 return return_v_string (iter, description);
422 impl_get_Parent (DBusMessageIter * iter, void *user_data)
424 const gchar *name = "";
425 DBusMessageIter iter_variant;
427 dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "(so)",
429 append_reference (&iter_variant,
432 dbus_message_iter_close_container (iter, &iter_variant);
437 impl_get_ChildCount (DBusMessageIter * iter, void *user_data)
439 SpiRegistry *reg = SPI_REGISTRY (user_data);
440 dbus_int32_t rv = reg->apps->len;
442 dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &rv);
446 impl_GetChildAtIndex (DBusConnection * bus,
447 DBusMessage * message, void *user_data)
449 SpiRegistry *reg = SPI_REGISTRY (user_data);
451 DBusMessageIter iter;
456 dbus_error_init (&error);
457 if (!dbus_message_get_args
458 (message, &error, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID))
460 return dbus_message_new_error (message, DBUS_ERROR_FAILED, "Invalid arguments");
463 reply = dbus_message_new_method_return (message);
464 dbus_message_iter_init_append (reply, &iter);
466 ref = g_ptr_array_index (reg->apps, i);
467 append_reference (&iter, ref->name, ref->path);
473 impl_GetChildren (DBusConnection * bus,
474 DBusMessage * message, void *user_data)
476 DBusMessage *reply = NULL;
477 DBusMessageIter iter, iter_array;
478 SpiRegistry *reg = SPI_REGISTRY (user_data);
481 reply = dbus_message_new_method_return (message);
483 dbus_message_iter_init_append (reply, &iter);
484 dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(so)", &iter_array);
485 for (i=0; i < reg->apps->len; i++)
487 SpiReference *current = g_ptr_array_index (reg->apps, i);
488 append_reference (&iter_array, current->name, current->path);
490 dbus_message_iter_close_container(&iter, &iter_array);
495 impl_GetIndexInParent (DBusConnection * bus,
496 DBusMessage * message, void *user_data)
499 dbus_uint32_t rv = 0;
501 reply = dbus_message_new_method_return (message);
502 dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv, DBUS_TYPE_INVALID);
507 impl_GetRelationSet (DBusConnection * bus,
508 DBusMessage * message, void *user_data)
511 DBusMessageIter iter, iter_array;
513 reply = dbus_message_new_method_return (message);
514 dbus_message_iter_init_append (reply, &iter);
515 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "(ua(so))", &iter_array);
516 dbus_message_iter_close_container (&iter, &iter_array);
522 impl_GetRole (DBusConnection * bus, DBusMessage * message, void * user_data)
525 dbus_uint32_t rv = 0;
527 reply = dbus_message_new_method_return (message);
528 dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv, DBUS_TYPE_INVALID);
533 impl_GetRoleName (DBusConnection * bus,
534 DBusMessage * message, void *user_data)
537 const char *role_name = "unknown";
539 reply = dbus_message_new_method_return (message);
540 dbus_message_append_args (reply, DBUS_TYPE_STRING, &role_name,
546 impl_GetLocalizedRoleName (DBusConnection * bus,
547 DBusMessage * message, void *user_data)
549 /* TODO - Localize this */
551 const char *role_name = "unknown";
553 reply = dbus_message_new_method_return (message);
554 dbus_message_append_args (reply, DBUS_TYPE_STRING, &role_name,
560 impl_GetState (DBusConnection * bus, DBusMessage * message, void *user_data)
562 DBusMessage *reply = NULL;
563 DBusMessageIter iter, iter_array;
565 dbus_uint32_t states[2] = {0, 0};
568 reply = dbus_message_new_method_return (message);
569 dbus_message_iter_init_append (reply, &iter);
571 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "u", &iter_array);
572 for (count = 0; count < 2; count++)
574 dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_UINT32,
577 dbus_message_iter_close_container (&iter, &iter_array);
582 impl_GetAttributes (DBusConnection * bus,
583 DBusMessage * message, void *user_data)
585 DBusMessage *reply = NULL;
586 DBusMessageIter iter, array;
588 reply = dbus_message_new_method_return (message);
589 dbus_message_iter_init_append (reply, &iter);
590 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "{ss}", &array);
591 dbus_message_iter_close_container (&iter, &array);
597 impl_GetApplication (DBusConnection * bus,
598 DBusMessage * message, void *user_data)
600 DBusMessage *reply = NULL;
601 DBusMessageIter iter;
603 reply = dbus_message_new_method_return (message);
604 dbus_message_iter_init_append (reply, &iter);
605 append_reference (&iter,
606 dbus_bus_get_unique_name (bus),
613 impl_GetInterfaces (DBusConnection * bus,
614 DBusMessage * message, void *user_data)
617 DBusMessageIter iter, iter_array;
619 const char *acc = SPI_DBUS_INTERFACE_ACCESSIBLE;
620 const char *com = SPI_DBUS_INTERFACE_COMPONENT;
622 reply = dbus_message_new_method_return (message);
624 dbus_message_iter_init_append (reply, &iter);
625 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "s",
627 dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &acc);
628 dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &com);
629 dbus_message_iter_close_container (&iter, &iter_array);
634 /*---------------------------------------------------------------------------*/
637 emit_Available (DBusConnection * bus)
640 DBusMessageIter iter;
642 sig = dbus_message_new_signal(SPI_DBUS_PATH_ROOT, SPI_DBUS_INTERFACE_SOCKET, "Available");
644 dbus_message_iter_init_append(sig, &iter);
645 append_reference (&iter, SPI_DBUS_NAME_REGISTRY, SPI_DBUS_PATH_ROOT);
647 dbus_connection_send(bus, sig, NULL);
648 dbus_message_unref(sig);
651 /*---------------------------------------------------------------------------*/
653 static const char *introspection_header =
654 "<?xml version=\"1.0\"?>\n";
656 static const char *introspection_node_element =
657 "<node name=\"%s\">\n";
659 static const char *introspection_footer =
663 impl_Introspect (DBusConnection * bus,
664 DBusMessage * message, void *user_data)
670 const gchar *pathstr = SPI_DBUS_PATH_ROOT;
674 output = g_string_new(introspection_header);
676 g_string_append_printf(output, introspection_node_element, pathstr);
678 g_string_append (output, spi_org_freedesktop_atspi_Accessible);
679 g_string_append (output, spi_org_freedesktop_atspi_Component);
681 g_string_append(output, introspection_footer);
682 final = g_string_free(output, FALSE);
684 reply = dbus_message_new_method_return (message);
685 dbus_message_append_args(reply, DBUS_TYPE_STRING, &final, DBUS_TYPE_INVALID);
691 /*---------------------------------------------------------------------------*/
694 * Emits an AT-SPI event.
695 * AT-SPI events names are split into three parts:
697 * This is mapped onto D-Bus events as:
698 * D-Bus Interface:Signal Name:Detail argument
700 * Marshals a basic type into the 'any_data' attribute of
704 emit_event (DBusConnection *bus,
708 dbus_int32_t detail1,
709 dbus_int32_t detail2,
714 DBusMessageIter iter, iter_variant;
716 sig = dbus_message_new_signal(SPI_DBUS_PATH_ROOT, klass, major);
718 dbus_message_iter_init_append(sig, &iter);
720 dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &minor);
721 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &detail1);
722 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &detail2);
724 dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, "(so)",
726 append_reference (&iter_variant, name, path);
727 dbus_message_iter_close_container (&iter, &iter_variant);
729 append_reference (&iter,
730 dbus_bus_get_unique_name (bus),
733 dbus_connection_send(bus, sig, NULL);
734 dbus_message_unref(sig);
737 /*---------------------------------------------------------------------------*/
740 * Children changed signal converter and forwarder.
742 * Klass (Interface) org.freedesktop.atspi.Event.Object
743 * Major is the signal name.
744 * Minor is 'add' or 'remove'
745 * detail1 is the index.
747 * any_data is the child reference.
751 children_added_listener (DBusConnection * bus,
756 emit_event (bus, SPI_DBUS_INTERFACE_EVENT_OBJECT, "ChildrenChanged", "add", index, 0,
761 children_removed_listener (DBusConnection * bus,
766 emit_event (bus, SPI_DBUS_INTERFACE_EVENT_OBJECT, "ChildrenChanged", "remove", index, 0,
767 name, SPI_DBUS_PATH_NULL);
770 /*---------------------------------------------------------------------------*/
772 static DBusHandlerResult
773 handle_method (DBusConnection *bus, DBusMessage *message, void *user_data)
775 DBusHandlerResult result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
777 const gchar *iface = dbus_message_get_interface (message);
778 const gchar *member = dbus_message_get_member (message);
779 const gint type = dbus_message_get_type (message);
781 DBusMessage *reply = NULL;
783 /* Check for basic reasons not to handle */
784 if (type != DBUS_MESSAGE_TYPE_METHOD_CALL ||
787 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
789 if (!strcmp (iface, "org.freedesktop.DBus.Properties"))
791 if (!strcmp (member, "Get"))
793 const gchar *prop_iface;
794 const gchar *prop_member;
797 dbus_error_init (&error);
798 if (dbus_message_get_args (message,
806 DBusMessageIter iter;
808 reply = dbus_message_new_method_return (message);
809 dbus_message_iter_init_append (reply, &iter);
812 if (!strcmp (prop_iface, SPI_DBUS_INTERFACE_ACCESSIBLE))
814 if (!strcmp (prop_member, "Name"))
815 impl_get_Name (&iter, user_data);
816 else if (!strcmp (prop_member, "Description"))
817 impl_get_Description (&iter, user_data);
818 else if (!strcmp (prop_member, "Parent"))
819 impl_get_Parent (&iter, user_data);
820 else if (!strcmp (prop_member, "ChildCount"))
821 impl_get_ChildCount (&iter, user_data);
824 dbus_message_unref (reply);
825 reply = dbus_message_new_error (message, DBUS_ERROR_FAILED, "Property unavailable");
831 reply = dbus_message_new_error (message, DBUS_ERROR_FAILED, error.message);
833 result = DBUS_HANDLER_RESULT_HANDLED;
835 else if (!strcmp (member, "GetAll"))
837 result = DBUS_HANDLER_RESULT_HANDLED;
841 if (!strcmp (iface, SPI_DBUS_INTERFACE_ACCESSIBLE))
843 result = DBUS_HANDLER_RESULT_HANDLED;
844 if (!strcmp (member, "GetChildAtIndex"))
845 reply = impl_GetChildAtIndex (bus, message, user_data);
846 else if (!strcmp (member, "GetChildren"))
847 reply = impl_GetChildren (bus, message, user_data);
848 else if (!strcmp (member, "GetIndexInParent"))
849 reply = impl_GetIndexInParent (bus, message, user_data);
850 else if (!strcmp (member, "GetRelationSet"))
851 reply = impl_GetRelationSet (bus, message, user_data);
852 else if (!strcmp (member, "GetRole"))
853 reply = impl_GetRole (bus, message, user_data);
854 else if (!strcmp (member, "GetRoleName"))
855 reply = impl_GetRoleName (bus, message, user_data);
856 else if (!strcmp (member, "GetLocalizedRoleName"))
857 reply = impl_GetLocalizedRoleName (bus, message, user_data);
858 else if (!strcmp (member, "GetState"))
859 reply = impl_GetState (bus, message, user_data);
860 else if (!strcmp (member, "GetAttributes"))
861 reply = impl_GetAttributes (bus, message, user_data);
862 else if (!strcmp (member, "GetApplication"))
863 reply = impl_GetApplication (bus, message, user_data);
864 else if (!strcmp (member, "GetInterfaces"))
865 reply = impl_GetInterfaces (bus, message, user_data);
867 result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
870 if (!strcmp (iface, SPI_DBUS_INTERFACE_COMPONENT))
872 result = DBUS_HANDLER_RESULT_HANDLED;
873 if (!strcmp (member, "Contains"))
874 reply = impl_Contains (bus, message, user_data);
875 else if (!strcmp (member, "GetAccessibleAtPoint"))
876 reply = impl_GetAccessibleAtPoint (bus, message, user_data);
877 else if (!strcmp (member, "GetExtents"))
878 reply = impl_GetExtents (bus, message, user_data);
879 else if (!strcmp (member, "GetPosition"))
880 reply = impl_GetPosition (bus, message, user_data);
881 else if (!strcmp (member, "GetSize"))
882 reply = impl_GetSize (bus, message, user_data);
883 else if (!strcmp (member, "GetLayer"))
884 reply = impl_GetLayer (bus, message, user_data);
885 else if (!strcmp (member, "GetMDIZOrder"))
886 reply = impl_GetMDIZOrder (bus, message, user_data);
887 else if (!strcmp (member, "GrabFocus"))
888 reply = impl_GrabFocus (bus, message, user_data);
889 else if (!strcmp (member, "GetAlpha"))
890 reply = impl_GetAlpha (bus, message, user_data);
892 result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
895 if (!strcmp (iface, SPI_DBUS_INTERFACE_SOCKET))
897 result = DBUS_HANDLER_RESULT_HANDLED;
898 if (!strcmp (member, "Embed"))
899 reply = impl_Embed (bus, message, user_data);
900 else if (!strcmp (member, "Unembed"))
901 reply = impl_Unembed (bus, message, user_data);
903 result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
906 if (!strcmp (iface, "org.freedesktop.DBus.Introspectable"))
908 result = DBUS_HANDLER_RESULT_HANDLED;
909 if (!strcmp (member, "Introspect"))
910 reply = impl_Introspect (bus, message, user_data);
912 result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
915 if (result == DBUS_HANDLER_RESULT_HANDLED)
919 reply = dbus_message_new_method_return (message);
922 dbus_connection_send (bus, reply, NULL);
923 dbus_message_unref (reply);
928 g_print ("Registry | Unhandled message : %s|%s\n", iface, member);
935 /*---------------------------------------------------------------------------*/
937 static DBusObjectPathVTable registry_vtable =
941 NULL, NULL, NULL, NULL
944 static gchar *app_sig_match_name_owner =
945 "type='signal', interface='org.freedesktop.DBus', member='NameOwnerChanged'";
948 spi_registry_new (DBusConnection *bus)
950 SpiRegistry *reg = g_object_new (SPI_REGISTRY_TYPE, NULL);
954 dbus_bus_add_match (bus, app_sig_match_name_owner, NULL);
955 dbus_connection_add_filter (bus, signal_filter, reg, NULL);
957 dbus_connection_register_object_path (bus, SPI_DBUS_PATH_ROOT, ®istry_vtable, reg);
959 emit_Available (bus);
964 /*END------------------------------------------------------------------------*/