2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2008 Novell, Inc.
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.
26 #include <droute/droute.h>
29 #include "atspi/atspi.h"
31 #include "accessible-stateset.h"
32 #include "accessible-register.h"
34 #include "introspection.h"
50 // TIZEN_ONLY(20170310) - implementation of get object under coordinates for accessibility
51 static AtspiRelationType spi_relation_type_from_atk_relation_type (AtkRelationType type);
53 static AtspiRole _object_get_role_impl(void *ptr)
55 AtkObject *obj = (AtkObject*)ptr;
56 AtkRole role = atk_object_get_role (obj);
57 AtspiRole rv = spi_accessible_role_from_atk_role (role);
61 static uint64_t _object_get_state_set_impl(void *ptr)
63 dbus_uint32_t array[2];
64 spi_atk_state_to_dbus_array((AtkObject*)ptr, array);
65 uint64_t res = array[0] | ((uint64_t)array[1] << 32);
69 static void *_get_object_in_relation_by_type_impl(void *ptr, AtspiRelationType expected_relation_type)
72 g_return_val_if_fail (ATK_IS_OBJECT (ptr), NULL);
73 AtkRelationSet *set = atk_object_ref_relation_set (ptr);
76 gint count = atk_relation_set_get_n_relations (set), i;
77 for (i = 0; i < count; i++)
79 AtkRelation *r = atk_relation_set_get_relation (set, i);
82 AtkRelationType rt = atk_relation_get_relation_type (r);
83 AtspiRelationType type = spi_relation_type_from_atk_relation_type (rt);
84 if (expected_relation_type == type)
86 GPtrArray *target = atk_relation_get_target (r);
87 if (target && target->len > 0)
88 return target->pdata[0];
96 static unsigned char _object_is_zero_size_impl(void *ptr)
98 AtkObject *obj = (AtkObject*)obj;
99 g_return_val_if_fail(ATK_IS_COMPONENT (obj), 0);
101 atk_component_get_extents (ATK_COMPONENT(obj), &x, &y, &w, &h, ATSPI_COORD_TYPE_SCREEN);
102 return w == 0 || h == 0;
105 unsigned char _object_is_scrollable_impl(void *ptr)
107 AtspiRole role = _object_get_role_impl(ptr);
109 case ATSPI_ROLE_SCROLL_PANE: //scroller
110 case ATSPI_ROLE_LIST: //genlist, list
111 case ATSPI_ROLE_TREE_TABLE: //gengrid
112 case ATSPI_ROLE_TOOL_BAR: //toolbar
120 void *_get_parent_impl(void *ptr)
122 return atk_object_get_parent((AtkObject*)ptr);
125 void *_object_at_point_get_impl(void *ptr, int x, int y, unsigned char coordinates_are_screen_based)
127 AtkObject *obj = (AtkObject*)ptr;
128 g_return_val_if_fail(ATK_IS_COMPONENT (obj), 0);
129 return atk_component_ref_accessible_at_point (ATK_COMPONENT(obj), x, y,
130 coordinates_are_screen_based ? ATSPI_COORD_TYPE_SCREEN : ATSPI_COORD_TYPE_WINDOW);
133 unsigned char _object_contains_impl(void *ptr, int x, int y, unsigned char coordinates_are_screen_based)
135 AtkObject *obj = (AtkObject*)ptr;
136 g_return_val_if_fail(ATK_IS_COMPONENT (obj), 0);
138 return atk_component_contains (ATK_COMPONENT(obj), x, y,
139 coordinates_are_screen_based ? ATSPI_COORD_TYPE_SCREEN : ATSPI_COORD_TYPE_WINDOW);
142 unsigned char _object_is_proxy_impl(void *ptr)
148 AtspiRole (*object_get_role)(void *ptr);
149 uint64_t (*object_get_state_set)(void *ptr);
150 void *(*get_object_in_relation_by_type)(void *ptr, AtspiRelationType type);
151 unsigned char (*object_is_zero_size)(void *ptr);
152 void *(*get_parent)(void *ptr);
153 unsigned char (*object_is_scrollable)(void *ptr);
154 void *(*object_at_point_get)(void *ptr, int x, int y, unsigned char coordinates_are_screen_based);
155 unsigned char (*object_contains)(void *ptr, int x, int y, unsigned char coordinates_are_screen_based);
156 unsigned char (*object_is_proxy)(void *ptr);
157 } accessibility_navigation_pointer_table;
159 static unsigned char _accept_object_check_role(accessibility_navigation_pointer_table *table, void *obj)
161 AtspiRole role = table->object_get_role(obj);
164 case ATSPI_ROLE_APPLICATION:
165 case ATSPI_ROLE_FILLER:
166 case ATSPI_ROLE_SCROLL_PANE:
167 case ATSPI_ROLE_SPLIT_PANE:
168 case ATSPI_ROLE_WINDOW:
169 case ATSPI_ROLE_IMAGE:
170 case ATSPI_ROLE_LIST:
171 case ATSPI_ROLE_ICON:
172 case ATSPI_ROLE_TOOL_BAR:
173 case ATSPI_ROLE_REDUNDANT_OBJECT:
174 case ATSPI_ROLE_COLOR_CHOOSER:
175 case ATSPI_ROLE_PANEL:
176 case ATSPI_ROLE_TREE_TABLE:
177 case ATSPI_ROLE_PAGE_TAB_LIST:
178 case ATSPI_ROLE_PAGE_TAB:
179 case ATSPI_ROLE_SPIN_BUTTON:
180 case ATSPI_ROLE_INPUT_METHOD_WINDOW:
181 case ATSPI_ROLE_EMBEDDED:
182 case ATSPI_ROLE_INVALID:
183 case ATSPI_ROLE_NOTIFICATION:
191 static unsigned char _state_set_is_set(uint64_t state_set, AtspiStateType state)
193 return (state_set & ((uint64_t)1 << (unsigned int)state)) != 0;
196 static unsigned char _object_is_item(accessibility_navigation_pointer_table *table, void *obj)
198 AtspiRole role = table->object_get_role(obj);
199 return role == ATSPI_ROLE_LIST_ITEM || role == ATSPI_ROLE_MENU_ITEM;
202 static unsigned char _object_is_highlightable(accessibility_navigation_pointer_table *table, void *obj)
204 uint64_t state_set = table->object_get_state_set(obj);
205 return _state_set_is_set(state_set, ATSPI_STATE_HIGHLIGHTABLE);
208 static unsigned char _object_is_showing(accessibility_navigation_pointer_table *table, void *obj)
210 uint64_t state_set = table->object_get_state_set(obj);
211 return _state_set_is_set(state_set, ATSPI_STATE_SHOWING);
214 static unsigned char _object_is_collapsed(accessibility_navigation_pointer_table *table, void *obj)
216 uint64_t state_set = table->object_get_state_set(obj);
218 _state_set_is_set(state_set, ATSPI_STATE_EXPANDABLE) &&
219 !_state_set_is_set(state_set, ATSPI_STATE_EXPANDED);
222 static unsigned char _object_has_modal_state(accessibility_navigation_pointer_table *table, void *obj)
224 uint64_t state_set = table->object_get_state_set(obj);
225 return _state_set_is_set(state_set, ATSPI_STATE_MODAL);
228 static unsigned char _object_is_zero_size(accessibility_navigation_pointer_table *table, void *obj)
230 return table->object_is_zero_size(obj);
233 static void *_get_scrollable_parent(accessibility_navigation_pointer_table *table, void *obj)
237 obj = table->get_parent(obj);
238 if (obj && table->object_is_scrollable(obj)) return obj;
242 static unsigned char _accept_object(accessibility_navigation_pointer_table *table, void *obj)
245 if (!_accept_object_check_role(table, obj)) return 0;
246 if (table->get_object_in_relation_by_type(obj, ATSPI_RELATION_CONTROLLED_BY) != NULL) return 0;
247 if (!_object_is_highlightable(table, obj)) return 0;
249 if (_get_scrollable_parent(table, obj) != NULL)
251 void *parent = table->get_parent(obj);
255 return !_object_is_item(table, obj) || !_object_is_collapsed(table, parent);
260 if (_object_is_zero_size(table, obj)) return 0;
261 if (!_object_is_showing(table, obj)) return 0;
266 static void *_calculate_navigable_accessible_at_point_impl(accessibility_navigation_pointer_table *table,
267 void *root, int x, int y, unsigned char coordinates_are_screen_based)
269 if (!root) return NULL;
271 void *return_value = NULL;
274 void *target = table->object_at_point_get(root, x, y, coordinates_are_screen_based);
277 // always return proxy, so atspi lib can call on it again
278 if (table->object_is_proxy(target)) return target;
281 void *relation_obj = table->get_object_in_relation_by_type(root, ATSPI_RELATION_CONTROLLED_BY);
282 unsigned char contains = 0;
285 contains = table->object_contains(relation_obj, x, y, coordinates_are_screen_based);
286 if (contains) root = relation_obj;
289 if (_accept_object(table, root))
296 if (return_value && _object_has_modal_state(table, return_value)) return_value = NULL;
300 accessibility_navigation_pointer_table construct_accessibility_navigation_pointer_table(void)
302 accessibility_navigation_pointer_table table;
303 #define INIT(n) table.n = _## n ## _impl
304 INIT(object_get_role);
305 INIT(object_get_state_set);
306 INIT(get_object_in_relation_by_type);
307 INIT(object_is_zero_size);
309 INIT(object_is_scrollable);
310 INIT(object_at_point_get);
311 INIT(object_contains);
312 INIT(object_is_proxy);
316 static AtkObject *_calculate_navigable_accessible_at_point(AtkObject *root, unsigned char coord_type, int x, int y)
318 accessibility_navigation_pointer_table table = construct_accessibility_navigation_pointer_table();
319 AtkObject *result = (AtkObject*)_calculate_navigable_accessible_at_point_impl(&table, root, x, y, coord_type ? 1 : 0);
324 impl_GetNavigableAtPoint (DBusConnection * bus, DBusMessage * message,
327 AtkObject *object = (AtkObject *) user_data;
329 dbus_uint32_t coord_type;
333 g_return_val_if_fail (ATK_IS_COMPONENT (object),
334 droute_not_yet_handled_error (message));
336 if (!dbus_message_get_args
337 (message, NULL, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y,
338 DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID))
340 return droute_invalid_arguments_error (message);
343 _calculate_navigable_accessible_at_point (object, coord_type == ATSPI_COORD_TYPE_SCREEN, x, y);
345 reply = spi_object_return_reference_and_recurse_flag (message, child, 0);
347 g_object_unref (child);
354 impl_get_Name (DBusMessageIter * iter, void *user_data)
356 AtkObject *object = (AtkObject *) user_data;
358 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
360 return droute_return_v_string (iter, atk_object_get_name (object));
364 impl_get_Description (DBusMessageIter * iter, void *user_data)
366 AtkObject *object = (AtkObject *) user_data;
368 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
370 return droute_return_v_string (iter, atk_object_get_description (object));
374 impl_get_Locale (DBusMessageIter * iter, void *user_data)
376 AtkObject *object = (AtkObject *) user_data;
378 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
380 return droute_return_v_string (iter, atk_object_get_object_locale (object));
384 impl_get_Parent (DBusMessageIter * iter, void *user_data)
386 AtkObject *obj = (AtkObject *) user_data;
388 DBusMessageIter iter_variant;
391 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
393 role = spi_accessible_role_from_atk_role (atk_object_get_role (obj));
395 dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "(so)",
398 parent = atk_object_get_parent (obj);
401 /* TODO, move in to a 'Plug' wrapper. */
402 if (ATK_IS_PLUG (obj))
404 char *id = g_object_get_data (G_OBJECT (obj), "dbus-plug-parent");
410 bus_parent = g_strdup (id);
411 if (bus_parent && (path_parent = g_utf8_strchr (bus_parent + 1, -1, ':')))
413 DBusMessageIter iter_parent;
414 *(path_parent++) = '\0';
415 dbus_message_iter_open_container (&iter_variant, DBUS_TYPE_STRUCT, NULL,
417 dbus_message_iter_append_basic (&iter_parent, DBUS_TYPE_STRING, &bus_parent);
418 dbus_message_iter_append_basic (&iter_parent, DBUS_TYPE_OBJECT_PATH, &path_parent);
419 dbus_message_iter_close_container (&iter_variant, &iter_parent);
423 spi_object_append_null_reference (&iter_variant);
428 spi_object_append_null_reference (&iter_variant);
431 else if (role != ATSPI_ROLE_APPLICATION)
432 spi_object_append_null_reference (&iter_variant);
434 spi_object_append_desktop_reference (&iter_variant);
438 spi_object_append_reference (&iter_variant, parent);
442 dbus_message_iter_close_container (iter, &iter_variant);
447 impl_get_ChildCount (DBusMessageIter * iter, void *user_data)
449 AtkObject *object = (AtkObject *) user_data;
452 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
454 childCount = (ATK_IS_SOCKET (object) && atk_socket_is_occupied (ATK_SOCKET (object)))
456 : atk_object_get_n_accessible_children (object);
457 return droute_return_v_int32 (iter, childCount);
461 impl_GetChildAtIndex (DBusConnection * bus,
462 DBusMessage * message, void *user_data)
464 AtkObject *object = (AtkObject *) user_data;
469 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
470 droute_not_yet_handled_error (message));
471 if (!dbus_message_get_args
472 (message, NULL, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID))
474 return droute_invalid_arguments_error (message);
477 if (ATK_IS_SOCKET (object) && atk_socket_is_occupied (ATK_SOCKET (object)) && i == 0)
479 AtkSocket *socket = ATK_SOCKET (object);
480 gchar *child_name, *child_path;
481 child_name = g_strdup (socket->embedded_plug_id);
482 child_path = g_utf8_strchr (child_name + 1, -1, ':');
485 DBusMessageIter iter, iter_socket;
486 *(child_path++) = '\0';
487 reply = dbus_message_new_method_return (message);
490 dbus_message_iter_init_append (reply, &iter);
491 dbus_message_iter_open_container (&iter, DBUS_TYPE_STRUCT, NULL,
493 dbus_message_iter_append_basic (&iter_socket, DBUS_TYPE_STRING, &child_name);
494 dbus_message_iter_append_basic (&iter_socket, DBUS_TYPE_OBJECT_PATH, &child_path);
495 dbus_message_iter_close_container (&iter, &iter_socket);
500 child = atk_object_ref_accessible_child (object, i);
501 reply = spi_object_return_reference (message, child);
502 g_object_unref (child);
508 impl_GetChildren (DBusConnection * bus,
509 DBusMessage * message, void *user_data)
511 AtkObject *object = (AtkObject *) user_data;
515 DBusMessageIter iter, iter_array;
517 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
518 droute_not_yet_handled_error (message));
519 count = atk_object_get_n_accessible_children (object);
520 reply = dbus_message_new_method_return (message);
523 dbus_message_iter_init_append (reply, &iter);
524 if (!dbus_message_iter_open_container
525 (&iter, DBUS_TYPE_ARRAY, "(so)", &iter_array))
527 for (i = 0; i < count; i++)
529 AtkObject *child = atk_object_ref_accessible_child (object, i);
530 spi_object_append_reference (&iter_array, child);
532 g_object_unref (child);
534 if (!dbus_message_iter_close_container (&iter, &iter_array))
538 // TODO: handle out-of-memory
543 impl_GetIndexInParent (DBusConnection * bus,
544 DBusMessage * message, void *user_data)
546 AtkObject *object = (AtkObject *) user_data;
550 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
551 droute_not_yet_handled_error (message));
553 rv = atk_object_get_index_in_parent (object);
554 reply = dbus_message_new_method_return (message);
555 dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv, DBUS_TYPE_INVALID);
560 spi_init_relation_type_table (AtspiRelationType * types)
564 for (i = 0; i < ATK_RELATION_LAST_DEFINED; i++)
565 types[i] = ATSPI_RELATION_NULL;
567 types[ATK_RELATION_CONTROLLED_BY] = ATSPI_RELATION_CONTROLLED_BY;
568 types[ATK_RELATION_CONTROLLER_FOR] = ATSPI_RELATION_CONTROLLER_FOR;
569 types[ATK_RELATION_LABEL_FOR] = ATSPI_RELATION_LABEL_FOR;
570 types[ATK_RELATION_LABELLED_BY] = ATSPI_RELATION_LABELLED_BY;
571 types[ATK_RELATION_MEMBER_OF] = ATSPI_RELATION_MEMBER_OF;
572 types[ATK_RELATION_NODE_CHILD_OF] = ATSPI_RELATION_NODE_CHILD_OF;
573 types[ATK_RELATION_FLOWS_TO] = ATSPI_RELATION_FLOWS_TO;
574 types[ATK_RELATION_FLOWS_FROM] = ATSPI_RELATION_FLOWS_FROM;
575 types[ATK_RELATION_SUBWINDOW_OF] = ATSPI_RELATION_SUBWINDOW_OF;
576 types[ATK_RELATION_EMBEDS] = ATSPI_RELATION_EMBEDS;
577 types[ATK_RELATION_EMBEDDED_BY] = ATSPI_RELATION_EMBEDDED_BY;
578 types[ATK_RELATION_POPUP_FOR] = ATSPI_RELATION_POPUP_FOR;
579 types[ATK_RELATION_PARENT_WINDOW_OF] =
580 ATSPI_RELATION_PARENT_WINDOW_OF;
581 types[ATK_RELATION_DESCRIPTION_FOR] =
582 ATSPI_RELATION_DESCRIPTION_FOR;
583 types[ATK_RELATION_DESCRIBED_BY] = ATSPI_RELATION_DESCRIBED_BY;
584 types[ATK_RELATION_NODE_PARENT_OF] = ATSPI_RELATION_NODE_PARENT_OF;
589 static AtspiRelationType
590 spi_relation_type_from_atk_relation_type (AtkRelationType type)
592 static gboolean is_initialized = FALSE;
593 static AtspiRelationType
594 spi_relation_type_table[ATK_RELATION_LAST_DEFINED];
595 AtspiRelationType spi_type;
598 is_initialized = spi_init_relation_type_table (spi_relation_type_table);
600 if (type > ATK_RELATION_NULL && type < ATK_RELATION_LAST_DEFINED)
601 spi_type = spi_relation_type_table[type];
603 spi_type = ATSPI_RELATION_EXTENDED;
608 impl_GetRelationSet (DBusConnection * bus,
609 DBusMessage * message, void *user_data)
611 AtkObject *object = (AtkObject *) user_data;
614 DBusMessageIter iter, iter_array, iter_struct, iter_targets;
618 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
619 droute_not_yet_handled_error (message));
620 reply = dbus_message_new_method_return (message);
623 set = atk_object_ref_relation_set (object);
624 dbus_message_iter_init_append (reply, &iter);
625 if (!dbus_message_iter_open_container
626 (&iter, DBUS_TYPE_ARRAY, "(ua(so))", &iter_array))
632 count = atk_relation_set_get_n_relations (set);
633 for (i = 0; i < count; i++)
635 AtkRelation *r = atk_relation_set_get_relation (set, i);
641 rt = atk_relation_get_relation_type (r);
642 type = spi_relation_type_from_atk_relation_type (rt);
643 target = atk_relation_get_target (r);
644 if (!dbus_message_iter_open_container
645 (&iter_array, DBUS_TYPE_STRUCT, NULL, &iter_struct))
649 dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_UINT32, &type);
650 if (!dbus_message_iter_open_container
651 (&iter_struct, DBUS_TYPE_ARRAY, "(so)", &iter_targets))
655 for (j = 0; j < target->len; j++)
657 AtkObject *obj = target->pdata[j];
660 spi_object_append_reference (&iter_targets, obj);
662 dbus_message_iter_close_container (&iter_struct, &iter_targets);
663 dbus_message_iter_close_container (&iter_array, &iter_struct);
665 dbus_message_iter_close_container (&iter, &iter_array);
668 g_object_unref (set);
669 // TODO: handle out of memory */
674 impl_GetRole (DBusConnection * bus, DBusMessage * message, void *user_data)
676 AtkObject *object = (AtkObject *) user_data;
681 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
682 droute_not_yet_handled_error (message));
683 role = atk_object_get_role (object);
684 rv = spi_accessible_role_from_atk_role (role);
685 reply = dbus_message_new_method_return (message);
688 dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv,
695 impl_GetRoleName (DBusConnection * bus,
696 DBusMessage * message, void *user_data)
698 AtkObject *object = (AtkObject *) user_data;
700 const char *role_name;
703 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
704 droute_not_yet_handled_error (message));
705 role = atk_object_get_role (object);
706 role_name = atk_role_get_name (role);
709 reply = dbus_message_new_method_return (message);
712 dbus_message_append_args (reply, DBUS_TYPE_STRING, &role_name,
719 impl_GetLocalizedRoleName (DBusConnection * bus,
720 DBusMessage * message, void *user_data)
722 AtkObject *object = (AtkObject *) user_data;
724 const char *role_name;
727 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
728 droute_not_yet_handled_error (message));
729 role = atk_object_get_role (object);
730 role_name = atk_role_get_localized_name (role);
733 reply = dbus_message_new_method_return (message);
736 dbus_message_append_args (reply, DBUS_TYPE_STRING, &role_name,
743 impl_GetState (DBusConnection * bus, DBusMessage * message, void *user_data)
745 AtkObject *object = (AtkObject *) user_data;
747 DBusMessage *reply = NULL;
748 DBusMessageIter iter, iter_array;
750 dbus_uint32_t states[2];
754 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
755 droute_not_yet_handled_error (message));
757 reply = dbus_message_new_method_return (message);
758 dbus_message_iter_init_append (reply, &iter);
760 spi_atk_state_to_dbus_array (object, states);
761 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "u", &iter_array);
762 for (count = 0; count < 2; count++)
764 dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_UINT32,
767 dbus_message_iter_close_container (&iter, &iter_array);
772 impl_GetAttributes (DBusConnection * bus,
773 DBusMessage * message, void *user_data)
775 AtkObject *object = (AtkObject *) user_data;
776 AtkAttributeSet *attributes;
777 DBusMessage *reply = NULL;
778 DBusMessageIter iter;
780 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
781 droute_not_yet_handled_error (message));
783 attributes = atk_object_get_attributes (object);
785 reply = dbus_message_new_method_return (message);
786 dbus_message_iter_init_append (reply, &iter);
787 spi_object_append_attribute_set (&iter, attributes);
789 atk_attribute_set_free (attributes);
795 impl_get_Attributes (DBusMessageIter * iter, void *user_data)
797 DBusMessageIter iter_variant;
798 AtkObject *object = (AtkObject *) user_data;
799 AtkAttributeSet *attributes;
801 g_return_val_if_fail (ATK_IS_OBJECT (user_data), FALSE);
803 attributes = atk_object_get_attributes (object);
805 dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "a{ss}", &iter_variant);
806 spi_object_append_attribute_set (&iter_variant, attributes);
807 dbus_message_iter_close_container (iter, &iter_variant);
809 atk_attribute_set_free (attributes);
815 impl_GetApplication (DBusConnection * bus,
816 DBusMessage * message, void *user_data)
818 return spi_object_return_reference (message, atk_get_root ());
822 impl_GetInterfaces (DBusConnection * bus,
823 DBusMessage * message, void *user_data)
825 AtkObject *object = (AtkObject *) user_data;
827 DBusMessageIter iter, iter_array;
829 g_return_val_if_fail (ATK_IS_OBJECT (user_data),
830 droute_not_yet_handled_error (message));
831 reply = dbus_message_new_method_return (message);
834 dbus_message_iter_init_append (reply, &iter);
835 dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "s",
837 spi_object_append_interfaces (&iter_array, object);
838 dbus_message_iter_close_container (&iter, &iter_array);
843 static DRouteMethod methods[] = {
844 // TIZEN_ONLY(20170310) - implementation of get object under coordinates for accessibility
845 {impl_GetNavigableAtPoint, "GetNavigableAtPoint"},
847 {impl_GetChildAtIndex, "GetChildAtIndex"},
848 {impl_GetChildren, "GetChildren"},
849 {impl_GetIndexInParent, "GetIndexInParent"},
850 {impl_GetRelationSet, "GetRelationSet"},
851 {impl_GetRole, "GetRole"},
852 {impl_GetRoleName, "GetRoleName"},
853 {impl_GetLocalizedRoleName, "GetLocalizedRoleName"},
854 {impl_GetState, "GetState"},
855 {impl_GetAttributes, "GetAttributes"},
856 {impl_GetApplication, "GetApplication"},
857 {impl_GetInterfaces, "GetInterfaces"},
861 static DRouteProperty properties[] = {
862 {impl_get_Name, NULL, "Name"},
863 {impl_get_Description, NULL, "Description"},
864 {impl_get_Locale, NULL, "Locale"},
865 {impl_get_Parent, NULL, "Parent"},
866 {impl_get_ChildCount, NULL, "ChildCount"},
867 {impl_get_Attributes, NULL, "Attributes"},
872 spi_initialize_accessible (DRoutePath * path)
874 spi_atk_add_interface (path,
875 ATSPI_DBUS_INTERFACE_ACCESSIBLE,
876 spi_org_a11y_atspi_Accessible,
877 methods, properties);