aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/lib/elementary/elm_atspi_access_adaptor.c574
-rw-r--r--src/lib/elementary/elm_atspi_access_adaptor.h6
-rw-r--r--src/lib/elementary/elm_atspi_access_adaptor_private.h0
-rw-r--r--src/lib/elementary/elm_atspi_adaptor_common.c104
-rw-r--r--src/lib/elementary/elm_atspi_adaptor_common.h35
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c629
7 files changed, 734 insertions, 616 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 6e4b3bee82..559abb336c 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -747,6 +747,8 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_list_precise_layouter.c \
lib/elementary/efl_ui_list_segarray.c \
lib/elementary/efl_ui_layout_factory.c \
+ lib/elementary/elm_atspi_access_adaptor.c \
+ lib/elementary/elm_atspi_adaptor_common.c \
$(NULL)
diff --git a/src/lib/elementary/elm_atspi_access_adaptor.c b/src/lib/elementary/elm_atspi_access_adaptor.c
new file mode 100644
index 0000000000..746aee794d
--- /dev/null
+++ b/src/lib/elementary/elm_atspi_access_adaptor.c
@@ -0,0 +1,574 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_ACCESS_PROTECTED
+
+#include <Elementary.h>
+#include "atspi/atspi-constants.h"
+#include "elm_priv.h"
+#include "elm_atspi_adaptor_common.h"
+
+#define SIZE(x) sizeof(x)/sizeof(x[0])
+
+static const int elm_roles_to_atspi_roles[][2] = {
+ { EFL_ACCESS_ROLE_INVALID, ATSPI_ROLE_INVALID },
+ { EFL_ACCESS_ROLE_ACCELERATOR_LABEL, ATSPI_ROLE_ACCELERATOR_LABEL },
+ { EFL_ACCESS_ROLE_ALERT, ATSPI_ROLE_ALERT },
+ { EFL_ACCESS_ROLE_ANIMATION, ATSPI_ROLE_ANIMATION },
+ { EFL_ACCESS_ROLE_ARROW, ATSPI_ROLE_ARROW },
+ { EFL_ACCESS_ROLE_CALENDAR, ATSPI_ROLE_CALENDAR },
+ { EFL_ACCESS_ROLE_CANVAS, ATSPI_ROLE_CANVAS },
+ { EFL_ACCESS_ROLE_CHECK_BOX, ATSPI_ROLE_CHECK_BOX },
+ { EFL_ACCESS_ROLE_CHECK_MENU_ITEM, ATSPI_ROLE_CHECK_MENU_ITEM },
+ { EFL_ACCESS_ROLE_COLOR_CHOOSER, ATSPI_ROLE_COLOR_CHOOSER },
+ { EFL_ACCESS_ROLE_COLUMN_HEADER, ATSPI_ROLE_COLUMN_HEADER },
+ { EFL_ACCESS_ROLE_COMBO_BOX, ATSPI_ROLE_COMBO_BOX },
+ { EFL_ACCESS_ROLE_DATE_EDITOR, ATSPI_ROLE_DATE_EDITOR },
+ { EFL_ACCESS_ROLE_DESKTOP_ICON, ATSPI_ROLE_DESKTOP_ICON },
+ { EFL_ACCESS_ROLE_DESKTOP_FRAME, ATSPI_ROLE_DESKTOP_FRAME },
+ { EFL_ACCESS_ROLE_DIAL, ATSPI_ROLE_DIAL },
+ { EFL_ACCESS_ROLE_DIALOG, ATSPI_ROLE_DIALOG },
+ { EFL_ACCESS_ROLE_DIRECTORY_PANE, ATSPI_ROLE_DIRECTORY_PANE },
+ { EFL_ACCESS_ROLE_DRAWING_AREA, ATSPI_ROLE_DRAWING_AREA },
+ { EFL_ACCESS_ROLE_FILE_CHOOSER, ATSPI_ROLE_FILE_CHOOSER },
+ { EFL_ACCESS_ROLE_FILLER, ATSPI_ROLE_FILLER },
+ { EFL_ACCESS_ROLE_FOCUS_TRAVERSABLE, ATSPI_ROLE_FOCUS_TRAVERSABLE },
+ { EFL_ACCESS_ROLE_FONT_CHOOSER, ATSPI_ROLE_FONT_CHOOSER },
+ { EFL_ACCESS_ROLE_FRAME, ATSPI_ROLE_FRAME },
+ { EFL_ACCESS_ROLE_GLASS_PANE, ATSPI_ROLE_GLASS_PANE },
+ { EFL_ACCESS_ROLE_HTML_CONTAINER, ATSPI_ROLE_HTML_CONTAINER },
+ { EFL_ACCESS_ROLE_ICON, ATSPI_ROLE_ICON },
+ { EFL_ACCESS_ROLE_IMAGE, ATSPI_ROLE_IMAGE },
+ { EFL_ACCESS_ROLE_INTERNAL_FRAME, ATSPI_ROLE_INTERNAL_FRAME },
+ { EFL_ACCESS_ROLE_LABEL, ATSPI_ROLE_LABEL },
+ { EFL_ACCESS_ROLE_LAYERED_PANE, ATSPI_ROLE_LAYERED_PANE },
+ { EFL_ACCESS_ROLE_LIST, ATSPI_ROLE_LIST },
+ { EFL_ACCESS_ROLE_LIST_ITEM, ATSPI_ROLE_LIST_ITEM },
+ { EFL_ACCESS_ROLE_MENU, ATSPI_ROLE_MENU },
+ { EFL_ACCESS_ROLE_MENU_BAR, ATSPI_ROLE_MENU_BAR },
+ { EFL_ACCESS_ROLE_MENU_ITEM, ATSPI_ROLE_MENU_ITEM },
+ { EFL_ACCESS_ROLE_OPTION_PANE, ATSPI_ROLE_OPTION_PANE },
+ { EFL_ACCESS_ROLE_PAGE_TAB, ATSPI_ROLE_PAGE_TAB },
+ { EFL_ACCESS_ROLE_PAGE_TAB_LIST, ATSPI_ROLE_PAGE_TAB_LIST },
+ { EFL_ACCESS_ROLE_PANEL, ATSPI_ROLE_PANEL },
+ { EFL_ACCESS_ROLE_PASSWORD_TEXT, ATSPI_ROLE_PASSWORD_TEXT },
+ { EFL_ACCESS_ROLE_POPUP_MENU, ATSPI_ROLE_POPUP_MENU },
+ { EFL_ACCESS_ROLE_PROGRESS_BAR, ATSPI_ROLE_PROGRESS_BAR },
+ { EFL_ACCESS_ROLE_PUSH_BUTTON, ATSPI_ROLE_PUSH_BUTTON },
+ { EFL_ACCESS_ROLE_RADIO_BUTTON, ATSPI_ROLE_RADIO_BUTTON },
+ { EFL_ACCESS_ROLE_RADIO_MENU_ITEM, ATSPI_ROLE_RADIO_MENU_ITEM },
+ { EFL_ACCESS_ROLE_ROOT_PANE, ATSPI_ROLE_ROOT_PANE },
+ { EFL_ACCESS_ROLE_ROW_HEADER, ATSPI_ROLE_ROW_HEADER },
+ { EFL_ACCESS_ROLE_SCROLL_BAR, ATSPI_ROLE_SCROLL_BAR },
+ { EFL_ACCESS_ROLE_SCROLL_PANE, ATSPI_ROLE_SCROLL_PANE },
+ { EFL_ACCESS_ROLE_SEPARATOR, ATSPI_ROLE_SEPARATOR },
+ { EFL_ACCESS_ROLE_SLIDER, ATSPI_ROLE_SLIDER },
+ { EFL_ACCESS_ROLE_SPIN_BUTTON, ATSPI_ROLE_SPIN_BUTTON },
+ { EFL_ACCESS_ROLE_SPLIT_PANE, ATSPI_ROLE_SPLIT_PANE },
+ { EFL_ACCESS_ROLE_STATUS_BAR, ATSPI_ROLE_STATUS_BAR },
+ { EFL_ACCESS_ROLE_TABLE, ATSPI_ROLE_TABLE },
+ { EFL_ACCESS_ROLE_TABLE_CELL, ATSPI_ROLE_TABLE_CELL },
+ { EFL_ACCESS_ROLE_TABLE_COLUMN_HEADER, ATSPI_ROLE_TABLE_COLUMN_HEADER },
+ { EFL_ACCESS_ROLE_TABLE_ROW_HEADER, ATSPI_ROLE_TABLE_ROW_HEADER },
+ { EFL_ACCESS_ROLE_TEAROFF_MENU_ITEM, ATSPI_ROLE_TEAROFF_MENU_ITEM },
+ { EFL_ACCESS_ROLE_TERMINAL, ATSPI_ROLE_TERMINAL },
+ { EFL_ACCESS_ROLE_TEXT, ATSPI_ROLE_TEXT },
+ { EFL_ACCESS_ROLE_TOGGLE_BUTTON, ATSPI_ROLE_TOGGLE_BUTTON },
+ { EFL_ACCESS_ROLE_TOOL_BAR, ATSPI_ROLE_TOOL_BAR },
+ { EFL_ACCESS_ROLE_TOOL_TIP, ATSPI_ROLE_TOOL_TIP },
+ { EFL_ACCESS_ROLE_TREE, ATSPI_ROLE_TREE },
+ { EFL_ACCESS_ROLE_TREE_TABLE, ATSPI_ROLE_TREE_TABLE },
+ { EFL_ACCESS_ROLE_UNKNOWN, ATSPI_ROLE_UNKNOWN },
+ { EFL_ACCESS_ROLE_VIEWPORT, ATSPI_ROLE_VIEWPORT },
+ { EFL_ACCESS_ROLE_WINDOW, ATSPI_ROLE_WINDOW },
+ { EFL_ACCESS_ROLE_EXTENDED, ATSPI_ROLE_EXTENDED },
+ { EFL_ACCESS_ROLE_HEADER, ATSPI_ROLE_HEADER },
+ { EFL_ACCESS_ROLE_FOOTER, ATSPI_ROLE_FOOTER },
+ { EFL_ACCESS_ROLE_PARAGRAPH, ATSPI_ROLE_PARAGRAPH },
+ { EFL_ACCESS_ROLE_RULER, ATSPI_ROLE_RULER },
+ { EFL_ACCESS_ROLE_APPLICATION, ATSPI_ROLE_APPLICATION },
+ { EFL_ACCESS_ROLE_AUTOCOMPLETE, ATSPI_ROLE_AUTOCOMPLETE },
+ { EFL_ACCESS_ROLE_EDITBAR, ATSPI_ROLE_EDITBAR },
+ { EFL_ACCESS_ROLE_EMBEDDED, ATSPI_ROLE_EMBEDDED },
+ { EFL_ACCESS_ROLE_ENTRY, ATSPI_ROLE_ENTRY },
+ { EFL_ACCESS_ROLE_CHART, ATSPI_ROLE_CHART },
+ { EFL_ACCESS_ROLE_CAPTION, ATSPI_ROLE_CAPTION },
+ { EFL_ACCESS_ROLE_DOCUMENT_FRAME, ATSPI_ROLE_DOCUMENT_FRAME },
+ { EFL_ACCESS_ROLE_HEADING, ATSPI_ROLE_HEADING },
+ { EFL_ACCESS_ROLE_PAGE, ATSPI_ROLE_PAGE },
+ { EFL_ACCESS_ROLE_SECTION, ATSPI_ROLE_SECTION },
+ { EFL_ACCESS_ROLE_REDUNDANT_OBJECT, ATSPI_ROLE_REDUNDANT_OBJECT },
+ { EFL_ACCESS_ROLE_FORM, ATSPI_ROLE_FORM },
+ { EFL_ACCESS_ROLE_LINK, ATSPI_ROLE_LINK },
+ { EFL_ACCESS_ROLE_INPUT_METHOD_WINDOW, ATSPI_ROLE_INPUT_METHOD_WINDOW },
+ { EFL_ACCESS_ROLE_TABLE_ROW, ATSPI_ROLE_TABLE_ROW },
+ { EFL_ACCESS_ROLE_TREE_ITEM, ATSPI_ROLE_TREE_ITEM },
+ { EFL_ACCESS_ROLE_DOCUMENT_SPREADSHEET, ATSPI_ROLE_DOCUMENT_SPREADSHEET },
+ { EFL_ACCESS_ROLE_DOCUMENT_PRESENTATION, ATSPI_ROLE_DOCUMENT_PRESENTATION },
+ { EFL_ACCESS_ROLE_DOCUMENT_TEXT, ATSPI_ROLE_DOCUMENT_TEXT },
+ { EFL_ACCESS_ROLE_DOCUMENT_WEB, ATSPI_ROLE_DOCUMENT_WEB },
+ { EFL_ACCESS_ROLE_DOCUMENT_EMAIL, ATSPI_ROLE_DOCUMENT_EMAIL },
+ { EFL_ACCESS_ROLE_COMMENT, ATSPI_ROLE_COMMENT },
+ { EFL_ACCESS_ROLE_LIST_BOX, ATSPI_ROLE_LIST_BOX },
+ { EFL_ACCESS_ROLE_GROUPING, ATSPI_ROLE_GROUPING },
+ { EFL_ACCESS_ROLE_IMAGE_MAP, ATSPI_ROLE_IMAGE_MAP },
+ { EFL_ACCESS_ROLE_NOTIFICATION, ATSPI_ROLE_NOTIFICATION },
+ { EFL_ACCESS_ROLE_INFO_BAR, ATSPI_ROLE_INFO_BAR },
+ { EFL_ACCESS_ROLE_LAST_DEFINED, ATSPI_ROLE_LAST_DEFINED },
+};
+
+static const int elm_relation_to_atspi_relation_mapping[] = {
+ [EFL_ACCESS_RELATION_NULL] = ATSPI_RELATION_NULL,
+ [EFL_ACCESS_RELATION_LABEL_FOR] = ATSPI_RELATION_LABEL_FOR,
+ [EFL_ACCESS_RELATION_LABELLED_BY] = ATSPI_RELATION_LABELLED_BY,
+ [EFL_ACCESS_RELATION_CONTROLLER_FOR] = ATSPI_RELATION_CONTROLLER_FOR,
+ [EFL_ACCESS_RELATION_CONTROLLED_BY] = ATSPI_RELATION_CONTROLLED_BY,
+ [EFL_ACCESS_RELATION_MEMBER_OF] = ATSPI_RELATION_MEMBER_OF,
+ [EFL_ACCESS_RELATION_TOOLTIP_FOR] = ATSPI_RELATION_TOOLTIP_FOR,
+ [EFL_ACCESS_RELATION_NODE_CHILD_OF] = ATSPI_RELATION_NODE_CHILD_OF,
+ [EFL_ACCESS_RELATION_NODE_PARENT_OF] = ATSPI_RELATION_NODE_PARENT_OF,
+ [EFL_ACCESS_RELATION_EXTENDED] = ATSPI_RELATION_EXTENDED,
+ [EFL_ACCESS_RELATION_FLOWS_TO] = ATSPI_RELATION_FLOWS_TO,
+ [EFL_ACCESS_RELATION_FLOWS_FROM] = ATSPI_RELATION_FLOWS_FROM,
+ [EFL_ACCESS_RELATION_SUBWINDOW_OF] = ATSPI_RELATION_SUBWINDOW_OF,
+ [EFL_ACCESS_RELATION_EMBEDS] = ATSPI_RELATION_EMBEDS,
+ [EFL_ACCESS_RELATION_EMBEDDED_BY] = ATSPI_RELATION_EMBEDDED_BY,
+ [EFL_ACCESS_RELATION_POPUP_FOR] = ATSPI_RELATION_POPUP_FOR,
+ [EFL_ACCESS_RELATION_PARENT_WINDOW_OF] = ATSPI_RELATION_PARENT_WINDOW_OF,
+ [EFL_ACCESS_RELATION_DESCRIPTION_FOR] = ATSPI_RELATION_DESCRIPTION_FOR,
+ [EFL_ACCESS_RELATION_DESCRIBED_BY] = ATSPI_RELATION_DESCRIBED_BY,
+ [EFL_ACCESS_RELATION_LAST_DEFINED] = ATSPI_RELATION_LAST_DEFINED,
+};
+
+static AtspiRelationType _elm_relation_to_atspi_relation(Efl_Access_Relation_Type type)
+{
+ if ((type < EFL_ACCESS_RELATION_LAST_DEFINED) && (type > EFL_ACCESS_RELATION_NULL))
+ return elm_relation_to_atspi_relation_mapping[type];
+ return ATSPI_RELATION_NULL;
+}
+
+struct atspi_state_desc
+{
+ Efl_Access_State_Type elm_state;
+ AtspiStateType atspi_state;
+ const char *name;
+};
+
+static const struct atspi_state_desc elm_states_to_atspi_state[] = {
+ { EFL_ACCESS_STATE_INVALID, ATSPI_STATE_INVALID, "invalid" },
+ { EFL_ACCESS_STATE_ACTIVE, ATSPI_STATE_ACTIVE, "active" },
+ { EFL_ACCESS_STATE_ARMED, ATSPI_STATE_ARMED, "armed" },
+ { EFL_ACCESS_STATE_BUSY, ATSPI_STATE_BUSY, "busy" },
+ { EFL_ACCESS_STATE_CHECKED, ATSPI_STATE_CHECKED, "checked" },
+ { EFL_ACCESS_STATE_COLLAPSED, ATSPI_STATE_COLLAPSED, "collapsed" },
+ { EFL_ACCESS_STATE_DEFUNCT, ATSPI_STATE_DEFUNCT, "defunct" },
+ { EFL_ACCESS_STATE_EDITABLE, ATSPI_STATE_EDITABLE, "editable" },
+ { EFL_ACCESS_STATE_ENABLED, ATSPI_STATE_ENABLED, "enabled" },
+ { EFL_ACCESS_STATE_EXPANDABLE, ATSPI_STATE_EXPANDABLE, "expandable" },
+ { EFL_ACCESS_STATE_EXPANDED, ATSPI_STATE_EXPANDED, "expanded" },
+ { EFL_ACCESS_STATE_FOCUSABLE, ATSPI_STATE_FOCUSABLE, "focusable" },
+ { EFL_ACCESS_STATE_FOCUSED, ATSPI_STATE_FOCUSED, "focused" },
+ { EFL_ACCESS_STATE_HAS_TOOLTIP, ATSPI_STATE_HAS_TOOLTIP, "has-tooltip" },
+ { EFL_ACCESS_STATE_HORIZONTAL, ATSPI_STATE_HORIZONTAL, "horizontal" },
+ { EFL_ACCESS_STATE_ICONIFIED, ATSPI_STATE_ICONIFIED, "iconified" },
+ { EFL_ACCESS_STATE_MODAL, ATSPI_STATE_MODAL, "modal" },
+ { EFL_ACCESS_STATE_MULTI_LINE, ATSPI_STATE_MULTI_LINE, "multi-line" },
+ { EFL_ACCESS_STATE_MULTISELECTABLE, ATSPI_STATE_MULTISELECTABLE, "multiselectable" },
+ { EFL_ACCESS_STATE_OPAQUE, ATSPI_STATE_OPAQUE, "opaque" },
+ { EFL_ACCESS_STATE_PRESSED, ATSPI_STATE_PRESSED, "pressed" },
+ { EFL_ACCESS_STATE_RESIZABLE, ATSPI_STATE_RESIZABLE, "resizable" },
+ { EFL_ACCESS_STATE_SELECTABLE, ATSPI_STATE_SELECTABLE, "selectable" },
+ { EFL_ACCESS_STATE_SELECTED, ATSPI_STATE_SELECTED, "selected" },
+ { EFL_ACCESS_STATE_SENSITIVE, ATSPI_STATE_SENSITIVE, "sensitive" },
+ { EFL_ACCESS_STATE_SHOWING, ATSPI_STATE_SHOWING, "showing" },
+ { EFL_ACCESS_STATE_SINGLE_LINE, ATSPI_STATE_SINGLE_LINE, "single-line" },
+ { EFL_ACCESS_STATE_STALE, ATSPI_STATE_STALE, "stale" },
+ { EFL_ACCESS_STATE_TRANSIENT, ATSPI_STATE_TRANSIENT, "transient" },
+ { EFL_ACCESS_STATE_VERTICAL, ATSPI_STATE_VERTICAL, "vertical" },
+ { EFL_ACCESS_STATE_VISIBLE, ATSPI_STATE_VISIBLE, "visible" },
+ { EFL_ACCESS_STATE_MANAGES_DESCENDANTS, ATSPI_STATE_MANAGES_DESCENDANTS, "manages-descendants" },
+ { EFL_ACCESS_STATE_INDETERMINATE, ATSPI_STATE_INDETERMINATE, "indeterminate" },
+ { EFL_ACCESS_STATE_REQUIRED, ATSPI_STATE_REQUIRED, "required" },
+ { EFL_ACCESS_STATE_TRUNCATED, ATSPI_STATE_TRUNCATED, "truncated" },
+ { EFL_ACCESS_STATE_ANIMATED, ATSPI_STATE_ANIMATED, "animated" },
+ { EFL_ACCESS_STATE_INVALID_ENTRY, ATSPI_STATE_INVALID_ENTRY, "invalid-entry" },
+ { EFL_ACCESS_STATE_SUPPORTS_AUTOCOMPLETION, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION, "supports-autocompletion" },
+ { EFL_ACCESS_STATE_SELECTABLE_TEXT, ATSPI_STATE_SELECTABLE_TEXT, "selectable-text" },
+ { EFL_ACCESS_STATE_IS_DEFAULT, ATSPI_STATE_IS_DEFAULT, "is-default" },
+ { EFL_ACCESS_STATE_VISITED, ATSPI_STATE_VISITED, "visited" },
+ { EFL_ACCESS_STATE_LAST_DEFINED, ATSPI_STATE_LAST_DEFINED, "last-defined" },
+};
+
+static uint64_t
+_elm_atspi_state_set_to_atspi_state_set(Efl_Access_State_Set states)
+{
+ uint64_t ret = 0;
+ unsigned int i = 0;
+
+ for (i = 0; i < SIZE(elm_states_to_atspi_state); i++)
+ {
+ if (STATE_TYPE_GET(states, elm_states_to_atspi_state[i].elm_state))
+ STATE_TYPE_SET(ret, elm_states_to_atspi_state[i].atspi_state);
+ }
+ return ret;
+}
+
+static Eldbus_Message*
+_accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eldbus_Message *ret;
+ Eldbus_Message_Iter *iter, *iter_array;
+ Efl_Access_State_Set states;
+ uint64_t atspi_states = 0;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ iter = eldbus_message_iter_get(ret);
+ iter_array = eldbus_message_iter_container_new(iter, 'a', "u");
+ EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
+
+ states = efl_access_state_set_get(obj);
+
+ atspi_states = _elm_atspi_state_set_to_atspi_state_set(states);
+
+ unsigned int s1 = atspi_states & 0xFFFFFFFF;
+ unsigned int s2 = (atspi_states >> 32) & 0xFFFFFFFF;
+
+ eldbus_message_iter_basic_append(iter_array, 'u', s1);
+ eldbus_message_iter_basic_append(iter_array, 'u', s2);
+ eldbus_message_iter_container_close(iter, iter_array);
+
+ return ret;
+
+fail:
+ if (ret) eldbus_message_unref(ret);
+ return NULL;
+}
+
+static Eldbus_Message *
+_accessible_get_index_in_parent(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *ret;
+ int idx = -1;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ idx = efl_access_index_in_parent_get(obj);
+
+ eldbus_message_arguments_append(ret, "i", idx);
+
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_child_at_index(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eo *child = NULL;
+ Eina_List *children = NULL;
+ int idx;
+ Eldbus_Message *ret;
+ Eldbus_Message_Iter *iter;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ if (!eldbus_message_arguments_get(msg, "i", &idx))
+ return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ iter = eldbus_message_iter_get(ret);
+ children = efl_access_children_get(obj);
+ child = eina_list_nth(children, idx);
+
+ eldbus_message_iter_efl_access_reference_append(iter, eldbus_service_connection_get(iface), child);
+ eina_list_free(children);
+
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_get_relation_set(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eo *rel_obj;
+ Eldbus_Message *ret = NULL;
+ Eldbus_Message_Iter *iter = NULL, *iter_array = NULL, *iter_array2 = NULL, *iter_struct;
+ Efl_Access_Relation *rel;
+ Eina_List *l, *l2;
+ Efl_Access_Relation_Set rels;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ iter = eldbus_message_iter_get(ret);
+ iter_array = eldbus_message_iter_container_new(iter, 'a', "(ua(so))");
+ EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
+
+ rels = efl_access_relation_set_get(obj);
+
+ EINA_LIST_FOREACH(rels, l, rel)
+ {
+ iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
+ eldbus_message_iter_basic_append(iter_struct, 'u', _elm_relation_to_atspi_relation(rel->type));
+ eldbus_message_iter_efl_access_reference_array_append(iter_struct, eldbus_service_connection_get(iface), rel->objects);
+ eldbus_message_iter_container_close(iter_array, iter_struct);
+ }
+ efl_access_relation_set_free(rels);
+ eldbus_message_iter_container_close(iter, iter_array);
+
+ return ret;
+
+fail:
+ eldbus_message_unref(ret);
+ return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Unable to get relation set.");
+}
+
+static Eldbus_Message *
+_accessible_get_role(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ AtspiRole atspi_role = ATSPI_ROLE_INVALID;
+ Efl_Access_Role role;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ role = efl_access_role_get(obj);
+
+ Eldbus_Message *ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ atspi_role = role > EFL_ACCESS_ROLE_LAST_DEFINED ? ATSPI_ROLE_LAST_DEFINED : elm_roles_to_atspi_roles[role][1];
+ eldbus_message_arguments_append(ret, "u", atspi_role);
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_get_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ const char *role_name = efl_access_role_name_get(obj);
+
+ Eldbus_Message *ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+ eldbus_message_arguments_append(ret, "s", role_name);
+
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_get_localized_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ const char *l_role_name = efl_access_localized_role_name_get(obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(l_role_name, NULL);
+
+ Eldbus_Message *ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+ eldbus_message_arguments_append(ret, "s", l_role_name);
+
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_get_children(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eina_List *children_list = NULL, *l;
+ Eldbus_Message *ret;
+ Eldbus_Message_Iter *iter, *iter_array;
+ Eo *child;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ children_list = efl_access_children_get(obj);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ iter = eldbus_message_iter_get(ret);
+ eldbus_message_iter_efl_access_reference_array_append(iter, eldbus_service_connection_get(iface), children_list);
+ eina_list_free(children_list);
+
+ return ret;
+
+fail:
+ if (ret) eldbus_message_unref(ret);
+ return NULL;
+}
+
+static Eldbus_Message *
+_accessible_get_application(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eo *root;
+ Eldbus_Message *ret;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ Eldbus_Message_Iter *iter = eldbus_message_iter_get(ret);
+ root = efl_access_root_get(EFL_ACCESS_MIXIN);
+ eldbus_message_iter_efl_access_reference_append(iter, eldbus_service_connection_get(iface), root);
+
+ return ret;
+}
+
+static Eldbus_Message *
+_accessible_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eina_List *attrs = NULL, *l;
+ Efl_Access_Attribute *attr;
+ Eldbus_Message_Iter *iter, *iter_dict = NULL, *iter_entry;
+ Eldbus_Message *ret;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ if (!ret) goto error;
+
+ attrs = efl_access_attributes_get(obj);
+
+ iter = eldbus_message_iter_get(ret);
+ if (!iter) goto error;
+
+ iter_dict = eldbus_message_iter_container_new(iter, 'a', "{ss}");
+ if (!iter_dict) goto error;
+
+ EINA_LIST_FOREACH(attrs, l, attr)
+ {
+ iter_entry = eldbus_message_iter_container_new(iter_dict, 'e', NULL);
+ if (!iter_entry) goto error;
+ eldbus_message_iter_arguments_append(iter_entry, "ss", attr->key, attr->value);
+ eldbus_message_iter_container_close(iter_dict, iter_entry);
+ }
+
+ eldbus_message_iter_container_close(iter, iter_dict);
+ efl_access_attributes_list_free(attrs);
+ return ret;
+
+error:
+ if (iter_dict) eldbus_message_iter_container_close(iter, iter_dict);
+ if (ret) eldbus_message_unref(ret);
+ efl_access_attributes_list_free(attrs);
+ return NULL;
+}
+
+static Eldbus_Message *
+_accessible_interfaces_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ Eldbus_Message *ret;
+ Eldbus_Message_Iter *iter;
+
+ Efl_Access *obj = efl_access_unmarshal(msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
+
+ ret = eldbus_message_method_return_new(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
+
+ iter = eldbus_message_iter_get(ret);
+ eldbus_message_iter_efl_access_interfaces_append(iter, obj);
+
+ return ret;
+}
+
+static const Eldbus_Method accessible_methods[] = {
+ { "GetChildAtIndex", ELDBUS_ARGS({"i", "index"}), ELDBUS_ARGS({"(so)", "Accessible"}), _accessible_child_at_index, 0 },
+ { "GetChildren", NULL, ELDBUS_ARGS({"a(so)", "children"}), _accessible_get_children, 0 },
+ { "GetIndexInParent", NULL, ELDBUS_ARGS({"i", "index"}), _accessible_get_index_in_parent, 0 },
+ { "GetRelationSet", NULL, ELDBUS_ARGS({"a(ua(so))", NULL}), _accessible_get_relation_set, 0 },
+ { "GetRole", NULL, ELDBUS_ARGS({"u", "Role"}), _accessible_get_role, 0 },
+ { "GetRoleName", NULL, ELDBUS_ARGS({"s", "Name"}), _accessible_get_role_name, 0 },
+ { "GetLocalizedRoleName", NULL, ELDBUS_ARGS({"s", "LocalizedName"}), _accessible_get_localized_role_name, 0},
+ { "GetState", NULL, ELDBUS_ARGS({"au", NULL}), _accessible_get_state, 0},
+ { "GetApplication", NULL, ELDBUS_ARGS({"(so)", NULL}), _accessible_get_application, 0},
+ { "GetAttributes", NULL, ELDBUS_ARGS({"a{ss}", NULL}), _accessible_attributes_get, 0},
+ { "GetInterfaces", NULL, ELDBUS_ARGS({"as", NULL}), _accessible_interfaces_get, 0},
+ { NULL, NULL, NULL, NULL, 0 }
+};
+
+static Eina_Bool
+_accessible_property_get(const Eldbus_Service_Interface *interface, const char *property,
+ Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg,
+ Eldbus_Message **error)
+{
+ const char *ret = NULL;
+ Eo *ret_obj = NULL;
+
+ Efl_Access *obj = efl_access_unmarshal(request_msg);
+ ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, request_msg, error);
+
+ if (!strcmp(property, "Name"))
+ {
+ ret = efl_access_name_get(obj);
+ if (!ret)
+ ret = "";
+ eldbus_message_iter_basic_append(iter, 's', ret);
+ return EINA_TRUE;
+ }
+ else if (!strcmp(property, "Description"))
+ {
+ ret = efl_access_description_get(obj);
+ if (!ret)
+ ret = "";
+ eldbus_message_iter_basic_append(iter, 's', ret);
+ return EINA_TRUE;
+ }
+ else if (!strcmp(property, "Parent"))
+ {
+ ret_obj = efl_access_parent_get(obj);
+ eldbus_message_iter_efl_access_reference_append(iter, eldbus_service_connection_get(interface), ret_obj);
+ return EINA_TRUE;
+ }
+ else if (!strcmp(property, "ChildCount"))
+ {
+ Eina_List *l = NULL;
+ l = efl_access_children_get(obj);
+ eldbus_message_iter_basic_append(iter, 'i', eina_list_count(l));
+ eina_list_free(l);
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+static const Eldbus_Property accessible_properties[] = {
+ { "Name", "s", NULL, NULL, 0 },
+ { "Description", "s", NULL, NULL, 0 },
+ { "Parent", "(so)", NULL, NULL, 0 },
+ { "ChildCount", "i", NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, 0 }
+};
+
+static const Eldbus_Service_Interface_Desc accessible_iface_desc = {
+ ATSPI_DBUS_INTERFACE_ACCESSIBLE,
+ accessible_methods,
+ NULL,
+ accessible_properties,
+ _accessible_property_get,
+ NULL
+};
+
+Eldbus_Service_Interface*
+_elm_atspi_access_adaptor_register(Eldbus_Connection *conn)
+{
+ return eldbus_service_interface_fallback_register(conn, ELM_ACCESS_OBJECT_PATH_PREFIX2, &accessible_iface_desc);
+}
diff --git a/src/lib/elementary/elm_atspi_access_adaptor.h b/src/lib/elementary/elm_atspi_access_adaptor.h
new file mode 100644
index 0000000000..cf21f6d7d0
--- /dev/null
+++ b/src/lib/elementary/elm_atspi_access_adaptor.h
@@ -0,0 +1,6 @@
+#ifndef ELM_ATSPI_ACCESS_ADAPTOR
+#define ELM_ATSPI_ACCESS_ADAPTOR
+
+static Eldbus_Service_Interface* _elm_atspi_access_adaptor_register(Eldbus_Connection *conn);
+
+#endif
diff --git a/src/lib/elementary/elm_atspi_access_adaptor_private.h b/src/lib/elementary/elm_atspi_access_adaptor_private.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/lib/elementary/elm_atspi_access_adaptor_private.h
diff --git a/src/lib/elementary/elm_atspi_adaptor_common.c b/src/lib/elementary/elm_atspi_adaptor_common.c
new file mode 100644
index 0000000000..a0dc2edab8
--- /dev/null
+++ b/src/lib/elementary/elm_atspi_adaptor_common.c
@@ -0,0 +1,104 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define EFL_ACCESS_PROTECTED
+
+#include <Elementary.h>
+#include "atspi/atspi-constants.h"
+#include "elm_priv.h"
+#include "elm_atspi_adaptor_common.h"
+
+#define ELM_ACCESS_OBJECT_PATH_PREFIX "/org/a11y/atspi/accessible/"
+#define ELM_ACCESS_OBJECT_REFERENCE_TEMPLATE ELM_ACCESS_OBJECT_PATH_PREFIX "%llu"
+#define ELM_ACCESS_OBJECT_PATH_ROOT "root"
+
+Efl_Access*
+efl_access_unmarshal(const Eldbus_Message *msg)
+{
+ return NULL;
+}
+
+void
+efl_access_marshal(Efl_Access *obj, Eldbus_Message_Iter *iter)
+{
+}
+
+static const char*
+_path_from_object(const Eo *eo)
+{
+ static char path[64];
+
+ if (!eo)
+ return ATSPI_DBUS_PATH_NULL;
+
+ if (eo == efl_access_root_get(EFL_ACCESS_MIXIN))
+ snprintf(path, sizeof(path), "%s%s", ELM_ACCESS_OBJECT_PATH_PREFIX, ELM_ACCESS_OBJECT_PATH_ROOT);
+ else
+ snprintf(path, sizeof(path), ELM_ACCESS_OBJECT_REFERENCE_TEMPLATE, (unsigned long long)(uintptr_t)eo);
+
+ return path;
+}
+
+void
+eldbus_message_iter_efl_access_reference_append(Eldbus_Message_Iter *iter, Eldbus_Connection *conn, Efl_Access *obj)
+{
+ EINA_SAFETY_ON_NULL_RETURN(iter);
+ EINA_SAFETY_ON_NULL_RETURN(conn);
+
+ Eldbus_Message_Iter *iter_struct = eldbus_message_iter_container_new(iter, 'r', NULL);
+ if (!iter_struct) return;
+
+ eldbus_message_iter_basic_append(iter_struct, 's', eldbus_connection_unique_name_get(conn));
+ eldbus_message_iter_basic_append(iter_struct, 'o', _path_from_object(obj));
+ eldbus_message_iter_container_close(iter, iter_struct);
+}
+
+void
+eldbus_message_iter_efl_access_reference_array_append(Eldbus_Message_Iter *iter, Eldbus_Connection *conn, Eina_List *obj_list)
+{
+ Eina_List *l;
+ Efl_Access *obj;
+
+ EINA_SAFETY_ON_NULL_RETURN(iter);
+ EINA_SAFETY_ON_NULL_RETURN(conn);
+
+ Eldbus_Message_Iter *iter_array = eldbus_message_iter_container_new(iter, 'a', "(so)");
+ if (!iter_array) return;
+
+ EINA_LIST_FOREACH(obj_list, l, obj)
+ eldbus_message_iter_efl_access_reference_append(iter_array, conn, obj);
+
+ eldbus_message_iter_container_close(iter, iter_array);
+}
+
+void
+eldbus_message_iter_efl_access_interfaces_append(Eldbus_Message_Iter *iter, Efl_Access *obj)
+{
+ Eldbus_Message_Iter *iter_array = eldbus_message_iter_container_new(iter, 'a', "s");
+ if (!iter_array) return;
+
+ if (efl_isa(obj, EFL_ACCESS_MIXIN))
+ {
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_ACCESSIBLE);
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COLLECTION);
+ }
+ if (efl_isa(obj, EFL_ACCESS_ACTION_MIXIN))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_ACTION);
+ if (efl_isa(obj, ELM_ATSPI_APP_OBJECT_CLASS))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_APPLICATION);
+ if (efl_isa(obj, EFL_ACCESS_COMPONENT_MIXIN))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COMPONENT);
+ if (efl_isa(obj, EFL_ACCESS_EDITABLE_TEXT_INTERFACE))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_EDITABLE_TEXT);
+ if (efl_isa(obj, EFL_ACCESS_IMAGE_MIXIN))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_IMAGE);
+ if (efl_isa(obj, EFL_ACCESS_SELECTION_INTERFACE))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_SELECTION);
+ if (efl_isa(obj, EFL_ACCESS_TEXT_INTERFACE))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_TEXT);
+ if (efl_isa(obj, EFL_ACCESS_VALUE_INTERFACE))
+ eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_VALUE);
+
+ eldbus_message_iter_container_close(iter, iter_array);
+}
diff --git a/src/lib/elementary/elm_atspi_adaptor_common.h b/src/lib/elementary/elm_atspi_adaptor_common.h
new file mode 100644
index 0000000000..2d92468d0a
--- /dev/null
+++ b/src/lib/elementary/elm_atspi_adaptor_common.h
@@ -0,0 +1,35 @@
+
+#define ELM_ACCESS_OBJECT_PATH_PREFIX2 "/org/a11y/atspi/accessible"
+
+#define ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, class, msg, error) \
+ if (!(obj) || !efl_isa(obj, class)) \
+ { \
+ *(error) = _dbus_invalid_ref_error_new(msg); \
+ return EINA_FALSE; \
+ }
+
+#define ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, class, msg, error) \
+ if (!(obj) || !efl_isa(obj, class)) \
+ { \
+ *(error) = _dbus_invalid_ref_error_new(msg); \
+ return EINA_FALSE; \
+ }
+
+#define ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, class, msg) \
+ if (!(obj) || !efl_isa(obj, class)) \
+ return _dbus_invalid_ref_error_new(msg);
+
+static inline Eldbus_Message *_dbus_invalid_ref_error_new(const Eldbus_Message *msg)
+{
+ return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.UnknownObject", "Path is not valid accessible object reference.");
+}
+
+Efl_Access* efl_access_unmarshal(const Eldbus_Message *msg);
+
+void efl_access_marshal(Efl_Access *obj, Eldbus_Message_Iter *iter);
+
+void eldbus_message_iter_efl_access_reference_append(Eldbus_Message_Iter *iter, Eldbus_Connection *conn, Efl_Access *obj);
+
+void eldbus_message_iter_efl_access_interfaces_append(Eldbus_Message_Iter *iter, Efl_Access *obj);
+
+void eldbus_message_iter_efl_access_reference_array_append(Eldbus_Message_Iter *iter, Eldbus_Connection *conn, Eina_List *obj);
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index 2de63c7487..01d60125bb 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -18,6 +18,8 @@
#include <stdint.h>
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_atspi_access_adaptor.h"
+#include "elm_atspi_adaptor_common.h"
/*
* Accessibility Bus info not defined in atspi-constants.h
@@ -35,7 +37,6 @@
#define ELM_ACCESS_OBJECT_PATH_ROOT "root"
#define ELM_ACCESS_OBJECT_PATH_PREFIX "/org/a11y/atspi/accessible/"
-#define ELM_ACCESS_OBJECT_PATH_PREFIX2 "/org/a11y/atspi/accessible"
#define ELM_ACCESS_OBJECT_REFERENCE_TEMPLATE ELM_ACCESS_OBJECT_PATH_PREFIX "%llu"
#define SIZE(x) sizeof(x)/sizeof(x[0])
@@ -49,16 +50,6 @@
Elm_Atspi_Bridge_Data *sd = efl_data_scope_get(obj, ELM_ATSPI_BRIDGE_CLASS); \
if (!sd) return val;
-#define ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, class, msg, error) \
- if (!(obj) || !efl_isa(obj, class)) \
- { \
- *(error) = _dbus_invalid_ref_error_new(msg); \
- return EINA_FALSE; \
- }
-
-#define ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, class, msg) \
- if (!(obj) || !efl_isa(obj, class)) \
- return _dbus_invalid_ref_error_new(msg);
typedef struct Key_Event_Info {
Ecore_Event_Key event;
@@ -290,395 +281,6 @@ static const Eldbus_Signal _window_obj_signals[] = {
{NULL, ELDBUS_ARGS({NULL, NULL}), 0}
};
-static const int elm_roles_to_atspi_roles[][2] = {
- { EFL_ACCESS_ROLE_INVALID, ATSPI_ROLE_INVALID },
- { EFL_ACCESS_ROLE_ACCELERATOR_LABEL, ATSPI_ROLE_ACCELERATOR_LABEL },
- { EFL_ACCESS_ROLE_ALERT, ATSPI_ROLE_ALERT },
- { EFL_ACCESS_ROLE_ANIMATION, ATSPI_ROLE_ANIMATION },
- { EFL_ACCESS_ROLE_ARROW, ATSPI_ROLE_ARROW },
- { EFL_ACCESS_ROLE_CALENDAR, ATSPI_ROLE_CALENDAR },
- { EFL_ACCESS_ROLE_CANVAS, ATSPI_ROLE_CANVAS },
- { EFL_ACCESS_ROLE_CHECK_BOX, ATSPI_ROLE_CHECK_BOX },
- { EFL_ACCESS_ROLE_CHECK_MENU_ITEM, ATSPI_ROLE_CHECK_MENU_ITEM },
- { EFL_ACCESS_ROLE_COLOR_CHOOSER, ATSPI_ROLE_COLOR_CHOOSER },
- { EFL_ACCESS_ROLE_COLUMN_HEADER, ATSPI_ROLE_COLUMN_HEADER },
- { EFL_ACCESS_ROLE_COMBO_BOX, ATSPI_ROLE_COMBO_BOX },
- { EFL_ACCESS_ROLE_DATE_EDITOR, ATSPI_ROLE_DATE_EDITOR },
- { EFL_ACCESS_ROLE_DESKTOP_ICON, ATSPI_ROLE_DESKTOP_ICON },
- { EFL_ACCESS_ROLE_DESKTOP_FRAME, ATSPI_ROLE_DESKTOP_FRAME },
- { EFL_ACCESS_ROLE_DIAL, ATSPI_ROLE_DIAL },
- { EFL_ACCESS_ROLE_DIALOG, ATSPI_ROLE_DIALOG },
- { EFL_ACCESS_ROLE_DIRECTORY_PANE, ATSPI_ROLE_DIRECTORY_PANE },
- { EFL_ACCESS_ROLE_DRAWING_AREA, ATSPI_ROLE_DRAWING_AREA },
- { EFL_ACCESS_ROLE_FILE_CHOOSER, ATSPI_ROLE_FILE_CHOOSER },
- { EFL_ACCESS_ROLE_FILLER, ATSPI_ROLE_FILLER },
- { EFL_ACCESS_ROLE_FOCUS_TRAVERSABLE, ATSPI_ROLE_FOCUS_TRAVERSABLE },
- { EFL_ACCESS_ROLE_FONT_CHOOSER, ATSPI_ROLE_FONT_CHOOSER },
- { EFL_ACCESS_ROLE_FRAME, ATSPI_ROLE_FRAME },
- { EFL_ACCESS_ROLE_GLASS_PANE, ATSPI_ROLE_GLASS_PANE },
- { EFL_ACCESS_ROLE_HTML_CONTAINER, ATSPI_ROLE_HTML_CONTAINER },
- { EFL_ACCESS_ROLE_ICON, ATSPI_ROLE_ICON },
- { EFL_ACCESS_ROLE_IMAGE, ATSPI_ROLE_IMAGE },
- { EFL_ACCESS_ROLE_INTERNAL_FRAME, ATSPI_ROLE_INTERNAL_FRAME },
- { EFL_ACCESS_ROLE_LABEL, ATSPI_ROLE_LABEL },
- { EFL_ACCESS_ROLE_LAYERED_PANE, ATSPI_ROLE_LAYERED_PANE },
- { EFL_ACCESS_ROLE_LIST, ATSPI_ROLE_LIST },
- { EFL_ACCESS_ROLE_LIST_ITEM, ATSPI_ROLE_LIST_ITEM },
- { EFL_ACCESS_ROLE_MENU, ATSPI_ROLE_MENU },
- { EFL_ACCESS_ROLE_MENU_BAR, ATSPI_ROLE_MENU_BAR },
- { EFL_ACCESS_ROLE_MENU_ITEM, ATSPI_ROLE_MENU_ITEM },
- { EFL_ACCESS_ROLE_OPTION_PANE, ATSPI_ROLE_OPTION_PANE },
- { EFL_ACCESS_ROLE_PAGE_TAB, ATSPI_ROLE_PAGE_TAB },
- { EFL_ACCESS_ROLE_PAGE_TAB_LIST, ATSPI_ROLE_PAGE_TAB_LIST },
- { EFL_ACCESS_ROLE_PANEL, ATSPI_ROLE_PANEL },
- { EFL_ACCESS_ROLE_PASSWORD_TEXT, ATSPI_ROLE_PASSWORD_TEXT },
- { EFL_ACCESS_ROLE_POPUP_MENU, ATSPI_ROLE_POPUP_MENU },
- { EFL_ACCESS_ROLE_PROGRESS_BAR, ATSPI_ROLE_PROGRESS_BAR },
- { EFL_ACCESS_ROLE_PUSH_BUTTON, ATSPI_ROLE_PUSH_BUTTON },
- { EFL_ACCESS_ROLE_RADIO_BUTTON, ATSPI_ROLE_RADIO_BUTTON },
- { EFL_ACCESS_ROLE_RADIO_MENU_ITEM, ATSPI_ROLE_RADIO_MENU_ITEM },
- { EFL_ACCESS_ROLE_ROOT_PANE, ATSPI_ROLE_ROOT_PANE },
- { EFL_ACCESS_ROLE_ROW_HEADER, ATSPI_ROLE_ROW_HEADER },
- { EFL_ACCESS_ROLE_SCROLL_BAR, ATSPI_ROLE_SCROLL_BAR },
- { EFL_ACCESS_ROLE_SCROLL_PANE, ATSPI_ROLE_SCROLL_PANE },
- { EFL_ACCESS_ROLE_SEPARATOR, ATSPI_ROLE_SEPARATOR },
- { EFL_ACCESS_ROLE_SLIDER, ATSPI_ROLE_SLIDER },
- { EFL_ACCESS_ROLE_SPIN_BUTTON, ATSPI_ROLE_SPIN_BUTTON },
- { EFL_ACCESS_ROLE_SPLIT_PANE, ATSPI_ROLE_SPLIT_PANE },
- { EFL_ACCESS_ROLE_STATUS_BAR, ATSPI_ROLE_STATUS_BAR },
- { EFL_ACCESS_ROLE_TABLE, ATSPI_ROLE_TABLE },
- { EFL_ACCESS_ROLE_TABLE_CELL, ATSPI_ROLE_TABLE_CELL },
- { EFL_ACCESS_ROLE_TABLE_COLUMN_HEADER, ATSPI_ROLE_TABLE_COLUMN_HEADER },
- { EFL_ACCESS_ROLE_TABLE_ROW_HEADER, ATSPI_ROLE_TABLE_ROW_HEADER },
- { EFL_ACCESS_ROLE_TEAROFF_MENU_ITEM, ATSPI_ROLE_TEAROFF_MENU_ITEM },
- { EFL_ACCESS_ROLE_TERMINAL, ATSPI_ROLE_TERMINAL },
- { EFL_ACCESS_ROLE_TEXT, ATSPI_ROLE_TEXT },
- { EFL_ACCESS_ROLE_TOGGLE_BUTTON, ATSPI_ROLE_TOGGLE_BUTTON },
- { EFL_ACCESS_ROLE_TOOL_BAR, ATSPI_ROLE_TOOL_BAR },
- { EFL_ACCESS_ROLE_TOOL_TIP, ATSPI_ROLE_TOOL_TIP },
- { EFL_ACCESS_ROLE_TREE, ATSPI_ROLE_TREE },
- { EFL_ACCESS_ROLE_TREE_TABLE, ATSPI_ROLE_TREE_TABLE },
- { EFL_ACCESS_ROLE_UNKNOWN, ATSPI_ROLE_UNKNOWN },
- { EFL_ACCESS_ROLE_VIEWPORT, ATSPI_ROLE_VIEWPORT },
- { EFL_ACCESS_ROLE_WINDOW, ATSPI_ROLE_WINDOW },
- { EFL_ACCESS_ROLE_EXTENDED, ATSPI_ROLE_EXTENDED },
- { EFL_ACCESS_ROLE_HEADER, ATSPI_ROLE_HEADER },
- { EFL_ACCESS_ROLE_FOOTER, ATSPI_ROLE_FOOTER },
- { EFL_ACCESS_ROLE_PARAGRAPH, ATSPI_ROLE_PARAGRAPH },
- { EFL_ACCESS_ROLE_RULER, ATSPI_ROLE_RULER },
- { EFL_ACCESS_ROLE_APPLICATION, ATSPI_ROLE_APPLICATION },
- { EFL_ACCESS_ROLE_AUTOCOMPLETE, ATSPI_ROLE_AUTOCOMPLETE },
- { EFL_ACCESS_ROLE_EDITBAR, ATSPI_ROLE_EDITBAR },
- { EFL_ACCESS_ROLE_EMBEDDED, ATSPI_ROLE_EMBEDDED },
- { EFL_ACCESS_ROLE_ENTRY, ATSPI_ROLE_ENTRY },
- { EFL_ACCESS_ROLE_CHART, ATSPI_ROLE_CHART },
- { EFL_ACCESS_ROLE_CAPTION, ATSPI_ROLE_CAPTION },
- { EFL_ACCESS_ROLE_DOCUMENT_FRAME, ATSPI_ROLE_DOCUMENT_FRAME },
- { EFL_ACCESS_ROLE_HEADING, ATSPI_ROLE_HEADING },
- { EFL_ACCESS_ROLE_PAGE, ATSPI_ROLE_PAGE },
- { EFL_ACCESS_ROLE_SECTION, ATSPI_ROLE_SECTION },
- { EFL_ACCESS_ROLE_REDUNDANT_OBJECT, ATSPI_ROLE_REDUNDANT_OBJECT },
- { EFL_ACCESS_ROLE_FORM, ATSPI_ROLE_FORM },
- { EFL_ACCESS_ROLE_LINK, ATSPI_ROLE_LINK },
- { EFL_ACCESS_ROLE_INPUT_METHOD_WINDOW, ATSPI_ROLE_INPUT_METHOD_WINDOW },
- { EFL_ACCESS_ROLE_TABLE_ROW, ATSPI_ROLE_TABLE_ROW },
- { EFL_ACCESS_ROLE_TREE_ITEM, ATSPI_ROLE_TREE_ITEM },
- { EFL_ACCESS_ROLE_DOCUMENT_SPREADSHEET, ATSPI_ROLE_DOCUMENT_SPREADSHEET },
- { EFL_ACCESS_ROLE_DOCUMENT_PRESENTATION, ATSPI_ROLE_DOCUMENT_PRESENTATION },
- { EFL_ACCESS_ROLE_DOCUMENT_TEXT, ATSPI_ROLE_DOCUMENT_TEXT },
- { EFL_ACCESS_ROLE_DOCUMENT_WEB, ATSPI_ROLE_DOCUMENT_WEB },
- { EFL_ACCESS_ROLE_DOCUMENT_EMAIL, ATSPI_ROLE_DOCUMENT_EMAIL },
- { EFL_ACCESS_ROLE_COMMENT, ATSPI_ROLE_COMMENT },
- { EFL_ACCESS_ROLE_LIST_BOX, ATSPI_ROLE_LIST_BOX },
- { EFL_ACCESS_ROLE_GROUPING, ATSPI_ROLE_GROUPING },
- { EFL_ACCESS_ROLE_IMAGE_MAP, ATSPI_ROLE_IMAGE_MAP },
- { EFL_ACCESS_ROLE_NOTIFICATION, ATSPI_ROLE_NOTIFICATION },
- { EFL_ACCESS_ROLE_INFO_BAR, ATSPI_ROLE_INFO_BAR },
- { EFL_ACCESS_ROLE_LAST_DEFINED, ATSPI_ROLE_LAST_DEFINED },
-};
-
-struct atspi_state_desc
-{
- Efl_Access_State_Type elm_state;
- AtspiStateType atspi_state;
- const char *name;
-};
-
-static const struct atspi_state_desc elm_states_to_atspi_state[] = {
- { EFL_ACCESS_STATE_INVALID, ATSPI_STATE_INVALID, "invalid" },
- { EFL_ACCESS_STATE_ACTIVE, ATSPI_STATE_ACTIVE, "active" },
- { EFL_ACCESS_STATE_ARMED, ATSPI_STATE_ARMED, "armed" },
- { EFL_ACCESS_STATE_BUSY, ATSPI_STATE_BUSY, "busy" },
- { EFL_ACCESS_STATE_CHECKED, ATSPI_STATE_CHECKED, "checked" },
- { EFL_ACCESS_STATE_COLLAPSED, ATSPI_STATE_COLLAPSED, "collapsed" },
- { EFL_ACCESS_STATE_DEFUNCT, ATSPI_STATE_DEFUNCT, "defunct" },
- { EFL_ACCESS_STATE_EDITABLE, ATSPI_STATE_EDITABLE, "editable" },
- { EFL_ACCESS_STATE_ENABLED, ATSPI_STATE_ENABLED, "enabled" },
- { EFL_ACCESS_STATE_EXPANDABLE, ATSPI_STATE_EXPANDABLE, "expandable" },
- { EFL_ACCESS_STATE_EXPANDED, ATSPI_STATE_EXPANDED, "expanded" },
- { EFL_ACCESS_STATE_FOCUSABLE, ATSPI_STATE_FOCUSABLE, "focusable" },
- { EFL_ACCESS_STATE_FOCUSED, ATSPI_STATE_FOCUSED, "focused" },
- { EFL_ACCESS_STATE_HAS_TOOLTIP, ATSPI_STATE_HAS_TOOLTIP, "has-tooltip" },
- { EFL_ACCESS_STATE_HORIZONTAL, ATSPI_STATE_HORIZONTAL, "horizontal" },
- { EFL_ACCESS_STATE_ICONIFIED, ATSPI_STATE_ICONIFIED, "iconified" },
- { EFL_ACCESS_STATE_MODAL, ATSPI_STATE_MODAL, "modal" },
- { EFL_ACCESS_STATE_MULTI_LINE, ATSPI_STATE_MULTI_LINE, "multi-line" },
- { EFL_ACCESS_STATE_MULTISELECTABLE, ATSPI_STATE_MULTISELECTABLE, "multiselectable" },
- { EFL_ACCESS_STATE_OPAQUE, ATSPI_STATE_OPAQUE, "opaque" },
- { EFL_ACCESS_STATE_PRESSED, ATSPI_STATE_PRESSED, "pressed" },
- { EFL_ACCESS_STATE_RESIZABLE, ATSPI_STATE_RESIZABLE, "resizable" },
- { EFL_ACCESS_STATE_SELECTABLE, ATSPI_STATE_SELECTABLE, "selectable" },
- { EFL_ACCESS_STATE_SELECTED, ATSPI_STATE_SELECTED, "selected" },
- { EFL_ACCESS_STATE_SENSITIVE, ATSPI_STATE_SENSITIVE, "sensitive" },
- { EFL_ACCESS_STATE_SHOWING, ATSPI_STATE_SHOWING, "showing" },
- { EFL_ACCESS_STATE_SINGLE_LINE, ATSPI_STATE_SINGLE_LINE, "single-line" },
- { EFL_ACCESS_STATE_STALE, ATSPI_STATE_STALE, "stale" },
- { EFL_ACCESS_STATE_TRANSIENT, ATSPI_STATE_TRANSIENT, "transient" },
- { EFL_ACCESS_STATE_VERTICAL, ATSPI_STATE_VERTICAL, "vertical" },
- { EFL_ACCESS_STATE_VISIBLE, ATSPI_STATE_VISIBLE, "visible" },
- { EFL_ACCESS_STATE_MANAGES_DESCENDANTS, ATSPI_STATE_MANAGES_DESCENDANTS, "manages-descendants" },
- { EFL_ACCESS_STATE_INDETERMINATE, ATSPI_STATE_INDETERMINATE, "indeterminate" },
- { EFL_ACCESS_STATE_REQUIRED, ATSPI_STATE_REQUIRED, "required" },
- { EFL_ACCESS_STATE_TRUNCATED, ATSPI_STATE_TRUNCATED, "truncated" },
- { EFL_ACCESS_STATE_ANIMATED, ATSPI_STATE_ANIMATED, "animated" },
- { EFL_ACCESS_STATE_INVALID_ENTRY, ATSPI_STATE_INVALID_ENTRY, "invalid-entry" },
- { EFL_ACCESS_STATE_SUPPORTS_AUTOCOMPLETION, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION, "supports-autocompletion" },
- { EFL_ACCESS_STATE_SELECTABLE_TEXT, ATSPI_STATE_SELECTABLE_TEXT, "selectable-text" },
- { EFL_ACCESS_STATE_IS_DEFAULT, ATSPI_STATE_IS_DEFAULT, "is-default" },
- { EFL_ACCESS_STATE_VISITED, ATSPI_STATE_VISITED, "visited" },
- { EFL_ACCESS_STATE_LAST_DEFINED, ATSPI_STATE_LAST_DEFINED, "last-defined" },
-};
-
-static const int elm_relation_to_atspi_relation_mapping[] = {
- [EFL_ACCESS_RELATION_NULL] = ATSPI_RELATION_NULL,
- [EFL_ACCESS_RELATION_LABEL_FOR] = ATSPI_RELATION_LABEL_FOR,
- [EFL_ACCESS_RELATION_LABELLED_BY] = ATSPI_RELATION_LABELLED_BY,
- [EFL_ACCESS_RELATION_CONTROLLER_FOR] = ATSPI_RELATION_CONTROLLER_FOR,
- [EFL_ACCESS_RELATION_CONTROLLED_BY] = ATSPI_RELATION_CONTROLLED_BY,
- [EFL_ACCESS_RELATION_MEMBER_OF] = ATSPI_RELATION_MEMBER_OF,
- [EFL_ACCESS_RELATION_TOOLTIP_FOR] = ATSPI_RELATION_TOOLTIP_FOR,
- [EFL_ACCESS_RELATION_NODE_CHILD_OF] = ATSPI_RELATION_NODE_CHILD_OF,
- [EFL_ACCESS_RELATION_NODE_PARENT_OF] = ATSPI_RELATION_NODE_PARENT_OF,
- [EFL_ACCESS_RELATION_EXTENDED] = ATSPI_RELATION_EXTENDED,
- [EFL_ACCESS_RELATION_FLOWS_TO] = ATSPI_RELATION_FLOWS_TO,
- [EFL_ACCESS_RELATION_FLOWS_FROM] = ATSPI_RELATION_FLOWS_FROM,
- [EFL_ACCESS_RELATION_SUBWINDOW_OF] = ATSPI_RELATION_SUBWINDOW_OF,
- [EFL_ACCESS_RELATION_EMBEDS] = ATSPI_RELATION_EMBEDS,
- [EFL_ACCESS_RELATION_EMBEDDED_BY] = ATSPI_RELATION_EMBEDDED_BY,
- [EFL_ACCESS_RELATION_POPUP_FOR] = ATSPI_RELATION_POPUP_FOR,
- [EFL_ACCESS_RELATION_PARENT_WINDOW_OF] = ATSPI_RELATION_PARENT_WINDOW_OF,
- [EFL_ACCESS_RELATION_DESCRIPTION_FOR] = ATSPI_RELATION_DESCRIPTION_FOR,
- [EFL_ACCESS_RELATION_DESCRIBED_BY] = ATSPI_RELATION_DESCRIBED_BY,
- [EFL_ACCESS_RELATION_LAST_DEFINED] = ATSPI_RELATION_LAST_DEFINED,
-};
-
-static inline Eldbus_Message *_dbus_invalid_ref_error_new(const Eldbus_Message *msg)
-{
- return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.UnknownObject", "Path is not valid accessible object reference.");
-}
-
-static AtspiRelationType _elm_relation_to_atspi_relation(Efl_Access_Relation_Type type)
-{
- if ((type < EFL_ACCESS_RELATION_LAST_DEFINED) && (type > EFL_ACCESS_RELATION_NULL))
- return elm_relation_to_atspi_relation_mapping[type];
- return ATSPI_RELATION_NULL;
-}
-
-static Eldbus_Message *
-_accessible_get_role(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
- AtspiRole atspi_role = ATSPI_ROLE_INVALID;
- Efl_Access_Role role;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- role = efl_access_role_get(obj);
-
- Eldbus_Message *ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- atspi_role = role > EFL_ACCESS_ROLE_LAST_DEFINED ? ATSPI_ROLE_LAST_DEFINED : elm_roles_to_atspi_roles[role][1];
- eldbus_message_arguments_append(ret, "u", atspi_role);
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_get_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- const char *role_name = NULL, *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- role_name = efl_access_role_name_get(obj);
-
- Eldbus_Message *ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- eldbus_message_arguments_append(ret, "s", role_name);
-
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_get_localized_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- const char *l_role_name = NULL, *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- l_role_name = efl_access_localized_role_name_get(obj);
- EINA_SAFETY_ON_NULL_RETURN_VAL(l_role_name, NULL);
-
- Eldbus_Message *ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- eldbus_message_arguments_append(ret, "s", l_role_name);
-
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_get_children(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
- Eina_List *children_list = NULL, *l;
- Eldbus_Message *ret;
- Eldbus_Message_Iter *iter, *iter_array;
- Eo *children;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- children_list = efl_access_children_get(obj);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- iter = eldbus_message_iter_get(ret);
- iter_array = eldbus_message_iter_container_new(iter, 'a', "(so)");
- EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
-
- EINA_LIST_FOREACH(children_list, l, children)
- {
- _bridge_iter_object_reference_append(bridge, iter_array, children);
- _bridge_object_register(bridge, children);
- }
-
- eldbus_message_iter_container_close(iter, iter_array);
- eina_list_free(children_list);
-
- return ret;
-
-fail:
- if (ret) eldbus_message_unref(ret);
- return NULL;
-}
-
-static Eldbus_Message *
-_accessible_get_application(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- Eldbus_Message *ret;
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *root, *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- Eldbus_Message_Iter *iter = eldbus_message_iter_get(ret);
- root = efl_access_root_get(EFL_ACCESS_MIXIN);
- _bridge_iter_object_reference_append(bridge, iter, root);
-
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- Eina_List *attrs = NULL, *l;
- Efl_Access_Attribute *attr;
- Eldbus_Message_Iter *iter, *iter_dict = NULL, *iter_entry;
- Eldbus_Message *ret;
-
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- if (!ret) goto error;
-
- attrs = efl_access_attributes_get(obj);
-
- iter = eldbus_message_iter_get(ret);
- if (!iter) goto error;
-
- iter_dict = eldbus_message_iter_container_new(iter, 'a', "{ss}");
- if (!iter_dict) goto error;
-
-
- EINA_LIST_FOREACH(attrs, l, attr)
- {
- iter_entry = eldbus_message_iter_container_new(iter_dict, 'e', NULL);
- if (!iter_entry) goto error;
- eldbus_message_iter_arguments_append(iter_entry, "ss", attr->key, attr->value);
- eldbus_message_iter_container_close(iter_dict, iter_entry);
- }
-
- eldbus_message_iter_container_close(iter, iter_dict);
- efl_access_attributes_list_free(attrs);
- return ret;
-
-error:
- if (iter_dict) eldbus_message_iter_container_close(iter, iter_dict);
- if (ret) eldbus_message_unref(ret);
- efl_access_attributes_list_free(attrs);
- return NULL;
-}
-
-static Eldbus_Message *
-_accessible_interfaces_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- Eldbus_Message *ret;
- Eldbus_Message_Iter *iter;
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- iter = eldbus_message_iter_get(ret);
- _iter_interfaces_append(iter, obj);
-
- return ret;
-}
-
-static uint64_t
-_elm_atspi_state_set_to_atspi_state_set(Efl_Access_State_Set states)
-{
- uint64_t ret = 0;
- unsigned int i = 0;
-
- for (i = 0; i < SIZE(elm_states_to_atspi_state); i++)
- {
- if (STATE_TYPE_GET(states, elm_states_to_atspi_state[i].elm_state))
- STATE_TYPE_SET(ret, elm_states_to_atspi_state[i].atspi_state);
- }
- return ret;
-}
-
static Efl_Access_State_Set
_atspi_state_set_to_elm_atspi_state_set(uint64_t states)
{
@@ -691,6 +293,7 @@ _atspi_state_set_to_elm_atspi_state_set(uint64_t states)
static Eina_Hash*
_elm_atspi_state_hash_build(void)
{
+#if 0
Eina_Hash *ret = eina_hash_string_superfast_new(NULL);
unsigned int i = 0;
@@ -698,6 +301,8 @@ _elm_atspi_state_hash_build(void)
eina_hash_add(ret, elm_states_to_atspi_state[i].name, &elm_states_to_atspi_state[i]);
return ret;
+#endif
+ return NULL;
}
static Eina_Hash*
@@ -713,159 +318,6 @@ _elm_atspi_event_hash_build(void)
}
static Eldbus_Message *
-_accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
-{
- Eldbus_Message *ret;
- Eldbus_Message_Iter *iter, *iter_array;
- Efl_Access_State_Set states;
- uint64_t atspi_states = 0;
-
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- iter = eldbus_message_iter_get(ret);
- iter_array = eldbus_message_iter_container_new(iter, 'a', "u");
- EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
-
- states = efl_access_state_set_get(obj);
-
- atspi_states = _elm_atspi_state_set_to_atspi_state_set(states);
-
- unsigned int s1 = atspi_states & 0xFFFFFFFF;
- unsigned int s2 = (atspi_states >> 32) & 0xFFFFFFFF;
-
- eldbus_message_iter_basic_append(iter_array, 'u', s1);
- eldbus_message_iter_basic_append(iter_array, 'u', s2);
- eldbus_message_iter_container_close(iter, iter_array);
-
- return ret;
-
-fail:
- if (ret) eldbus_message_unref(ret);
- return NULL;
-}
-
-static Eldbus_Message *
-_accessible_get_index_in_parent(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
-{
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
- Eldbus_Message *ret;
- int idx = -1;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- idx = efl_access_index_in_parent_get(obj);
-
- eldbus_message_arguments_append(ret, "i", idx);
-
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_child_at_index(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
-{
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *obj = _bridge_object_from_path(bridge, obj_path);
- Eo *child = NULL;
- Eina_List *children = NULL;
- int idx;
- Eldbus_Message *ret;
- Eldbus_Message_Iter *iter;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- if (!eldbus_message_arguments_get(msg, "i", &idx))
- return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- iter = eldbus_message_iter_get(ret);
- children = efl_access_children_get(obj);
-
- child = eina_list_nth(children, idx);
- _bridge_iter_object_reference_append(bridge, iter, child);
- _bridge_object_register(bridge, child);
- eina_list_free(children);
-
- return ret;
-}
-
-static Eldbus_Message *
-_accessible_get_relation_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
-{
- const char *obj_path = eldbus_message_path_get(msg);
- Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *rel_obj, *obj = _bridge_object_from_path(bridge, obj_path);
- Eldbus_Message *ret = NULL;
- Eldbus_Message_Iter *iter = NULL, *iter_array = NULL, *iter_array2 = NULL, *iter_struct;
- Efl_Access_Relation *rel;
- Eina_List *l, *l2;
- Efl_Access_Relation_Set rels;
-
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, msg);
-
- ret = eldbus_message_method_return_new(msg);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
-
- iter = eldbus_message_iter_get(ret);
- iter_array = eldbus_message_iter_container_new(iter, 'a', "(ua(so))");
- EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
-
- rels = efl_access_relation_set_get(obj);
-
- EINA_LIST_FOREACH(rels, l, rel)
- {
- iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
- eldbus_message_iter_basic_append(iter_struct, 'u', _elm_relation_to_atspi_relation(rel->type));
- iter_array2 = eldbus_message_iter_container_new(iter_struct, 'a', "(so)");
- EINA_SAFETY_ON_NULL_GOTO(iter_array2, fail);
- EINA_LIST_FOREACH(rel->objects, l2, rel_obj)
- {
- _bridge_iter_object_reference_append(bridge, iter_array2, rel_obj);
- _bridge_object_register(bridge, rel_obj);
- }
- eldbus_message_iter_container_close(iter_struct, iter_array2);
- eldbus_message_iter_container_close(iter_array, iter_struct);
- }
- efl_access_relation_set_free(rels);
- eldbus_message_iter_container_close(iter, iter_array);
-
- return ret;
-
-fail:
- eldbus_message_unref(ret);
- return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Unable to get relation set.");
-}
-
-static const Eldbus_Method accessible_methods[] = {
- { "GetChildAtIndex", ELDBUS_ARGS({"i", "index"}), ELDBUS_ARGS({"(so)", "Accessible"}), _accessible_child_at_index, 0 },
- { "GetChildren", NULL, ELDBUS_ARGS({"a(so)", "children"}), _accessible_get_children, 0 },
- { "GetIndexInParent", NULL, ELDBUS_ARGS({"i", "index"}), _accessible_get_index_in_parent, 0 },
- { "GetRelationSet", NULL, ELDBUS_ARGS({"a(ua(so))", NULL}), _accessible_get_relation_set, 0 },
- { "GetRole", NULL, ELDBUS_ARGS({"u", "Role"}), _accessible_get_role, 0 },
- { "GetRoleName", NULL, ELDBUS_ARGS({"s", "Name"}), _accessible_get_role_name, 0 },
- { "GetLocalizedRoleName", NULL, ELDBUS_ARGS({"s", "LocalizedName"}), _accessible_get_localized_role_name, 0},
- { "GetState", NULL, ELDBUS_ARGS({"au", NULL}), _accessible_get_state, 0},
- { "GetApplication", NULL, ELDBUS_ARGS({"(so)", NULL}), _accessible_get_application, 0},
- { "GetAttributes", NULL, ELDBUS_ARGS({"a{ss}", NULL}), _accessible_attributes_get, 0},
- { "GetInterfaces", NULL, ELDBUS_ARGS({"as", NULL}), _accessible_interfaces_get, 0},
- { NULL, NULL, NULL, NULL, 0 }
-};
-
-static Eldbus_Message *
_selection_selected_child_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_message_path_get(msg);
@@ -2071,55 +1523,6 @@ _path_from_object(const Eo *eo)
}
static Eina_Bool
-_accessible_property_get(const Eldbus_Service_Interface *interface, const char *property,
- Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg,
- Eldbus_Message **error)
-{
- const char *ret = NULL, *obj_path = eldbus_message_path_get(request_msg);
- Eo *bridge = eldbus_service_object_data_get(interface, ELM_ATSPI_BRIDGE_CLASS_NAME);
- Eo *ret_obj = NULL, *obj = _bridge_object_from_path(bridge, obj_path);
-
- ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_MIXIN, request_msg, error);
-
- if (!strcmp(property, "Name"))
- {
- ret = efl_access_name_get(obj);
- if (!ret)
- ret = "";
- eldbus_message_iter_basic_append(iter, 's', ret);
- return EINA_TRUE;
- }
- else if (!strcmp(property, "Description"))
- {
- ret = efl_access_description_get(obj);
- if (!ret)
- ret = "";
- eldbus_message_iter_basic_append(iter, 's', ret);
- return EINA_TRUE;
- }
- else if (!strcmp(property, "Parent"))
- {
- ret_obj = efl_access_parent_get(obj);
- Efl_Access_Role role = EFL_ACCESS_ROLE_INVALID;
- role = efl_access_role_get(obj);
- if ((!ret_obj) && (EFL_ACCESS_ROLE_APPLICATION == role))
- _object_desktop_reference_append(iter);
- else
- _bridge_iter_object_reference_append(bridge, iter, ret_obj);
- return EINA_TRUE;
- }
- else if (!strcmp(property, "ChildCount"))
- {
- Eina_List *l = NULL;
- l = efl_access_children_get(obj);
- eldbus_message_iter_basic_append(iter, 'i', eina_list_count(l));
- eina_list_free(l);
- return EINA_TRUE;
- }
- return EINA_FALSE;
-}
-
-static Eina_Bool
_selection_property_get(const Eldbus_Service_Interface *interface, const char *property,
Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg,
Eldbus_Message **error)
@@ -2344,14 +1747,6 @@ _application_properties_get(const Eldbus_Service_Interface *interface, const cha
return EINA_FALSE;
}
-static const Eldbus_Property accessible_properties[] = {
- { "Name", "s", NULL, NULL, 0 },
- { "Description", "s", NULL, NULL, 0 },
- { "Parent", "(so)", NULL, NULL, 0 },
- { "ChildCount", "i", NULL, NULL, 0 },
- { NULL, NULL, NULL, NULL, 0 }
-};
-
static const Eldbus_Property action_properties[] = {
{ "NActions", "i", _action_property_get, NULL, 0 },
{ NULL, NULL, NULL, NULL, 0 }
@@ -2389,10 +1784,6 @@ static const Eldbus_Property application_properties[] = {
{ NULL, NULL, NULL, NULL, 0 }
};
-static const Eldbus_Service_Interface_Desc accessible_iface_desc = {
- ATSPI_DBUS_INTERFACE_ACCESSIBLE, accessible_methods, NULL, accessible_properties, _accessible_property_get, NULL
-};
-
static const Eldbus_Service_Interface_Desc action_iface_desc = {
ATSPI_DBUS_INTERFACE_ACTION, action_methods, NULL, action_properties, NULL, NULL
};
@@ -3691,9 +3082,12 @@ _set_broadcast_flag(const char *event, Eo *bridge)
if (!tokens[2] || *tokens[2] == '\0')
pd->object_state_broadcast_mask = -1; // broadcast all
eina_str_tolower(&tokens[2]);
+ //FIXME
+ /*
struct atspi_state_desc *sd = eina_hash_find(pd->state_hash, tokens[2]);
if (sd)
STATE_TYPE_SET(pd->object_state_broadcast_mask, sd->elm_state);
+ */
}
else if (!strcmp(tokens[1], "PropertyChange"))
{
@@ -3819,7 +3213,7 @@ static void
_state_changed_signal_send(void *data, const Efl_Event *event)
{
Efl_Access_Event_State_Changed_Data *state_data = event->info;
- const char *type_desc;
+ const char *type_desc = NULL;
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd);
if (!STATE_TYPE_GET(pd->object_state_broadcast_mask, state_data->type))
@@ -3835,7 +3229,7 @@ _state_changed_signal_send(void *data, const Efl_Event *event)
return;
}
- type_desc = elm_states_to_atspi_state[state_data->type].name;
+ //FIXME type_desc = elm_states_to_atspi_state[state_data->type].name;
_bridge_signal_send(data, event->object, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
&_event_obj_signals[ATSPI_OBJECT_EVENT_STATE_CHANGED], type_desc, state_data->new_value, 0, NULL);
@@ -4319,9 +3713,12 @@ _interfaces_register(Eo *bridge)
{
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
+ pd->interfaces.accessible = _elm_atspi_access_adaptor_register(pd->a11y_bus);
+#if 0
pd->interfaces.accessible =
eldbus_service_interface_fallback_register(pd->a11y_bus, ELM_ACCESS_OBJECT_PATH_PREFIX2, &accessible_iface_desc);
eldbus_service_object_data_set(pd->interfaces.accessible, ELM_ATSPI_BRIDGE_CLASS_NAME, bridge);
+#endif
pd->interfaces.application =
eldbus_service_interface_fallback_register(pd->a11y_bus, ELM_ACCESS_OBJECT_PATH_PREFIX2, &application_iface_desc);