/* special widgets - types used elsewhere */
#include <elm_access.h>
-#include <elm_atspi_object.h>
#include <elm_icon.h>
#include <elm_scroller.h>
#include <elm_entry.h>
elm_app_client_view_eo.h \
elm_app_client_view.h \
elm_app.h \
-elm_atspi_object.h \
-elm_atspi_object_common.h \
-elm_atspi_object_eo.h \
-elm_atspi_object_legacy.h \
elm_authors.h \
elm_bg.h \
elm_bg_eo.h \
elm_app_server_view.c \
elm_app_client.c \
elm_app_client_view.c \
-elm_atspi_object.c \
+elm_atspi_app_object.c \
elm_atspi_bridge.c \
elm_bg.c \
elm_box.c \
elm_icon.c \
elm_image.c \
elm_index.c \
+elm_interface_atspi_accessible.c \
elm_interface_atspi_component.c \
+elm_interface_atspi_widget.c \
+elm_interface_atspi_window.c \
elm_interface_fileselector.c \
elm_interface_scrollable.c \
elm_inwin.c \
elm_access.eo.h \
elm_actionslider.eo.c \
elm_actionslider.eo.h \
- elm_app_access_object.eo.c \
- elm_app_access_object.eo.h \
elm_app_client.eo.c \
elm_app_client.eo.h \
elm_app_client_view.eo.c \
elm_app_server.eo.h \
elm_app_server_view.eo.c \
elm_app_server_view.eo.h \
- elm_interface_atspi_component.eo.c \
- elm_interface_atspi_component.eo.h \
- elm_interface_atspi_window.eo.c \
- elm_interface_atspi_window.eo.h \
- elm_atspi_object.eo.c \
- elm_atspi_object.eo.h \
+ elm_atspi_app_object.eo.c \
+ elm_atspi_app_object.eo.h \
elm_bg.eo.c \
elm_bg.eo.h \
elm_box.eo.c \
elm_icon.eo.h \
elm_index.eo.c \
elm_index.eo.h \
+ elm_interface_atspi_accessible.eo.c \
+ elm_interface_atspi_accessible.eo.h \
+ elm_interface_atspi_component.eo.c \
+ elm_interface_atspi_component.eo.h \
+ elm_interface_atspi_widget.eo.c \
+ elm_interface_atspi_widget.eo.h \
+ elm_interface_atspi_window.eo.c \
+ elm_interface_atspi_window.eo.h \
elm_interface_fileselector.eo.c \
elm_interface_fileselector.eo.h \
elm_inwin.eo.c \
elm_video.eo.h \
elm_web.eo.c \
elm_web.eo.h \
- elm_widget_access_object.eo.c \
- elm_widget_access_object.eo.h \
- elm_win_access_object.eo.c \
- elm_win_access_object.eo.h \
elm_win.eo.c \
elm_win.eo.h
elm_hover.eo \
elm_access.eo \
elm_actionslider.eo \
- elm_app_access_object.eo \
elm_app_client.eo \
elm_app_client_view.eo \
elm_app_server.eo \
elm_app_server_view.eo \
+ elm_atspi_app_object.eo \
+ elm_interface_atspi_accessible.eo \
elm_interface_atspi_component.eo \
+ elm_interface_atspi_widget.eo \
elm_interface_atspi_window.eo \
- elm_atspi_object.eo \
elm_bg.eo \
elm_box.eo \
elm_bubble.eo \
elm_toolbar.eo \
elm_video.eo \
elm_web.eo \
- elm_widget_access_object.eo \
- elm_win_access_object.eo \
elm_win.eo
nodist_includesunstable_HEADERS = \
elm_access.eo.h \
elm_hover.eo.h \
elm_actionslider.eo.h \
- elm_app_access_object.eo.h \
elm_app_client.eo.h \
elm_app_client_view.eo.h \
elm_app_server.eo.h \
elm_app_server_view.eo.h \
+ elm_atspi_app_object.eo.h \
+ elm_interface_atspi_accessible.eo.h \
elm_interface_atspi_component.eo.h \
+ elm_interface_atspi_widget.eo.h \
elm_interface_atspi_window.eo.h \
- elm_atspi_object.eo.h \
elm_box.eo.h \
elm_bg.eo.h \
elm_bubble.eo.h \
elm_toolbar.eo.h \
elm_video.eo.h \
elm_web.eo.h \
- elm_widget_access_object.eo.h \
- elm_win_access_object.eo.h \
elm_win.eo.h
+++ /dev/null
-class Elm_App_Access_Object (Elm_Atspi_Object)
-{
- data:null;
- implements {
- Eo_Base::constructor;
- Elm_Atspi_Object::name::get;
- Elm_Atspi_Object::parent::get;
- Elm_Atspi_Object::role::get;
- Elm_Atspi_Object::children::get;
- }
-
-}
-
--- /dev/null
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_widget.h"
+#include "elm_priv.h"
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+#include "elm_atspi_app_object.eo.h"
+
+extern Eina_List *_elm_win_list;
+static Eo *_atspi_root;
+static int _init;
+
+EOLIAN static Eina_List*
+_elm_atspi_app_object_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ Eina_List *l, *accs = NULL;
+ Evas_Object *win;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, win)
+ {
+ if (!win) continue;
+ if (eo_isa(win, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ accs = eina_list_append(accs, win);
+ }
+
+ return accs;
+}
+
+EOLIAN static const char*
+_elm_atspi_app_object_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ return elm_app_name_get();
+}
+
+EOLIAN static const char*
+_elm_atspi_app_object_elm_interface_atspi_accessible_description_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Elm_Atspi_Role
+_elm_atspi_app_object_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ return ELM_ATSPI_ROLE_APPLICATION;
+}
+
+EAPI void
+_elm_atspi_init(void)
+{
+ if (!_init)
+ {
+ _atspi_root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
+ _init = 1;
+ }
+}
+
+EAPI void
+_elm_atspi_shutdown(void)
+{
+ if (_init)
+ {
+ eo_unref(_atspi_root);
+ _atspi_root = NULL;
+ _init = 0;
+ }
+}
+
+EAPI Eo*
+_elm_atspi_root_get(void)
+{
+ return _atspi_root;
+}
+
+#include "elm_atspi_app_object.eo.c"
--- /dev/null
+class Elm_Atspi_App_Object (Eo_Base, Elm_Interface_Atspi_Accessible)
+{
+ data: null;
+ implements {
+ Elm_Interface_Atspi_Accessible::name::get;
+ Elm_Interface_Atspi_Accessible::description::get;
+ Elm_Interface_Atspi_Accessible::role::get;
+ Elm_Interface_Atspi_Accessible::children::get;
+ }
+}
#endif
#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
-#define ELM_ATSPI_OBJECT_PROTECTED
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#include "atspi/atspi-constants.h"
#include <stdint.h>
#include "elm_priv.h"
#include <assert.h>
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+#include "elm_interface_atspi_component.eo.h"
+#include "elm_interface_atspi_window.eo.h"
+
/*
* Accessibility Bus info not defined in atspi-constants.h
*/
#define ELM_ACCESS_OBJECT_PATH_PREFIX "/org/a11y/atspi/accessible/"
#define ELM_ACCESS_OBJECT_REFERENCE_TEMPLATE ELM_ACCESS_OBJECT_PATH_PREFIX "%llu"
+#define SIZE(x) sizeof(x)/sizeof(x[0])
+
static int _init_count = 0;
static Eldbus_Connection *_a11y_bus = NULL;
-static Elm_Atspi_Object *_root;
+static Eo *_root;
+static Ecore_Idler *_cache_update_idler;
+static Eina_List *_pending_objects;
static Eina_Hash *_cache;
static Eldbus_Service_Interface *_cache_interface = NULL;
static Eldbus_Signal_Handler *_register_hdl;
static unsigned long long _object_state_broadcast_mask;
static unsigned long long _window_signal_broadcast_mask;
-static void _cache_update(void);
-static Elm_Atspi_Object * _access_object_from_path(const char *path);
-static char * _path_from_access_object(Elm_Atspi_Object *eo);
-static void object_append_reference(Eldbus_Message_Iter *iter, Elm_Atspi_Object *obj);
-static void object_append_desktop_reference(Eldbus_Message_Iter *iter);
-static const Eldbus_Service_Interface_Desc accessible_iface_desc;
-static void _cache_object_register(Elm_Atspi_Object *node, Eina_Bool rec);
-
+static Eina_Bool _state_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
+static Eina_Bool _property_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info);
+static Eina_Bool _children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info);
+static Eina_Bool _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
+static Eo * _access_object_from_path(const char *path);
+static char * _path_from_access_object(Eo *eo);
+static void _object_append_reference(Eldbus_Message_Iter *iter, Eo *obj);
+static void _object_append_desktop_reference(Eldbus_Message_Iter *iter);
+static void _cache_build(void *obj);
+static void _object_register(Eo *obj, char *path);
+
+EO_CALLBACKS_ARRAY_DEFINE(_events_cb,
+ { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, _property_changed_signal_send},
+ { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_signal_send},
+ { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, _state_changed_signal_send},
+ { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_VISIBLE_DATA_CHANGED, NULL },
+ { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ACTIVE_DESCENDANTS_CHANGED, NULL }
+);
+
+EO_CALLBACKS_ARRAY_DEFINE(_window_cb,
+ { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send},
+ { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send},
+ { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, _window_signal_send}
+);
enum _Atspi_Object_Child_Event_Type
{
ATSPI_OBJECT_PROPERTY_VALUE,
ATSPI_OBJECT_PROPERTY_ROLE,
ATSPI_OBJECT_PROPERTY_PARENT,
+ ATSPI_OBJECT_PROPERTY_LAST
};
enum _Atspi_Object_Signals {
- ATSPI_OBJECT_EVENT_PROPERTY_CHANGED,
+ ATSPI_OBJECT_EVENT_PROPERTY_CHANGED = 0,
ATSPI_OBJECT_EVENT_BOUNDS_CHANGED,
ATSPI_OBJECT_EVENT_LINK_SELECTED,
ATSPI_OBJECT_EVENT_STATE_CHANGED,
enum _Atspi_Window_Signals
{
- ATSPI_WINDOW_EVENT_PROPERTY_CHANGE,
+ ATSPI_WINDOW_EVENT_PROPERTY_CHANGE = 0,
ATSPI_WINDOW_EVENT_MINIMIZE,
ATSPI_WINDOW_EVENT_MAXIMIZE,
ATSPI_WINDOW_EVENT_RESTORE,
[ATSPI_WINDOW_EVENT_SHADE] = {"Shade", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
[ATSPI_WINDOW_EVENT_UUSHADE] = {"uUshade", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
[ATSPI_WINDOW_EVENT_RESTYLE] = {"Restyle", ELDBUS_ARGS({"siiv(so)", NULL}), 0},
+ {NULL, ELDBUS_ARGS({NULL, NULL}), 0}
+};
+
+
+const int elm_roles_to_atspi_roles[][2] = {
+ { ELM_ATSPI_ROLE_INVALID, ATSPI_ROLE_INVALID },
+ { ELM_ATSPI_ROLE_ACCELERATOR_LABEL, ATSPI_ROLE_ACCELERATOR_LABEL },
+ { ELM_ATSPI_ROLE_ALERT, ATSPI_ROLE_ALERT },
+ { ELM_ATSPI_ROLE_ANIMATION, ATSPI_ROLE_ANIMATION },
+ { ELM_ATSPI_ROLE_ARROW, ATSPI_ROLE_ARROW },
+ { ELM_ATSPI_ROLE_CALENDAR, ATSPI_ROLE_CALENDAR },
+ { ELM_ATSPI_ROLE_CANVAS, ATSPI_ROLE_CANVAS },
+ { ELM_ATSPI_ROLE_CHECK_BOX, ATSPI_ROLE_CHECK_BOX },
+ { ELM_ATSPI_ROLE_CHECK_MENU_ITEM, ATSPI_ROLE_CHECK_MENU_ITEM },
+ { ELM_ATSPI_ROLE_COLOR_CHOOSER, ATSPI_ROLE_COLOR_CHOOSER },
+ { ELM_ATSPI_ROLE_COLUMN_HEADER, ATSPI_ROLE_COLUMN_HEADER },
+ { ELM_ATSPI_ROLE_COMBO_BOX, ATSPI_ROLE_COMBO_BOX },
+ { ELM_ATSPI_ROLE_DATE_EDITOR, ATSPI_ROLE_DATE_EDITOR },
+ { ELM_ATSPI_ROLE_DESKTOP_ICON, ATSPI_ROLE_DESKTOP_ICON },
+ { ELM_ATSPI_ROLE_DESKTOP_FRAME, ATSPI_ROLE_DESKTOP_FRAME },
+ { ELM_ATSPI_ROLE_DIAL, ATSPI_ROLE_DIAL },
+ { ELM_ATSPI_ROLE_DIALOG, ATSPI_ROLE_DIALOG },
+ { ELM_ATSPI_ROLE_DIRECTORY_PANE, ATSPI_ROLE_DIRECTORY_PANE },
+ { ELM_ATSPI_ROLE_DRAWING_AREA, ATSPI_ROLE_DRAWING_AREA },
+ { ELM_ATSPI_ROLE_FILE_CHOOSER, ATSPI_ROLE_FILE_CHOOSER },
+ { ELM_ATSPI_ROLE_FILLER, ATSPI_ROLE_FILLER },
+ { ELM_ATSPI_ROLE_FOCUS_TRAVERSABLE, ATSPI_ROLE_FOCUS_TRAVERSABLE },
+ { ELM_ATSPI_ROLE_FONT_CHOOSER, ATSPI_ROLE_FONT_CHOOSER },
+ { ELM_ATSPI_ROLE_FRAME, ATSPI_ROLE_FRAME },
+ { ELM_ATSPI_ROLE_GLASS_PANE, ATSPI_ROLE_GLASS_PANE },
+ { ELM_ATSPI_ROLE_HTML_CONTAINER, ATSPI_ROLE_HTML_CONTAINER },
+ { ELM_ATSPI_ROLE_ICON, ATSPI_ROLE_ICON },
+ { ELM_ATSPI_ROLE_IMAGE, ATSPI_ROLE_IMAGE },
+ { ELM_ATSPI_ROLE_INTERNAL_FRAME, ATSPI_ROLE_INTERNAL_FRAME },
+ { ELM_ATSPI_ROLE_LABEL, ATSPI_ROLE_LABEL },
+ { ELM_ATSPI_ROLE_LAYERED_PANE, ATSPI_ROLE_LAYERED_PANE },
+ { ELM_ATSPI_ROLE_LIST, ATSPI_ROLE_LIST },
+ { ELM_ATSPI_ROLE_LIST_ITEM, ATSPI_ROLE_LIST_ITEM },
+ { ELM_ATSPI_ROLE_MENU, ATSPI_ROLE_MENU },
+ { ELM_ATSPI_ROLE_MENU_BAR, ATSPI_ROLE_MENU_BAR },
+ { ELM_ATSPI_ROLE_MENU_ITEM, ATSPI_ROLE_MENU_ITEM },
+ { ELM_ATSPI_ROLE_OPTION_PANE, ATSPI_ROLE_OPTION_PANE },
+ { ELM_ATSPI_ROLE_PAGE_TAB, ATSPI_ROLE_PAGE_TAB },
+ { ELM_ATSPI_ROLE_PAGE_TAB_LIST, ATSPI_ROLE_PAGE_TAB_LIST },
+ { ELM_ATSPI_ROLE_PANEL, ATSPI_ROLE_PANEL },
+ { ELM_ATSPI_ROLE_PASSWORD_TEXT, ATSPI_ROLE_PASSWORD_TEXT },
+ { ELM_ATSPI_ROLE_POPUP_MENU, ATSPI_ROLE_POPUP_MENU },
+ { ELM_ATSPI_ROLE_PROGRESS_BAR, ATSPI_ROLE_PROGRESS_BAR },
+ { ELM_ATSPI_ROLE_PUSH_BUTTON, ATSPI_ROLE_PUSH_BUTTON },
+ { ELM_ATSPI_ROLE_RADIO_BUTTON, ATSPI_ROLE_RADIO_BUTTON },
+ { ELM_ATSPI_ROLE_RADIO_MENU_ITEM, ATSPI_ROLE_RADIO_MENU_ITEM },
+ { ELM_ATSPI_ROLE_ROOT_PANE, ATSPI_ROLE_ROOT_PANE },
+ { ELM_ATSPI_ROLE_ROW_HEADER, ATSPI_ROLE_ROW_HEADER },
+ { ELM_ATSPI_ROLE_SCROLL_BAR, ATSPI_ROLE_SCROLL_BAR },
+ { ELM_ATSPI_ROLE_SCROLL_PANE, ATSPI_ROLE_SCROLL_PANE },
+ { ELM_ATSPI_ROLE_SEPARATOR, ATSPI_ROLE_SEPARATOR },
+ { ELM_ATSPI_ROLE_SLIDER, ATSPI_ROLE_SLIDER },
+ { ELM_ATSPI_ROLE_SPIN_BUTTON, ATSPI_ROLE_SPIN_BUTTON },
+ { ELM_ATSPI_ROLE_SPLIT_PANE, ATSPI_ROLE_SPLIT_PANE },
+ { ELM_ATSPI_ROLE_STATUS_BAR, ATSPI_ROLE_STATUS_BAR },
+ { ELM_ATSPI_ROLE_TABLE, ATSPI_ROLE_TABLE },
+ { ELM_ATSPI_ROLE_TABLE_CELL, ATSPI_ROLE_TABLE_CELL },
+ { ELM_ATSPI_ROLE_TABLE_COLUMN_HEADER, ATSPI_ROLE_TABLE_COLUMN_HEADER },
+ { ELM_ATSPI_ROLE_TABLE_ROW_HEADER, ATSPI_ROLE_TABLE_ROW_HEADER },
+ { ELM_ATSPI_ROLE_TEAROFF_MENU_ITEM, ATSPI_ROLE_TEAROFF_MENU_ITEM },
+ { ELM_ATSPI_ROLE_TERMINAL, ATSPI_ROLE_TERMINAL },
+ { ELM_ATSPI_ROLE_TEXT, ATSPI_ROLE_TEXT },
+ { ELM_ATSPI_ROLE_TOGGLE_BUTTON, ATSPI_ROLE_TOGGLE_BUTTON },
+ { ELM_ATSPI_ROLE_TOOL_BAR, ATSPI_ROLE_TOOL_BAR },
+ { ELM_ATSPI_ROLE_TOOL_TIP, ATSPI_ROLE_TOOL_TIP },
+ { ELM_ATSPI_ROLE_TREE, ATSPI_ROLE_TREE },
+ { ELM_ATSPI_ROLE_TREE_TABLE, ATSPI_ROLE_TREE_TABLE },
+ { ELM_ATSPI_ROLE_UNKNOWN, ATSPI_ROLE_UNKNOWN },
+ { ELM_ATSPI_ROLE_VIEWPORT, ATSPI_ROLE_VIEWPORT },
+ { ELM_ATSPI_ROLE_WINDOW, ATSPI_ROLE_WINDOW },
+ { ELM_ATSPI_ROLE_EXTENDED, ATSPI_ROLE_EXTENDED },
+ { ELM_ATSPI_ROLE_HEADER, ATSPI_ROLE_HEADER },
+ { ELM_ATSPI_ROLE_FOOTER, ATSPI_ROLE_FOOTER },
+ { ELM_ATSPI_ROLE_PARAGRAPH, ATSPI_ROLE_PARAGRAPH },
+ { ELM_ATSPI_ROLE_RULER, ATSPI_ROLE_RULER },
+ { ELM_ATSPI_ROLE_APPLICATION, ATSPI_ROLE_APPLICATION },
+ { ELM_ATSPI_ROLE_AUTOCOMPLETE, ATSPI_ROLE_AUTOCOMPLETE },
+ { ELM_ATSPI_ROLE_EDITBAR, ATSPI_ROLE_EDITBAR },
+ { ELM_ATSPI_ROLE_EMBEDDED, ATSPI_ROLE_EMBEDDED },
+ { ELM_ATSPI_ROLE_ENTRY, ATSPI_ROLE_ENTRY },
+ { ELM_ATSPI_ROLE_CHART, ATSPI_ROLE_CHART },
+ { ELM_ATSPI_ROLE_CAPTION, ATSPI_ROLE_CAPTION },
+ { ELM_ATSPI_ROLE_DOCUMENT_FRAME, ATSPI_ROLE_DOCUMENT_FRAME },
+ { ELM_ATSPI_ROLE_HEADING, ATSPI_ROLE_HEADING },
+ { ELM_ATSPI_ROLE_PAGE, ATSPI_ROLE_PAGE },
+ { ELM_ATSPI_ROLE_SECTION, ATSPI_ROLE_SECTION },
+ { ELM_ATSPI_ROLE_REDUNDANT_OBJECT, ATSPI_ROLE_REDUNDANT_OBJECT },
+ { ELM_ATSPI_ROLE_FORM, ATSPI_ROLE_FORM },
+ { ELM_ATSPI_ROLE_LINK, ATSPI_ROLE_LINK },
+ { ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW, ATSPI_ROLE_INPUT_METHOD_WINDOW },
+ { ELM_ATSPI_ROLE_TABLE_ROW, ATSPI_ROLE_TABLE_ROW },
+ { ELM_ATSPI_ROLE_TREE_ITEM, ATSPI_ROLE_TREE_ITEM },
+ { ELM_ATSPI_ROLE_DOCUMENT_SPREADSHEET, ATSPI_ROLE_DOCUMENT_SPREADSHEET },
+ { ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION, ATSPI_ROLE_DOCUMENT_PRESENTATION },
+ { ELM_ATSPI_ROLE_DOCUMENT_TEXT, ATSPI_ROLE_DOCUMENT_TEXT },
+ { ELM_ATSPI_ROLE_DOCUMENT_WEB, ATSPI_ROLE_DOCUMENT_WEB },
+ { ELM_ATSPI_ROLE_DOCUMENT_EMAIL, ATSPI_ROLE_DOCUMENT_EMAIL },
+ { ELM_ATSPI_ROLE_COMMENT, ATSPI_ROLE_COMMENT },
+ { ELM_ATSPI_ROLE_LIST_BOX, ATSPI_ROLE_LIST_BOX },
+ { ELM_ATSPI_ROLE_GROUPING, ATSPI_ROLE_GROUPING },
+ { ELM_ATSPI_ROLE_IMAGE_MAP, ATSPI_ROLE_IMAGE_MAP },
+ { ELM_ATSPI_ROLE_NOTIFICATION, ATSPI_ROLE_NOTIFICATION },
+ { ELM_ATSPI_ROLE_INFO_BAR, ATSPI_ROLE_INFO_BAR },
+ { ELM_ATSPI_ROLE_LAST_DEFINED, ATSPI_ROLE_LAST_DEFINED },
+};
+
+
+const int elm_states_to_atspi_state[][2] = {
+ { ELM_ATSPI_STATE_INVALID, ATSPI_STATE_INVALID },
+ { ELM_ATSPI_STATE_ACTIVE, ATSPI_STATE_ACTIVE },
+ { ELM_ATSPI_STATE_ARMED, ATSPI_STATE_ARMED },
+ { ELM_ATSPI_STATE_BUSY, ATSPI_STATE_BUSY },
+ { ELM_ATSPI_STATE_CHECKED, ATSPI_STATE_CHECKED },
+ { ELM_ATSPI_STATE_COLLAPSED, ATSPI_STATE_COLLAPSED },
+ { ELM_ATSPI_STATE_DEFUNCT, ATSPI_STATE_DEFUNCT },
+ { ELM_ATSPI_STATE_EDITABLE, ATSPI_STATE_EDITABLE },
+ { ELM_ATSPI_STATE_ENABLED, ATSPI_STATE_ENABLED },
+ { ELM_ATSPI_STATE_EXPANDABLE, ATSPI_STATE_EXPANDABLE },
+ { ELM_ATSPI_STATE_EXPANDED, ATSPI_STATE_EXPANDED },
+ { ELM_ATSPI_STATE_FOCUSABLE, ATSPI_STATE_FOCUSABLE },
+ { ELM_ATSPI_STATE_FOCUSED, ATSPI_STATE_FOCUSED },
+ { ELM_ATSPI_STATE_HAS_TOOLTIP, ATSPI_STATE_HAS_TOOLTIP },
+ { ELM_ATSPI_STATE_HORIZONTAL, ATSPI_STATE_HORIZONTAL },
+ { ELM_ATSPI_STATE_ICONIFIED, ATSPI_STATE_ICONIFIED },
+ { ELM_ATSPI_STATE_MODAL, ATSPI_STATE_MODAL },
+ { ELM_ATSPI_STATE_MULTI_LINE, ATSPI_STATE_MULTI_LINE },
+ { ELM_ATSPI_STATE_MULTISELECTABLE, ATSPI_STATE_MULTISELECTABLE },
+ { ELM_ATSPI_STATE_OPAQUE, ATSPI_STATE_OPAQUE },
+ { ELM_ATSPI_STATE_PRESSED, ATSPI_STATE_PRESSED },
+ { ELM_ATSPI_STATE_RESIZABLE, ATSPI_STATE_RESIZABLE },
+ { ELM_ATSPI_STATE_SELECTABLE, ATSPI_STATE_SELECTABLE },
+ { ELM_ATSPI_STATE_SELECTED, ATSPI_STATE_SELECTED },
+ { ELM_ATSPI_STATE_SENSITIVE, ATSPI_STATE_SENSITIVE },
+ { ELM_ATSPI_STATE_SHOWING, ATSPI_STATE_SHOWING },
+ { ELM_ATSPI_STATE_SINGLE_LINE, ATSPI_STATE_SINGLE_LINE },
+ { ELM_ATSPI_STATE_STALE, ATSPI_STATE_STALE },
+ { ELM_ATSPI_STATE_TRANSIENT, ATSPI_STATE_TRANSIENT },
+ { ELM_ATSPI_STATE_VERTICAL, ATSPI_STATE_VERTICAL },
+ { ELM_ATSPI_STATE_VISIBLE, ATSPI_STATE_VISIBLE },
+ { ELM_ATSPI_STATE_MANAGES_DESCENDANTS, ATSPI_STATE_MANAGES_DESCENDANTS },
+ { ELM_ATSPI_STATE_INDETERMINATE, ATSPI_STATE_INDETERMINATE },
+ { ELM_ATSPI_STATE_REQUIRED, ATSPI_STATE_REQUIRED },
+ { ELM_ATSPI_STATE_TRUNCATED, ATSPI_STATE_TRUNCATED },
+ { ELM_ATSPI_STATE_ANIMATED, ATSPI_STATE_ANIMATED },
+ { ELM_ATSPI_STATE_INVALID_ENTRY, ATSPI_STATE_INVALID_ENTRY },
+ { ELM_ATSPI_STATE_SUPPORTS_AUTOCOMPLETION, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION },
+ { ELM_ATSPI_STATE_SELECTABLE_TEXT, ATSPI_STATE_SELECTABLE_TEXT },
+ { ELM_ATSPI_STATE_IS_DEFAULT, ATSPI_STATE_IS_DEFAULT },
+ { ELM_ATSPI_STATE_VISITED, ATSPI_STATE_VISITED },
+ { ELM_ATSPI_STATE_LAST_DEFINED, ATSPI_STATE_LAST_DEFINED },
};
static Eldbus_Message *
_accessible_get_role(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
- AtspiRole role = ATSPI_ROLE_INVALID;
+ Eo *obj = _access_object_from_path(obj_path);
+ AtspiRole atspi_role = ATSPI_ROLE_INVALID;
+ Elm_Atspi_Role role;
+
+ eo_do(obj, role = elm_interface_atspi_accessible_role_get());
- eo_do(obj, role = elm_atspi_obj_role_get());
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- eldbus_message_arguments_append(ret, "u", role);
+
+ atspi_role = role > ELM_ATSPI_ROLE_LAST_DEFINED ? ATSPI_ROLE_LAST_DEFINED : elm_roles_to_atspi_roles[role][1];
+ eldbus_message_arguments_append(ret, "u", atspi_role);
return ret;
}
_accessible_get_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
const char *role_name = NULL, *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
+
+ eo_do(obj, role_name = elm_interface_atspi_accessible_role_name_get());
- eo_do(obj, role_name = elm_atspi_obj_role_name_get());
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);
_accessible_get_localized_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
const char *l_role_name = NULL, *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
+
+ eo_do(obj, l_role_name = elm_interface_atspi_accessible_localized_role_name_get());
- eo_do(obj, l_role_name = elm_atspi_obj_localized_role_name_get());
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);
_accessible_get_children(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
Eina_List *children_list = NULL, *l;
Eldbus_Message *ret;
Eldbus_Message_Iter *iter, *iter_array;
- Elm_Atspi_Object *children;
+ Eo *children;
- eo_do(obj, children_list = elm_atspi_obj_children_get());
+ eo_do(obj, children_list = elm_interface_atspi_accessible_children_get());
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
EINA_LIST_FOREACH(children_list, l, children)
- object_append_reference(iter_array, children);
+ _object_append_reference(iter_array, children);
eldbus_message_iter_container_close(iter, iter_array);
eina_list_free(children_list);
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
Eldbus_Message_Iter *iter = eldbus_message_iter_get(ret);
- object_append_reference(iter, _root);
+ _object_append_reference(iter, _root);
return ret;
}
+static uint64_t
+_elm_atspi_state_set_to_atspi_state_set(Elm_Atspi_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][0]))
+ STATE_TYPE_SET(ret, elm_states_to_atspi_state[i][1]);
+ }
+ 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;
- Elm_Atspi_State states = 0;
+ Elm_Atspi_State_Set states;
+ uint64_t atspi_states = 0;
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
if (!obj)
{
iter_array = eldbus_message_iter_container_new(iter, 'a', "u");
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
- eo_do(obj, states = elm_atspi_obj_state_get());
+ eo_do(obj, states = elm_interface_atspi_accessible_state_set_get());
- unsigned int s1 = states & 0xFFFFFFFF;
- unsigned int s2 = (states >> 32) & 0xFFFFFFFF;
+ 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);
_accessible_get_index_in_parent(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
Eldbus_Message *ret;
- unsigned int idx = 0;
+ int idx = -1;
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- eo_do(obj, idx = elm_atspi_obj_index_in_parent_get());
+ eo_do(obj, idx = elm_interface_atspi_accessible_index_in_parent_get());
+
eldbus_message_arguments_append(ret, "i", idx);
return ret;
_accessible_child_at_index(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
- Elm_Atspi_Object *child = NULL;
+ Eo *obj = _access_object_from_path(obj_path);
+ Eo *child = NULL;
+ Eina_List *children = NULL;
int idx;
Eldbus_Message *ret;
Eldbus_Message_Iter *iter;
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
iter = eldbus_message_iter_get(ret);
- eo_do(obj, child = elm_atspi_obj_child_at_index_get(idx));
- object_append_reference(iter, child);
+ eo_do(obj, children = elm_interface_atspi_accessible_children_get());
+
+ child = eina_list_nth(children, idx);
+ _object_append_reference(iter, child);
+ eina_list_free(children);
return ret;
}
{ NULL, NULL, NULL, NULL, 0 }
};
-static Elm_Atspi_Object *
+static Eo *
_access_object_from_path(const char *path)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
unsigned long long eo_ptr = 0;
- Elm_Atspi_Object *eo = NULL;
+ Eo *eo = NULL;
const char *tmp = path;
int len = strlen(ELM_ACCESS_OBJECT_PATH_PREFIX);
return _root;
sscanf(tmp, "%llu", &eo_ptr);
- eo = (Elm_Atspi_Object *) (uintptr_t) eo_ptr;
- return eo_isa(eo, ELM_ATSPI_OBJ_CLASS) ? eo : NULL;
+ eo = (Eo *) (uintptr_t) eo_ptr;
+ return eo_isa(eo, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS) ? eo : NULL;
}
static char *
-_path_from_access_object(Elm_Atspi_Object *eo)
+_path_from_access_object(Eo *eo)
{
char path[256];
if (eo == _root)
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)eo);
+ snprintf(path, sizeof(path), ELM_ACCESS_OBJECT_REFERENCE_TEMPLATE, (unsigned long long) (uintptr_t)eo);
return strdup(path);
}
Eldbus_Message **error EINA_UNUSED)
{
const char *ret = NULL, *obj_path = eldbus_service_object_path_get(interface);
- Elm_Atspi_Object *ret_obj = NULL, *obj = _access_object_from_path(obj_path);
+ Eo *ret_obj = NULL, *obj = _access_object_from_path(obj_path);
+
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
if (!strcmp(property, "Name"))
{
- eo_do(obj, ret = elm_atspi_obj_name_get());
+ eo_do(obj, ret = elm_interface_atspi_accessible_name_get());
if (!ret)
ret = "";
eldbus_message_iter_basic_append(iter, 's', ret);
}
else if (!strcmp(property, "Description"))
{
- eo_do(obj, ret = elm_atspi_obj_description_get());
+ eo_do(obj, ret = elm_interface_atspi_accessible_description_get());
if (!ret)
ret = "";
eldbus_message_iter_basic_append(iter, 's', ret);
}
else if (!strcmp(property, "Parent"))
{
- eo_do(obj, ret_obj = elm_atspi_obj_parent_get());
- AtspiRole role = ATSPI_ROLE_INVALID;
- eo_do(obj, role = elm_atspi_obj_role_get());
- if ((!ret_obj) && (ATSPI_ROLE_APPLICATION == role))
- object_append_desktop_reference(iter);
+ eo_do(obj, ret_obj = elm_interface_atspi_accessible_parent_get());
+ Elm_Atspi_Role role = ELM_ATSPI_ROLE_INVALID;
+ eo_do(obj, role = elm_interface_atspi_accessible_role_get());
+ if ((!ret_obj) && (ELM_ATSPI_ROLE_APPLICATION == role))
+ _object_append_desktop_reference(iter);
else
- object_append_reference(iter, ret_obj);
+ _object_append_reference(iter, ret_obj);
return EINA_TRUE;
}
else if (!strcmp(property, "ChildCount"))
{
Eina_List *l = NULL;
- eo_do(obj, l = elm_atspi_obj_children_get());
+ eo_do(obj, l = elm_interface_atspi_accessible_children_get());
eldbus_message_iter_basic_append(iter, 'i', eina_list_count(l));
eina_list_free(l);
return EINA_TRUE;
};
static void
-object_append_reference(Eldbus_Message_Iter *iter, Elm_Atspi_Object *obj)
+_object_append_reference(Eldbus_Message_Iter *iter, Eo *obj)
{
Eldbus_Message_Iter *iter_struct = eldbus_message_iter_container_new(iter, 'r', NULL);
EINA_SAFETY_ON_NULL_RETURN(iter);
}
static void
-object_append_desktop_reference(Eldbus_Message_Iter *iter)
+_object_append_desktop_reference(Eldbus_Message_Iter *iter)
{
Eldbus_Message_Iter *iter_struct = eldbus_message_iter_container_new(iter, 'r', NULL);
EINA_SAFETY_ON_NULL_RETURN(iter);
Eldbus_Message_Iter *iter_struct, *iter_sub_array;
Eldbus_Message_Iter *iter_array = fdata;
- Elm_Atspi_State states = 0;
- AtspiRole role = ATSPI_ROLE_INVALID;
+ Elm_Atspi_State_Set states;
+ Elm_Atspi_Role role;
- eo_do(data, role = elm_atspi_obj_role_get());
+ eo_do(data, role = elm_interface_atspi_accessible_role_get());
iter_struct = eldbus_message_iter_container_new(iter_array, 'r', NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter_struct, EINA_TRUE);
/* Marshall object path */
- object_append_reference(iter_struct, data);
+ _object_append_reference(iter_struct, data);
/* Marshall application */
- object_append_reference(iter_struct, _root);
+ _object_append_reference(iter_struct, _root);
- Elm_Atspi_Object *parent = NULL;
- eo_do(data, parent = elm_atspi_obj_parent_get());
+ Eo *parent = NULL;
+ eo_do(data, parent = elm_interface_atspi_accessible_parent_get());
/* Marshall parent */
- if ((!parent) && (ATSPI_ROLE_APPLICATION == role))
- object_append_desktop_reference(iter_struct);
+ if ((!parent) && (ELM_ATSPI_ROLE_APPLICATION == role))
+ _object_append_desktop_reference(iter_struct);
else
- object_append_reference(iter_struct, parent);
+ _object_append_reference(iter_struct, parent);
/* Marshall children */
Eina_List *children_list = NULL, *l;
- Elm_Atspi_Object *child;
+ Eo *child;
- eo_do(data, children_list = elm_atspi_obj_children_get());
+ eo_do(data, children_list = elm_interface_atspi_accessible_children_get());
iter_sub_array = eldbus_message_iter_container_new(iter_struct, 'a', "(so)");
EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail);
EINA_LIST_FOREACH(children_list, l, child)
- object_append_reference(iter_sub_array, child);
+ _object_append_reference(iter_sub_array, child);
eldbus_message_iter_container_close(iter_struct, iter_sub_array);
eina_list_free(children_list);
/* Marshall name */
const char *name = NULL;
- eo_do(data, name = elm_atspi_obj_name_get());
+ eo_do(data, name = elm_interface_atspi_accessible_name_get());
if (!name)
name = "";
eldbus_message_iter_basic_append(iter_struct, 's', name);
/* Marshall description */
const char* descritpion = NULL;
- eo_do(data, descritpion = elm_atspi_obj_description_get());
+ eo_do(data, descritpion = elm_interface_atspi_accessible_description_get());
if (!descritpion)
descritpion = "";
eldbus_message_iter_basic_append(iter_struct, 's', descritpion);
iter_sub_array = eldbus_message_iter_container_new(iter_struct, 'a', "u");
EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail);
- eo_do(data, states = elm_atspi_obj_state_get());
+ eo_do(data, states = elm_interface_atspi_accessible_state_set_get());
+
unsigned int s1 = states & 0xFFFFFFFF;
unsigned int s2 = (states >> 32) & 0xFFFFFFFF;
eldbus_message_iter_basic_append(iter_sub_array, 'u', s1);
Eldbus_Message *ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- _cache_update();
-
iter = eldbus_message_iter_get(ret);
iter_array = eldbus_message_iter_container_new(iter, 'a', CACHE_ITEM_SIGNATURE);
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
_component_contains(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y;
Eina_Bool contains = EINA_FALSE;
AtspiCoordType coord_type;
if (!eldbus_message_arguments_get(msg, "iiu", &x, &y, &coord_type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- eo_do(obj, contains = elm_interface_atspi_component_contains(x, y, coord_type));
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, contains = elm_interface_atspi_component_contains(type, x, y));
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
_component_get_accessible_at_point(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y;
- Elm_Atspi_Object *accessible = NULL;
+ Eo *accessible = NULL;
AtspiCoordType coord_type;
Eldbus_Message *ret;
Eldbus_Message_Iter *iter;
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
iter = eldbus_message_iter_get(ret);
- eo_do(obj, accessible = elm_interface_atspi_component_accessible_at_point_get(x, y, coord_type));
- object_append_reference(iter, accessible);
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, accessible = elm_interface_atspi_component_accessible_at_point_get(type, x, y));
+ _object_append_reference(iter, accessible);
return ret;
}
_component_get_extents(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y, w, h;
AtspiCoordType coord_type;
Eldbus_Message *ret;
iter = eldbus_message_iter_get(ret);
- eo_do(obj, elm_interface_atspi_component_extents_get(&x, &y, &w, &h, coord_type));
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, elm_interface_atspi_component_extents_get(type, &x, &y, &w, &h));
iter_struct = eldbus_message_iter_container_new(iter, 'r', NULL);
EINA_SAFETY_ON_NULL_GOTO(iter_struct, fail);
_component_get_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y;
AtspiCoordType coord_type;
Eldbus_Message *ret;
if (!eldbus_message_arguments_get(msg, "u", &coord_type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- eo_do(obj, elm_interface_atspi_component_position_get(&x, &y, coord_type));
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, elm_interface_atspi_component_position_get(type, &x, &y));
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
_component_get_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y;
Eldbus_Message *ret;
return ret;
}
+static AtspiComponentLayer
+_elm_layer_2_atspi_layer(int layer)
+{
+ if (layer <= ELM_OBJECT_LAYER_BACKGROUND) return ATSPI_LAYER_CANVAS;
+ if (layer < ELM_OBJECT_LAYER_FOCUS) return ATSPI_LAYER_WIDGET;
+ if (layer <= ELM_OBJECT_LAYER_TOOLTIP) return ATSPI_LAYER_POPUP;
+
+ return ATSPI_LAYER_OVERLAY;
+}
+
static Eldbus_Message *
_component_get_layer(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int layer = 0;
Eldbus_Message *ret;
+ AtspiComponentLayer atspi_layer;
eo_do(obj, layer = elm_interface_atspi_component_layer_get());
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
- eldbus_message_arguments_append(ret, "u", layer);
+ atspi_layer = _elm_layer_2_atspi_layer(layer);
+ eldbus_message_arguments_append(ret, "u", atspi_layer);
return ret;
}
_component_grab_focus(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
Eldbus_Message *ret;
Eina_Bool focus = EINA_FALSE;
_component_get_alpha(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
Eldbus_Message *ret;
double alpha = 0;
_component_set_extends(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y, w, h;
- Eina_Bool result = EINA_FALSE;
AtspiCoordType coord_type;
Eldbus_Message *ret;
+ Eina_Bool result = EINA_FALSE;
if (!eldbus_message_arguments_get(msg, "iiiiu", &x, &y, &w, &h, &coord_type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- eo_do(obj, result = elm_interface_atspi_component_extents_set(x, y, w, h, coord_type));
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, result = elm_interface_atspi_component_extents_set(type, x, y, w, h));
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
_component_set_position(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int x, y;
Eina_Bool result = EINA_FALSE;
AtspiCoordType coord_type;
if (!eldbus_message_arguments_get(msg, "iiu", &x, &y, &coord_type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
- eo_do(obj, result = elm_interface_atspi_component_position_set(x, y, coord_type));
+ Eina_Bool type = coord_type == ATSPI_COORD_TYPE_SCREEN ? EINA_TRUE : EINA_FALSE;
+ eo_do(obj, result = elm_interface_atspi_component_position_set(type, x, y));
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
_component_set_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
const char *obj_path = eldbus_service_object_path_get(iface);
- Elm_Atspi_Object *obj = _access_object_from_path(obj_path);
+ Eo *obj = _access_object_from_path(obj_path);
int w, h;
Eina_Bool result;
Eldbus_Message *ret;
ATSPI_DBUS_INTERFACE_COMPONENT, component_methods, NULL, NULL, NULL, NULL
};
-static Eina_Bool
-_cache_object_del_cb(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Eldbus_Message *msg;
- Eldbus_Message_Iter *iter;
- char* path;
-
- msg = eldbus_service_signal_new(_cache_interface, ATSPI_OBJECT_CHILD_REMOVED);
- iter = eldbus_message_iter_get(msg);
- object_append_reference(iter, obj);
- path = _path_from_access_object(obj);
-
- eldbus_service_signal_send(_cache_interface, msg);
- eina_hash_del(_cache, path, obj);
-
- eldbus_service_object_unregister(data);
-
- free(path);
- return EO_CALLBACK_CONTINUE;
-}
-
static void
-_cache_object_register_interfaces(const char *path, Elm_Atspi_Object *node)
-{
- Eldbus_Service_Interface *accessible = NULL;
- Eldbus_Service_Interface *events = NULL;
- Eldbus_Service_Interface *window = NULL;
-
- if (eina_hash_find(_cache, path))
- return;
- else
- eina_hash_add(_cache, path, node);
-
- if (!eo_isa(node, ELM_ATSPI_OBJ_CLASS)) return;
-
- accessible = eldbus_service_interface_register(_a11y_bus, path, &accessible_iface_desc);
- events = eldbus_service_interface_register(_a11y_bus, path, &event_iface_desc);
- eo_do(node, eo_key_data_set("atspi_event_interface", events, NULL));
- eo_do(node, eo_event_callback_add(EO_EV_DEL, _cache_object_del_cb, accessible));
-
- if (eo_isa(node, ELM_INTERFACE_ATSPI_COMPONENT_CLASS))
- eldbus_service_interface_register(_a11y_bus, path, &component_iface_desc);
-
- if (eo_isa(node, ELM_INTERFACE_ATSPI_WINDOW_CLASS))
- {
- window = eldbus_service_interface_register(_a11y_bus, path, &window_iface_desc);
- eo_do(node, eo_key_data_set("window_event_interface", window, NULL));
- }
-}
-
-static void
-_cache_object_register(Elm_Atspi_Object *node, Eina_Bool rec)
-{
- EINA_SAFETY_ON_NULL_RETURN(node);
- Eina_List *children_list = NULL, *l;
- Elm_Atspi_Object *child;
- char* path = _path_from_access_object(node);
-
- _cache_object_register_interfaces(path, node);
- free(path);
-
- if (!rec) return;
-
- eo_do(node, children_list = elm_atspi_obj_children_get());
- EINA_LIST_FOREACH(children_list, l, child)
- _cache_object_register(child, rec);
-
- eina_list_free(children_list);
-}
-
-static void
-_on_app_register(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+_on_elm_atspi_bridge_app_register(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
DBG("Application successfuly registered at ATSPI2 bus.");
}
-static Eina_Bool
-_app_register(void)
+EAPI Eina_Bool
+_elm_atspi_bridge_app_register(void)
{
+ if (!_a11y_bus || !_root) return EINA_FALSE;
Eldbus_Message *message = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY,
ATSPI_DBUS_PATH_ROOT,
ATSPI_DBUS_INTERFACE_SOCKET,
"Embed");
Eldbus_Message_Iter *iter = eldbus_message_iter_get(message);
- object_append_reference(iter, _root);
- eldbus_connection_send(_a11y_bus, message, _on_app_register, NULL, -1);
+ _object_append_reference(iter, _root);
+ eldbus_connection_send(_a11y_bus, message, _on_elm_atspi_bridge_app_register, NULL, -1);
return EINA_TRUE;
}
-static void
-_cache_update(void)
+EAPI Eina_Bool
+_elm_atspi_bridge_app_unregister(void)
{
- _cache_object_register(_root, EINA_TRUE);
+ if (!_a11y_bus || !_root) return EINA_FALSE;
+ Eldbus_Message *message = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY,
+ ATSPI_DBUS_PATH_ROOT,
+ ATSPI_DBUS_INTERFACE_SOCKET,
+ "Unembed");
+ Eldbus_Message_Iter *iter = eldbus_message_iter_get(message);
+
+ _object_append_reference(iter, _root);
+ eldbus_connection_send(_a11y_bus, message, NULL, NULL, -1);
+
+ return EINA_TRUE;
}
static void
-_bus_objects_register(void)
+_cache_register(void)
{
_cache_interface = eldbus_service_interface_register(_a11y_bus, CACHE_INTERFACE_PATH, &cache_iface_desc);
}
if (!tokens[2] || *tokens[2] == '\0')
_object_state_broadcast_mask = -1; // broadcast all
else if (!strcmp(tokens[2], "Focused"))
- BIT_FLAG_SET(_object_state_broadcast_mask, ATSPI_STATE_FOCUSED);
+ STATE_TYPE_SET(_object_state_broadcast_mask, ATSPI_STATE_FOCUSED);
else if (!strcmp(tokens[2], "Showing"))
- BIT_FLAG_SET(_object_state_broadcast_mask, ATSPI_STATE_SHOWING);
+ STATE_TYPE_SET(_object_state_broadcast_mask, ATSPI_STATE_SHOWING);
}
else if (!strcmp(tokens[1], "PropertyChange"))
{
if (!tokens[2] || *tokens[2] == '\0')
_object_property_broadcast_mask = -1; //broadcast all
else if (!strcmp(tokens[2], "AccessibleValue"))
- BIT_FLAG_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_VALUE);
+ STATE_TYPE_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_VALUE);
else if (!strcmp(tokens[2], "AccessibleName"))
- BIT_FLAG_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_NAME);
+ STATE_TYPE_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_NAME);
else if (!strcmp(tokens[2], "AccessibleDescription"))
- BIT_FLAG_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_DESCRIPTION);
+ STATE_TYPE_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_DESCRIPTION);
else if (!strcmp(tokens[2], "AccessibleParent"))
- BIT_FLAG_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_PARENT);
+ STATE_TYPE_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_PARENT);
else if (!strcmp(tokens[2], "AccessibleRole"))
- BIT_FLAG_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_ROLE);
+ STATE_TYPE_SET(_object_property_broadcast_mask, ATSPI_OBJECT_PROPERTY_ROLE);
}
else if (!strcmp(tokens[1], "ChildrenChanged"))
{
if (!tokens[2] || *tokens[2] == '\0')
_object_children_broadcast_mask = -1; // broadcast all
else if (!strcmp(tokens[2], "add"))
- BIT_FLAG_SET(_object_children_broadcast_mask, ATSPI_OBJECT_CHILD_ADDED);
+ STATE_TYPE_SET(_object_children_broadcast_mask, ATSPI_OBJECT_CHILD_ADDED);
else if (!strcmp(tokens[2], "remove"))
- BIT_FLAG_SET(_object_children_broadcast_mask, ATSPI_OBJECT_CHILD_ADDED);
+ STATE_TYPE_SET(_object_children_broadcast_mask, ATSPI_OBJECT_CHILD_ADDED);
}
}
else if (!strcmp(tokens[0], "Window"))
if (!tokens[1] || *tokens[1] == '\0')
_window_signal_broadcast_mask = -1; // broadcast all
else if (!strcmp(tokens[1], "Create"))
- BIT_FLAG_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_CREATE);
+ STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_CREATE);
else if (!strcmp(tokens[1], "Activate"))
- BIT_FLAG_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_ACTIVATE);
+ STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_ACTIVATE);
else if (!strcmp(tokens[1], "Deactivate"))
- BIT_FLAG_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_DEACTIVATE);
+ STATE_TYPE_SET(_window_signal_broadcast_mask, ATSPI_WINDOW_EVENT_DEACTIVATE);
}
free(tokens[0]);
static void
_registered_listeners_get(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
- DBG("Updating ATSPI2 clients registered events list.");
+ DBG("Updating registered ATSPI signals list.");
_object_children_broadcast_mask = 0;
_object_property_broadcast_mask = 0;
_object_state_broadcast_mask = 0;
_registered_events_list_update();
}
-static void
-_send_signal_state_changed(Elm_Atspi_Object *obj, AtspiStateType type, Eina_Bool new_value)
+static Eina_Bool
+_state_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
{
Eldbus_Message *msg;
Eldbus_Message_Iter *iter, *viter;
- Eldbus_Service_Interface *events = NULL;
- char *desc;
+ Eldbus_Service_Interface *events = data;
+ Elm_Atspi_Event_State_Changed_Data *state_data = event_info;
+ char *type_desc;
- if (!BIT_FLAG_GET(_object_state_broadcast_mask, type))
+ if (!STATE_TYPE_GET(_object_state_broadcast_mask, state_data->type))
{
- DBG("Masking event: %d", type);
- return;
+ DBG("Masking event: %d", state_data->type);
+ return EINA_FALSE;
+ }
+
+ if (!events)
+ {
+ ERR("Atspi object does not have event interface!");
+ return EINA_FALSE;
}
- switch (type) {
- case ATSPI_STATE_FOCUSED:
- desc = "focused";
+ switch (state_data->type) {
+ case ELM_ATSPI_STATE_FOCUSED:
+ type_desc = "focused";
break;
- case ATSPI_STATE_SHOWING:
- desc = "showing";
+ case ELM_ATSPI_STATE_SHOWING:
+ type_desc = "showing";
break;
- case ATSPI_STATE_VISIBLE:
- desc = "visible";
+ case ELM_ATSPI_STATE_VISIBLE:
+ type_desc = "visible";
break;
default:
- desc = NULL;
+ return EINA_FALSE;
}
- eo_do(obj, events = eo_key_data_get("atspi_event_interface"));
- if (!events)
- {
- ERR("Atspi object does not have event interface!");
- return;
- }
msg = eldbus_service_signal_new(events, ATSPI_OBJECT_EVENT_STATE_CHANGED);
iter = eldbus_message_iter_get(msg);
- eldbus_message_iter_arguments_append(iter, "sii", desc, new_value, 0);
+ eldbus_message_iter_arguments_append(iter, "sii", type_desc, state_data->new_value, 0);
viter = eldbus_message_iter_container_new(iter, 'v', "i");
- EINA_SAFETY_ON_NULL_RETURN(viter);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(viter, EINA_FALSE);
eldbus_message_iter_arguments_append(viter, "i", 0);
eldbus_message_iter_container_close(iter, viter);
- object_append_reference(iter, obj);
+ _object_append_reference(iter, obj);
eldbus_service_signal_send(events, msg);
- DBG("signal sent StateChanged:%s:%d", desc, new_value);
+ DBG("signal sent StateChanged:%s:%d", type_desc, state_data->new_value);
+
+ return EINA_TRUE;
}
-static void
-_send_signal_property_changed(Elm_Atspi_Object *ao, enum _Atspi_Object_Property prop)
+static Eina_Bool
+_property_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
{
- const char *desc;
Eldbus_Message *msg;
Eldbus_Message_Iter *iter, *siter, *viter;
- Eldbus_Service_Interface *events = NULL;
-
- if (!BIT_FLAG_GET(_object_property_broadcast_mask, prop))
- return;
+ Eldbus_Service_Interface *events = data;
+ const char *property = event_info;
+ char *path, *atspi_desc;
+ enum _Atspi_Object_Property prop = ATSPI_OBJECT_PROPERTY_LAST;
- switch(prop)
- {
- case ATSPI_OBJECT_PROPERTY_NAME:
- desc = "accessible-name";
- break;
- case ATSPI_OBJECT_PROPERTY_DESCRIPTION:
- desc = "accessible-description";
- break;
- case ATSPI_OBJECT_PROPERTY_ROLE:
- desc = "accessible-role";
- break;
- case ATSPI_OBJECT_PROPERTY_PARENT:
- desc = "accessible-parent";
- break;
- case ATSPI_OBJECT_PROPERTY_VALUE:
- desc = "accessible-value";
- break;
- default:
- desc = NULL;
- }
- eo_do(ao, events = eo_key_data_get("atspi_event_interface"));
if (!events)
{
ERR("Atspi object does not have event interface!");
- return;
+ return EINA_FALSE;
+ }
+
+ if (!strcmp(property, "parent"))
+ {
+ prop = ATSPI_OBJECT_PROPERTY_PARENT;
+ atspi_desc = "accessible-parent";
+ }
+ else if (!strcmp(property, "name"))
+ {
+ prop = ATSPI_OBJECT_PROPERTY_NAME;
+ atspi_desc = "accessible-name";
+ }
+ else if (!strcmp(property, "description"))
+ {
+ prop = ATSPI_OBJECT_PROPERTY_PARENT;
+ atspi_desc = "accessible-description";
+ }
+ else if (!strcmp(property, "role"))
+ {
+ prop = ATSPI_OBJECT_PROPERTY_PARENT;
+ atspi_desc = "accessible-role";
+ }
+
+ if (prop == ATSPI_OBJECT_PROPERTY_LAST)
+ {
+ ERR("Unrecognized property name!");
+ return EINA_FALSE;
}
+ if (!STATE_TYPE_GET(_object_property_broadcast_mask, prop))
+ {
+ DBG("Masking property %s changed event.", property);
+ return EINA_FALSE;
+ }
+
msg = eldbus_service_signal_new(events, ATSPI_OBJECT_EVENT_PROPERTY_CHANGED);
- EINA_SAFETY_ON_NULL_RETURN(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
iter = eldbus_message_iter_get(msg);
siter = eldbus_message_iter_container_new(iter, 'r', NULL);
- EINA_SAFETY_ON_NULL_RETURN(siter);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(siter, EINA_FALSE);
- eldbus_message_iter_arguments_append(siter, "suu", desc, 0, 0);
+ eldbus_message_iter_arguments_append(siter, "suu", atspi_desc, 0, 0);
viter = eldbus_message_iter_container_new(siter, 'v', "s");
- EINA_SAFETY_ON_NULL_RETURN(viter);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(viter, EINA_FALSE);
- eldbus_message_iter_arguments_append(viter, "s", _path_from_access_object(ao));
+ path = _path_from_access_object(obj);
+ eldbus_message_iter_arguments_append(viter, "s", path);
+ free(path);
eldbus_message_iter_arguments_append(siter, "v", viter);
eldbus_message_iter_container_close(siter, viter);
eldbus_message_iter_container_close(iter, siter);
eldbus_service_signal_send(events, msg);
- DBG("signal sent PropertyChanged:%s", desc);
+ DBG("signal sent PropertyChanged:%s", property);
+
+ return EINA_TRUE;
}
-static void
-_send_signal_children_changed(Elm_Atspi_Object *parent, Elm_Atspi_Object *child, enum _Atspi_Object_Child_Event_Type type)
+static Eina_Bool
+_idler_cb(void *data EINA_UNUSED)
{
- Eldbus_Service_Interface *events = NULL;
+ Eo *obj;
+ EINA_LIST_FREE(_pending_objects, obj)
+ _cache_build(obj);
+ _pending_objects = NULL;
+ _cache_update_idler = NULL;
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
+{
+ Eldbus_Service_Interface *events = data;
Eldbus_Message_Iter *iter, *viter;
Eldbus_Message *msg;
- const char *desc = NULL;
- unsigned int idx = 0;
+ const char *atspi_desc = NULL;
+ Elm_Atspi_Event_Children_Changed_Data *ev_data = event_info;
+ int idx;
+ enum _Atspi_Object_Child_Event_Type type;
- if (!BIT_FLAG_GET(_object_children_broadcast_mask, type))
- return;
+ type = ev_data->is_added ? ATSPI_OBJECT_CHILD_ADDED : ATSPI_OBJECT_CHILD_REMOVED;
+
+ // update cached objects
+ if (ev_data->is_added)
+ {
+ _pending_objects = eina_list_append(_pending_objects, obj);
+ if (!_cache_update_idler)
+ _cache_update_idler = ecore_idler_add(_idler_cb, NULL);
+ }
- _cache_object_register(parent, EINA_FALSE);
- _cache_object_register(child, EINA_FALSE);
+ if (!STATE_TYPE_GET(_object_children_broadcast_mask, type))
+ return EINA_FALSE;
- eo_do(parent, events = eo_key_data_get("atspi_event_interface"));
if (!events)
{
- ERR("Atspi object does not have event interface! %p %p %s", parent, _root, eo_class_name_get(eo_class_get(parent)));
- return;
+ ERR("Atspi object does not have event interface! %p %s", obj, eo_class_name_get(eo_class_get(obj)));
+ return EINA_FALSE;
}
switch(type)
{
case ATSPI_OBJECT_CHILD_ADDED:
- desc = "add";
- eo_do(child, idx = elm_atspi_obj_index_in_parent_get());
+ atspi_desc = "add";
+ eo_do(ev_data->child, idx = elm_interface_atspi_accessible_index_in_parent_get());
break;
case ATSPI_OBJECT_CHILD_REMOVED:
- desc = "remove";
+ atspi_desc = "remove";
idx = -1;
break;
}
+
+ if (!atspi_desc) return EINA_FALSE;
+
msg = eldbus_service_signal_new(events, ATSPI_OBJECT_EVENT_CHILDREN_CHANGED);
- EINA_SAFETY_ON_NULL_RETURN(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
iter = eldbus_message_iter_get(msg);
- eldbus_message_iter_arguments_append(iter, "sii", desc, idx, 0);
+ eldbus_message_iter_arguments_append(iter, "sii", atspi_desc, idx, 0);
viter = eldbus_message_iter_container_new(iter, 'v', "(so)");
- EINA_SAFETY_ON_NULL_RETURN(viter);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(viter, EINA_FALSE);
- object_append_reference(viter, child);
+ _object_append_reference(viter, ev_data->child);
eldbus_message_iter_container_close(iter, viter);
- object_append_reference(iter, _root);
+ _object_append_reference(iter, _root);
eldbus_service_signal_send(events, msg);
- DBG("signal sent childrenChanged:%s:%d", desc, idx);
+ DBG("signal sent childrenChanged:%s:%d", atspi_desc, idx);
+
+ return EINA_TRUE;
}
-static void
-_send_signal_window(Elm_Atspi_Object *eo, enum _Atspi_Window_Signals type)
+static Eina_Bool
+_window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
{
- const char *desc;
+ const char *event_desc;
Eldbus_Message *msg;
Eldbus_Message_Iter *iter, *viter;
- Eldbus_Service_Interface *window = NULL;
+ Eldbus_Service_Interface *window = data;
+ enum _Atspi_Window_Signals type;
- if (!BIT_FLAG_GET(_window_signal_broadcast_mask, type))
- return;
-
- eo_do(eo, window = eo_key_data_get("window_event_interface"));
- if (!window)
+ if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED)
{
- ERR("Atspi object does not have window interface!");
- return;
+ event_desc = "Created";
+ type = ATSPI_WINDOW_EVENT_CREATE;
+ }
+ else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED)
+ {
+ event_desc = "Deactivate";
+ type = ATSPI_WINDOW_EVENT_DEACTIVATE;
+ }
+ else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED)
+ {
+ event_desc = "Activate";
+ type = ATSPI_WINDOW_EVENT_ACTIVATE;
+ }
+ else
+ {
+ WRN("ATSPI Window event not handled");
+ return EINA_FALSE;
}
- switch(type)
+ if (!STATE_TYPE_GET(_window_signal_broadcast_mask, type))
+ return EINA_FALSE;
+
+ if (!window || !_a11y_bus)
{
- case ATSPI_WINDOW_EVENT_DEACTIVATE:
- desc = "Deactivate";
- break;
- case ATSPI_WINDOW_EVENT_ACTIVATE:
- desc = "Activate";
- break;
- default:
- desc = "";
+ ERR("A11Y connection closed. Unable to send ATSPI event.");
+ return EINA_FALSE;
}
msg = eldbus_service_signal_new(window, type);
- EINA_SAFETY_ON_NULL_RETURN(msg);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
iter = eldbus_message_iter_get(msg);
- eldbus_message_iter_arguments_append(iter, "sii", desc, 0, 0);
+ eldbus_message_iter_arguments_append(iter, "sii", event_desc, 0, 0);
viter = eldbus_message_iter_container_new(iter, 'v', "i");
- EINA_SAFETY_ON_NULL_RETURN(viter);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(viter, EINA_FALSE);
eldbus_message_iter_arguments_append(viter, "i", 0);
eldbus_message_iter_container_close(iter, viter);
- object_append_reference(iter, eo);
+ _object_append_reference(iter, obj);
eldbus_service_signal_send(window, msg);
- DBG("signal sent Window:%s", desc);
-}
-
-static Eina_Bool
-_handle_atspi_event(void *data EINA_UNUSED, Elm_Atspi_Object *ao, const Eo_Event_Description *desc, void *event_info)
-{
- if (desc == ELM_ATSPI_OBJECT_EVENT_NAME_CHANGED)
- _send_signal_property_changed(ao, ATSPI_OBJECT_PROPERTY_NAME);
- else if (desc == ELM_ATSPI_OBJECT_EVENT_STATE_CHANGED)
- {
- int *event_data = event_info;
- _send_signal_state_changed(ao, (AtspiStateType)event_data[0], (Eina_Bool)event_data[1]);
- }
- else if (desc == ELM_ATSPI_OBJECT_EVENT_CHILD_ADDED)
- _send_signal_children_changed(ao, event_info, ATSPI_OBJECT_CHILD_ADDED);
- else if (desc == ELM_ATSPI_OBJECT_EVENT_CHILD_REMOVED)
- _send_signal_children_changed(ao, event_info, ATSPI_OBJECT_CHILD_REMOVED);
- else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED)
- _send_signal_window(ao, ATSPI_WINDOW_EVENT_ACTIVATE);
- else if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED)
- _send_signal_window(ao, ATSPI_WINDOW_EVENT_DEACTIVATE);
-
+ DBG("signal sent Window:%s", event_desc);
return EINA_TRUE;
}
// register signal handlers in order to update list of registered listeners of ATSPI-Clients
_register_hdl = eldbus_signal_handler_add(_a11y_bus, ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_REGISTRY, ATSPI_DBUS_INTERFACE_REGISTRY, "EventListenerRegistered", _handle_listener_change, NULL);
_unregister_hdl = eldbus_signal_handler_add(_a11y_bus, ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_REGISTRY, ATSPI_DBUS_INTERFACE_REGISTRY, "EventListenerDeregistered", _handle_listener_change, NULL);
+}
+
+static Eina_Bool
+_on_cache_item_del(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ char *path;
+ path = _path_from_access_object(obj);
+ eina_hash_del(_cache, path, obj);
+ free(path);
- // handle incoming events from Elm_Atspi_Objects
- _elm_atspi_object_global_callback_add(_handle_atspi_event, NULL);
+ return EINA_TRUE;
+}
+
+static void
+_cache_build(void *obj)
+{
+ Eina_List *children;
+ Eo *child;
+ char *path = NULL;
+
+ if (!eo_isa(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ return;
+
+ path = _path_from_access_object(obj);
+ if (!eina_hash_find(_cache, path))
+ {
+ eina_hash_add(_cache, path, obj);
+ _object_register(obj, path);
+ eo_do(obj, eo_event_callback_add(EO_EV_DEL, _on_cache_item_del, NULL));
+ }
+ free(path);
+
+ eo_do(obj, children = elm_interface_atspi_accessible_children_get());
+ EINA_LIST_FREE(children, child)
+ _cache_build(child);
}
static void
{
_a11y_bus = eldbus_address_connection_get(socket_addr);
- _cache_update();
- _bus_objects_register();
- _app_register();
+ _cache_register();
_event_handlers_register();
+ _elm_atspi_bridge_app_register();
+ _cache_build(_root);
}
static void
eldbus_connection_unref(session_bus);
}
+static void _object_register(Eo *obj, char *path)
+{
+ Eldbus_Service_Interface *infc = NULL;
+
+ if (!eo_isa(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ {
+ WRN("Unable to register class w/o Elm_Interface_Atspi_Accessible!");
+ return;
+ }
+
+ if (_a11y_bus)
+ {
+ eldbus_service_interface_register(_a11y_bus, path, &accessible_iface_desc);
+
+ infc = eldbus_service_interface_register(_a11y_bus, path, &event_iface_desc);
+ eo_do(obj, eo_key_data_set("event_interface", infc, NULL));
+
+ eo_do(obj, eo_event_callback_array_add(_events_cb(), infc));
+
+ if (eo_isa(obj, ELM_INTERFACE_ATSPI_COMPONENT_CLASS))
+ {
+ infc = eldbus_service_interface_register(_a11y_bus, path, &component_iface_desc);
+ eo_do(obj, eo_key_data_set("component_interface", infc, NULL));
+ }
+
+ if (eo_isa(obj, ELM_INTERFACE_ATSPI_WINDOW_CLASS))
+ {
+ infc = eldbus_service_interface_register(_a11y_bus, path, &window_iface_desc);
+ eo_do(obj, eo_key_data_set("window_interface", infc, NULL));
+
+ eo_do(obj, eo_event_callback_array_add(_window_cb(), infc));
+ }
+ }
+}
+
+static void _object_unregister(void *obj)
+{
+ Eldbus_Service_Interface *infc = NULL;
+
+ eo_do(obj, infc = eo_key_data_get("event_interface"));
+ if (_a11y_bus && infc)
+ {
+ eldbus_service_object_unregister(infc);
+ eo_do(obj, eo_key_data_set("event_interface", NULL, NULL));
+ }
+
+ eo_do(obj, eo_event_callback_del(EO_EV_DEL, _on_cache_item_del, NULL));
+
+ if (eo_isa(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ eo_do(obj, eo_event_callback_array_del(_events_cb(), infc));
+
+ if (eo_isa(obj, ELM_INTERFACE_ATSPI_WINDOW_CLASS))
+ {
+ eo_do(obj, infc = eo_key_data_get("window_interface"));
+ eo_do(obj, eo_event_callback_array_del(_window_cb(), infc));
+ }
+}
+
void
_elm_atspi_bridge_init(void)
{
Eldbus_Message *msg;
Eldbus_Connection *session_bus;
- if (!_init_count && _elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ if (!_init_count && (_elm_config->access_mode != ELM_ACCESS_MODE_OFF))
{
- _elm_atspi_object_init();
+ _elm_atspi_init();
+
+ _root = _elm_atspi_root_get();
+ if (!_root)
+ {
+ ERR("Unable to get root object");
+ return;
+ }
+
session_bus = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
- EINA_SAFETY_ON_NULL_RETURN(session_bus);
+ EINA_SAFETY_ON_NULL_RETURN(session_bus);
msg = eldbus_message_method_call_new(A11Y_DBUS_NAME, A11Y_DBUS_PATH, A11Y_DBUS_INTERFACE, "GetAddress");
- if (!msg)
- {
- eldbus_connection_unref(session_bus);
- return;
- }
+ if (!msg)
+ {
+ eldbus_connection_unref(session_bus);
+ return;
+ }
eldbus_connection_send(session_bus, msg, _a11y_bus_address_get, session_bus, -1);
- _cache = eina_hash_string_superfast_new(NULL);
- _root = _elm_atspi_root_object_get();
+ _cache = eina_hash_string_superfast_new(_object_unregister);
_init_count = 1;
}
}
{
if (_init_count)
{
- _elm_atspi_object_shutdown();
+ _elm_atspi_shutdown();
- if (_register_hdl)
- eldbus_signal_handler_del(_register_hdl);
- _register_hdl = NULL;
+ if (_cache_update_idler)
+ ecore_idler_del(_cache_update_idler);
+ _cache_update_idler = NULL;
- if (_unregister_hdl)
- eldbus_signal_handler_del(_unregister_hdl);
- _unregister_hdl = NULL;
+ if (_pending_objects)
+ eina_list_free(_pending_objects);
+ _pending_objects = NULL;
- if (_cache_interface)
- eldbus_service_object_unregister(_cache_interface);
- _cache_interface = NULL;
+ if (_cache)
+ eina_hash_free(_cache);
+ _cache = NULL;
if (_a11y_bus)
eldbus_connection_unref(_a11y_bus);
_a11y_bus = NULL;
- if (_cache)
- eina_hash_free(_cache);
- _cache = NULL;
-
_init_count = 0;
+ _root = NULL;
}
}
+++ /dev/null
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
-#define ELM_ATSPI_OBJECT_PROTECTED
-#include "atspi/atspi-constants.h"
-
-#include <Elementary.h>
-#include "elm_widget.h"
-#include "elm_priv.h"
-#include "assert.h"
-
-static Elm_Atspi_Object *_app;
-static Eina_List *_global_callbacks;
-
-typedef struct _Elm_Atspi_Global_Callback_Info Elm_Atspi_Global_Callback_Info;
-
-struct _Elm_Atspi_Global_Callback_Info
-{
- Eo_Event_Cb cb;
- void *user_data;
-};
-
-const char* Atspi_Name[] = {
- "invalid",
- "accelerator label",
- "alert",
- "animation",
- "arrow",
- "calendar",
- "canvas",
- "check box",
- "check menu item",
- "color chooser",
- "column header",
- "combo box",
- "dateeditor",
- "desktop icon",
- "desktop frame",
- "dial",
- "dialog",
- "directory pane",
- "drawing area",
- "file chooser",
- "filler",
- "focus traversable",
- "font chooser",
- "frame",
- "glass pane",
- "html container",
- "icon",
- "image",
- "internal frame",
- "label",
- "layered pane",
- "list",
- "list item",
- "menu",
- "menu bar",
- "menu item",
- "option pane",
- "page tab",
- "page tab list",
- "panel",
- "password text",
- "popup menu",
- "progress bar",
- "push button",
- "radio button",
- "radio menu item",
- "root pane",
- "row header",
- "scroll bar",
- "scroll pane",
- "separator",
- "slider",
- "spin button",
- "split pane",
- "status bar",
- "table",
- "table cell",
- "table column header",
- "table row header",
- "tearoff menu item",
- "terminal",
- "text",
- "toggle button",
- "tool bar",
- "tool tip",
- "tree",
- "tree table",
- "unknown",
- "viewport",
- "window",
- "extended",
- "header",
- "footer",
- "paragraph",
- "ruler",
- "application",
- "autocomplete",
- "editbar",
- "embedded",
- "entry",
- "chart",
- "caption",
- "document frame",
- "heading",
- "page",
- "section",
- "redundant object",
- "form",
- "link",
- "input method window",
- "table row",
- "tree item",
- "document spreadsheet",
- "document presentation",
- "document text",
- "document web",
- "document email",
- "comment",
- "list box",
- "grouping",
- "image map",
- "notification",
- "info bar",
- "last defined"
-};
-
-extern Eina_List *_elm_win_list;
-
-static void
-_eo_emit_state_changed_event(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Elm_Atspi_Object *ao = data;
- int event_data[2] = {ATSPI_STATE_VISIBLE, 1};
- eo_do(ao, eo_event_callback_call(ELM_ATSPI_OBJECT_EVENT_STATE_CHANGED, &event_data[0]));
-}
-
-EOLIAN static void
-_elm_atspi_object_eo_base_constructor(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *internal_obj = NULL;
- eo_do_super(obj, ELM_ATSPI_OBJ_CLASS, eo_constructor());
-
- eo_do(obj, internal_obj = eo_parent_get());
-
- /* Evas_Object can only hold refs to atspi-object */
- assert(eo_isa(internal_obj, EVAS_OBJ_SMART_CLASS));
-
- evas_object_data_set(internal_obj, "_atspi_object", obj);
- evas_object_event_callback_add(internal_obj, EVAS_CALLBACK_SHOW, _eo_emit_state_changed_event, obj);
-}
-
-EOLIAN static Elm_Atspi_Object *
-_elm_atspi_object_child_at_index_get(Eo *obj, void *_pd EINA_UNUSED, int idx)
-{
- Elm_Atspi_Object *ao = NULL;
- Eina_List *children = NULL;
-
- eo_do(obj, children = elm_atspi_obj_children_get());
- if (!children) return NULL;
-
- ao = eina_list_nth(children, idx);
- eina_list_free(children);
- return ao;
-}
-
-EOLIAN static Evas_Object *
-_elm_atspi_object_object_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *ret = NULL;
- eo_do(obj, ret = eo_parent_get());
- return ret;
-}
-
-EOLIAN static unsigned int
-_elm_atspi_object_index_in_parent_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- unsigned int idx = 0;
- Elm_Atspi_Object *chld, *parent = NULL;
- Eina_List *l, *children = NULL;
- unsigned int tmp = 0;
-
- eo_do(obj, parent = elm_atspi_obj_parent_get());
- if (!parent) return 0;
- eo_do(parent, children = elm_atspi_obj_children_get());
-
- EINA_LIST_FOREACH(children, l, chld)
- {
- if (chld == obj)
- {
- idx = tmp;
- break;
- }
- tmp++;
- }
- if (tmp == eina_list_count(children))
- ERR("Access object not present in parent's children list!");
-
- eina_list_free(children);
-
- return idx;
-}
-
-EOLIAN static const char*
-_elm_atspi_object_role_name_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- AtspiRole role = ATSPI_ROLE_INVALID;
-
- eo_do(obj, role = elm_atspi_obj_role_get());
-
- if (role >= ATSPI_ROLE_LAST_DEFINED)
- {
- ERR("Invalid role enum for atspi-object: %d.", role);
- return NULL;
- }
-
- return Atspi_Name[role];
-}
-
-EOLIAN static const char*
-_elm_atspi_object_description_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- return NULL;
-}
-
-EOLIAN static const char*
-_elm_atspi_object_localized_role_name_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- const char *name = NULL;
-
- eo_do(obj, name = elm_atspi_obj_role_name_get());
- if (!name) return NULL;
-#ifdef ENABLE_NLS
- return gettext(name);
-#else
- return name;
-#endif
-}
-
-EOLIAN static Elm_Atspi_State
-_elm_atspi_object_state_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *evobj = NULL;
- Elm_Atspi_State states = 0;
- eo_do(obj, evobj = elm_atspi_obj_object_get());
-
- if (evas_object_visible_get(evobj))
- BIT_FLAG_SET(states, ATSPI_STATE_VISIBLE);
-
- return states;
-}
-
-EOLIAN static Evas_Object *
-_elm_atspi_object_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, int x, int y, AtspiCoordType type)
-{
- int ee_x, ee_y;
- Eina_List *l, *objs;
- Evas_Object *evobj = NULL;
- Evas_Object *ret = NULL;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
-
- if (!evobj) return NULL;
- if (type == ATSPI_COORD_TYPE_SCREEN)
- {
- Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(evobj));
- if (!ee) return NULL;
- ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
- x -= ee_x;
- y -= ee_y;
- }
- objs = evas_objects_at_xy_get(evas_object_evas_get(evobj), x, y, EINA_TRUE, EINA_TRUE);
- EINA_LIST_FOREACH(objs, l, evobj)
- {
- // return first only, test if there is atspi interface for eo
- Elm_Atspi_Object *acc = _elm_atspi_factory_construct(evobj);
- if (acc)
- {
- ret = evobj;
- break;
- }
- }
- eina_list_free(objs);
- return ret;
-}
-
-EOLIAN static void
-_elm_atspi_object_elm_interface_atspi_component_extents_get(Eo *obj, void *_pd EINA_UNUSED, int *x, int *y, int *w, int *h, AtspiCoordType type)
-{
- int ee_x, ee_y;
- Evas_Object *evobj = NULL;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- if (!evobj) return;
-
- evas_object_geometry_get(evobj, x, y, w, h);
- if (type == ATSPI_COORD_TYPE_SCREEN)
- {
- Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(evobj));
- if (!ee) return;
- ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
- if (x) *x += ee_x;
- if (y) *y += ee_y;
- }
-}
-
-EOLIAN static Eina_Bool
-_elm_atspi_object_elm_interface_atspi_component_extents_set(Eo *obj, void *_pd EINA_UNUSED, int x, int y, int w, int h, AtspiCoordType type)
-{
- int wx, wy;
- Evas_Object *evobj = NULL;
-
- if ((x < 0) || (y < 0) || (w < 0) || (h < 0)) return EINA_FALSE;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- if (!evobj) return EINA_FALSE;
-
- if (type == ATSPI_COORD_TYPE_SCREEN)
- {
- Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(evobj));
- if (!ee) return EINA_FALSE;
- evas_object_geometry_get(evobj, &wx, &wy, NULL, NULL);
- ecore_evas_move(ee, x - wx, y - wy);
- }
- else
- evas_object_move(evobj, x, y);
-
- evas_object_resize(evobj, w, h);
- return EINA_TRUE;
-}
-
-EOLIAN static int
-_elm_atspi_object_elm_interface_atspi_component_layer_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Object_Layer layer;
- Evas_Object *evobj = NULL;
- AtspiComponentLayer spi_layer;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- if (!evobj) return 0;
-
- layer = evas_object_layer_get(evobj);
- switch (layer) {
- case ELM_OBJECT_LAYER_BACKGROUND:
- spi_layer = ATSPI_LAYER_BACKGROUND;
- break;
- case ELM_OBJECT_LAYER_FOCUS:
- case ELM_OBJECT_LAYER_TOOLTIP:
- case ELM_OBJECT_LAYER_CURSOR:
- spi_layer = ATSPI_LAYER_OVERLAY;
- break;
- default:
- spi_layer = ATSPI_LAYER_WIDGET;
- }
- return spi_layer;
-}
-
-EOLIAN static int
-_elm_atspi_object_elm_interface_atspi_component_z_order_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- // FIXME
- return 0;
-}
-
-EOLIAN static Eina_Bool
-_elm_atspi_object_eo_base_event_callback_call(Eo *obj, void *_pd EINA_UNUSED,
- const Eo_Event_Description *desc, const void *event_info)
-{
- Elm_Atspi_Global_Callback_Info *info;
- Eina_List *l;
- Eina_Bool ret = EINA_FALSE;
-
- EINA_LIST_FOREACH(_global_callbacks, l, info)
- {
- if (info->cb) info->cb(info->user_data, obj, desc, (void *)event_info);
- }
-
- eo_do_super(obj, ELM_ATSPI_OBJ_CLASS, ret = eo_event_callback_call(desc, (void *) event_info));
- return ret;
-}
-
-EOLIAN static double
-_elm_atspi_object_elm_interface_atspi_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *evobj = NULL;
- int alpha;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- if (!evobj) return 0.0;
-
- evas_object_color_get(evobj, NULL, NULL, NULL, &alpha);
- return (double)alpha / 255.0;
-}
-
-
-#include "elm_interface_atspi_window.eo.c"
-
-static void
-_emit_atspi_state_changed_focused_event(void *data, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Elm_Atspi_Object *ao = data;
- int evdata[2] = {ATSPI_STATE_FOCUSED, 1};
- eo_do(ao, eo_event_callback_call(ELM_ATSPI_OBJECT_EVENT_STATE_CHANGED, &evdata[0]));
-}
-
-static void
-_emit_atspi_state_changed_unfocused_event(void *data, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Elm_Atspi_Object *ao = data;
- int evdata[2] = {ATSPI_STATE_FOCUSED, 0};
- eo_do(ao, eo_event_callback_call(ELM_ATSPI_OBJECT_EVENT_STATE_CHANGED, &evdata[0]));
-}
-
-EOLIAN static void
-_elm_widget_access_object_eo_base_constructor(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *internal_obj = NULL;
- eo_do_super(obj, ELM_WIDGET_ACCESS_OBJECT_CLASS, eo_constructor());
-
- eo_do(obj, internal_obj = eo_parent_get());
-
- /* Evas_Object can only hold refs to atspi-object */
- assert(eo_isa(internal_obj, ELM_OBJ_WIDGET_CLASS));
-
- evas_object_smart_callback_add(internal_obj, "focused", _emit_atspi_state_changed_focused_event, obj);
- evas_object_smart_callback_add(internal_obj, "unfocused", _emit_atspi_state_changed_unfocused_event, obj);
-}
-
-EOLIAN static const char*
-_elm_widget_access_object_elm_atspi_object_name_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *widget = NULL;
-
- eo_do(obj, widget = elm_atspi_obj_object_get());
- return elm_object_text_get(widget);
-}
-
-EOLIAN static AtspiRole
-_elm_widget_access_object_elm_atspi_object_role_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- const char *type;
- AtspiRole role;
- Evas_Object *widget = NULL;
- eo_do(obj, widget = elm_atspi_obj_object_get());
- if (!widget) return ATSPI_ROLE_INVALID;
- type = evas_object_type_get(widget);
-
- // FIXME make it hash or cast some first bytes to int.
- if (!strcmp(type, "elm_win"))
- role = ATSPI_ROLE_WINDOW;
- else if (!strcmp(type, "elm_button"))
- role = ATSPI_ROLE_PUSH_BUTTON;
- else
- role = ATSPI_ROLE_UNKNOWN;
-
- return role;
-}
-
-EOLIAN static Elm_Atspi_Object*
-_elm_widget_access_object_elm_atspi_object_parent_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *widget = NULL;
-
- eo_do(obj, widget = elm_atspi_obj_object_get());
- widget = elm_object_parent_widget_get(widget);
-
- if (widget)
- return _elm_atspi_factory_construct(widget);
- else // if parent is not found, attach it to atspi root object.
- return _elm_atspi_root_object_get();
-}
-
-EOLIAN static Eina_List*
-_elm_widget_access_object_elm_atspi_object_children_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *widget = NULL;
- Eina_List *l, *accs = NULL;
- Elm_Widget_Smart_Data *sd;
- Elm_Atspi_Object *aobj;
-
- eo_do(obj, widget = elm_atspi_obj_object_get());
-
- sd = eo_data_scope_get(widget, ELM_OBJ_WIDGET_CLASS);
- if (!sd) return NULL;
-
- EINA_LIST_FOREACH(sd->subobjs, l, widget)
- {
- if (!elm_object_widget_check(widget)) continue;
- aobj = _elm_atspi_factory_construct(widget);
- if (aobj)
- accs = eina_list_append(accs, aobj);
- }
- return accs;
-}
-
-EOLIAN static Elm_Atspi_State
-_elm_widget_access_object_elm_atspi_object_state_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *widget = NULL;
- Elm_Atspi_State states = 0;
- eo_do(obj, widget = elm_atspi_obj_object_get());
-
- eo_do_super(obj, ELM_WIDGET_ACCESS_OBJECT_CLASS, states = elm_atspi_obj_state_get());
-
- if (elm_object_focus_get(widget))
- BIT_FLAG_SET(states, ATSPI_STATE_FOCUSED);
- if (elm_object_focus_allow_get(widget))
- BIT_FLAG_SET(states, ATSPI_STATE_FOCUSABLE);
- if (!elm_object_disabled_get(widget))
- BIT_FLAG_SET(states, ATSPI_STATE_ENABLED);
-
- return states;
-}
-
-EOLIAN static Eina_Bool
-_elm_widget_access_object_elm_interface_atspi_component_focus_grab(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *evobj = NULL;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- EINA_SAFETY_ON_NULL_RETURN_VAL(evobj, EINA_FALSE);
- if (elm_object_focus_allow_get(evobj))
- {
- Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(evobj));
- if (!ee) return EINA_FALSE;
- ecore_evas_activate(ee);
- elm_object_focus_set(evobj, EINA_TRUE);
- return EINA_TRUE;
- }
- return EINA_FALSE;
-}
-
-#include "elm_widget_access_object.eo.c"
-/// Elm_Atspi_App base class
-#include "elm_app_access_object.eo.h"
-
-EOLIAN static Eina_List*
-_elm_app_access_object_elm_atspi_object_children_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- Eina_List *l, *accs = NULL;
- Elm_Atspi_Object *aobj;
- Evas_Object *win;
-
- EINA_LIST_FOREACH(_elm_win_list, l, win)
- {
- if (!win) continue;
- aobj = _elm_atspi_factory_construct(win);
- if (aobj)
- accs = eina_list_append(accs, aobj);
- }
-
- return accs;
-}
-
-EOLIAN static void
-_elm_app_access_object_eo_base_constructor(Eo *obj, void *_pd EINA_UNUSED)
-{
- eo_do_super(obj, ELM_ATSPI_OBJ_CLASS, eo_constructor());
-}
-
-EOLIAN static const char*
-_elm_app_access_object_elm_atspi_object_name_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- return elm_app_name_get();
-}
-
-EOLIAN static AtspiRole
-_elm_app_access_object_elm_atspi_object_role_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- return ATSPI_ROLE_APPLICATION;
-}
-
-EOLIAN static Elm_Atspi_Object*
-_elm_app_access_object_elm_atspi_object_parent_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- return NULL;
-}
-
-#include "elm_app_access_object.eo.c"
-
-// elm_win wrapper
-
-#include "elm_win_access_object.eo.h"
-
-static void
-_win_focused(void *data, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Elm_Atspi_Object *ao = data;
- eo_do(ao, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL));
-}
-
-static void
-_win_unfocused(void *data, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Elm_Atspi_Object *ao = data;
- eo_do(ao, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL));
-}
-
-EOLIAN static void
-_elm_win_access_object_eo_base_constructor(Eo *obj, void *_pd EINA_UNUSED)
-{
- eo_do_super(obj, ELM_WIN_ACCESS_OBJECT_CLASS, eo_constructor());
- Evas_Object *evobj = NULL;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
-
- evas_object_smart_callback_add(evobj, "focused", _win_focused, obj);
- evas_object_smart_callback_add(evobj, "unfocused", _win_unfocused, obj);
-}
-
-EOLIAN static void
-_elm_win_access_object_eo_base_destructor(Eo *obj, void *_pd EINA_UNUSED)
-{
- Elm_Atspi_Object *root = _elm_atspi_root_object_get();
- eo_do(root, eo_event_callback_call(ELM_ATSPI_OBJECT_EVENT_CHILD_REMOVED, obj));
-
- eo_do_super(obj, ELM_WIN_ACCESS_OBJECT_CLASS, eo_destructor());
-}
-
-EOLIAN static const char*
-_elm_win_access_object_elm_atspi_object_name_get(Eo *obj, void *_pd EINA_UNUSED)
-{
- Evas_Object *evobj = NULL;
-
- eo_do(obj, evobj = elm_atspi_obj_object_get());
- EINA_SAFETY_ON_NULL_RETURN_VAL(evobj, NULL);
-
- return elm_win_title_get(evobj);
-}
-
-EOLIAN static Elm_Atspi_Object*
-_elm_win_access_object_elm_atspi_object_parent_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
-{
- return _elm_atspi_root_object_get();
-}
-
-#include "elm_win_access_object.eo.c"
-
-Elm_Atspi_Object*
-_elm_atspi_root_object_get(void)
-{
- if (!_app)
- _app = eo_add(ELM_APP_ACCESS_OBJECT_CLASS, NULL);
- else
- eo_ref(_app);
-
- return _app;
-}
-
-Elm_Atspi_Object *
-_elm_atspi_factory_construct(Evas_Object *obj)
-{
- Elm_Atspi_Object *ret;
- const char *type;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
-
- ret = evas_object_data_get(obj, "_atspi_object");
- if (ret) return ret;
-
- type = evas_object_type_get(obj);
-
- //FIXME add possibility to install new handlers
- if (!strcmp(type, "elm_access"))
- {
- DBG("Unable to create ATSPI object for elm_access widget.");
- return NULL;
- }
- else if (!strcmp(type, "elm_win"))
- ret = eo_add(ELM_WIN_ACCESS_OBJECT_CLASS, obj);
- else if (!strncmp(type, "elm_", 4)) // defaults to implementation for elm_widget class.
- ret = eo_add(ELM_WIDGET_ACCESS_OBJECT_CLASS, obj);
-
- if (ret) eo_unref(ret); // only evas_object should hold reference to atspi object
-
- return ret;
-}
-
-void _elm_atspi_object_init(void)
-{
-}
-
-void _elm_atspi_object_shutdown(void)
-{
- Elm_Atspi_Global_Callback_Info *info;
- if (_app)
- eo_del(_app);
-
- EINA_LIST_FREE(_global_callbacks, info)
- free(info);
- _global_callbacks = NULL;
-}
-
-void _elm_atspi_object_global_callback_add(Eo_Event_Cb cb, void *user_data)
-{
- Elm_Atspi_Global_Callback_Info *info = calloc(1, sizeof(Elm_Atspi_Global_Callback_Info));
- if (!info) return;
- info->user_data = user_data;
- info->cb = cb;
- _global_callbacks = eina_list_append(_global_callbacks, info);
-}
-
-void _elm_atspi_object_global_callback_del(Eo_Event_Cb cb)
-{
- Elm_Atspi_Global_Callback_Info *info;
- Eina_List *l;
- EINA_LIST_FOREACH(_global_callbacks, l, info)
- {
- if (info->cb == cb)
- {
- _global_callbacks = eina_list_remove(_global_callbacks, info);
- free(info);
- }
- }
-}
-
-#include "elm_atspi_object.eo.c"
+++ /dev/null
-class Elm_Atspi_Object (Eo_Base, Elm_Interface_Atspi_Component)
-{
- legacy_prefix: null;
- eo_prefix: elm_atspi_obj;
- data: null;
- properties {
- localized_role_name {
- get {
- }
- values {
- const char *ret;
- }
- }
- object {
- get {
- }
- values {
- Evas_Object *ret;
- }
- }
- state {
- get {
- }
- values {
- Elm_Atspi_State ret; /*@ state */
- }
- }
- name {
- get {
- }
- values {
- const char *ret; /*@ obj name */
- }
- }
- relation_set {
- get {
- }
- }
- protected role {
- get {
- }
- values {
- AtspiRole role;
- }
- }
- children {
- get {
- }
- values {
- Eina_List *ret;
- }
- }
- role_name {
- get {
- }
- values {
- const char *ret;
- }
- }
- attributes {
- get {
- }
- }
- index_in_parent {
- get {
- }
- values {
- unsigned int idx;
- }
- }
- description {
- get {
- }
- values {
- const char *ret;
- }
- }
- parent {
- get {
- }
- values {
- Elm_Atspi_Object *ret;
- }
- }
- }
- methods {
- child_at_index_get {
- params {
- @in int idx;
- }
- return Elm_Atspi_Object *;
- }
- }
- implements {
- Eo_Base::constructor;
- Eo_Base::event_callback_call;
- Elm_Interface_Atspi_Component::z_order::get;
- Elm_Interface_Atspi_Component::layer::get;
- Elm_Interface_Atspi_Component::extents_set;
- Elm_Interface_Atspi_Component::extents_get;
- Elm_Interface_Atspi_Component::accessible_at_point_get;
- Elm_Interface_Atspi_Component::alpha::get;
- virtual::relation_set::get;
- virtual::name::get;
- virtual::parent::get;
- virtual::attributes::get;
- virtual::role::get;
- virtual::children::get;
- }
- events {
- name,changed; /*@ Called when accessible object text has changed. */
- state,changed; /*@ Called when accessible object state has changed. */
- child,added; /*@ Called when accessible object children was created. */
- child,removed; /*@ Called when accessible object children was destroyed. */
- }
-
-}
+++ /dev/null
-#include "elm_atspi_object_common.h"
-
-#ifdef EFL_EO_API_SUPPORT
-#include "elm_atspi_object_eo.h"
-#endif
-#ifndef EFL_NOLEGACY_API_SUPPORT
-#include "elm_atspi_object_legacy.h"
-#endif
-
+++ /dev/null
-typedef Eo Elm_Atspi_Object;
-
-typedef uint64_t Elm_Atspi_State;
-
-#define BIT_FLAG_SET(mask, bit) (mask |= (1 << bit))
-#define BIT_FLAG_UNSET(mask, bit) (mask &= ~(1 << bit))
-#define BIT_FLAG_GET(mask, bit) (mask & (1 << bit))
-
-/*
- * @brief Gets root (application) type atspi-object.
- */
-Elm_Atspi_Object * _elm_atspi_root_object_get(void);
-
-/*
- * @brief Constructs atspi-object for evas_object
- */
-Elm_Atspi_Object * _elm_atspi_factory_construct(Evas_Object *obj);
-
-void _elm_atspi_object_init(void);
-
-void _elm_atspi_object_shutdown(void);
-
+++ /dev/null
-void _elm_atspi_object_global_callback_add(Eo_Event_Cb cv, void *user_data);
-void _elm_atspi_object_global_callback_del(Eo_Event_Cb cv);
-
-#include "elm_widget_access_object.eo.h"
-#if 0
-#define ELM_ATSPI_WIDGET_CLASS elm_atspi_widget_obj_class_get()
-const Eo_Class *elm_atspi_widget_obj_class_get(void) EINA_CONST;
-#endif
-
-#include "elm_atspi_object.eo.h"
-#if 0
-#define ELM_ATSPI_CLASS elm_atspi_obj_class_get()
-const Eo_Class *elm_atspi_obj_class_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_OBJ_BASE_ID;
-
-enum
-{
- ELM_ATSPI_OBJ_SUB_ID_NAME_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_DESCRIPTION_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_CHILD_AT_INDEX_GET,
- ELM_ATSPI_OBJ_SUB_ID_CHILDREN_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_PARENT_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_OBJECT_GET,
- ELM_ATSPI_OBJ_SUB_ID_INDEX_IN_PARENT_GET,
- ELM_ATSPI_OBJ_SUB_ID_RELATION_SET_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_ROLE_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_ROLE_NAME_GET,
- ELM_ATSPI_OBJ_SUB_ID_LOCALIZED_ROLE_NAME_GET,
- ELM_ATSPI_OBJ_SUB_ID_STATE_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_ATTRIBUTES_GET, /* virtual */
- ELM_ATSPI_OBJ_SUB_ID_LAST
-};
-
-#define ELM_ATSPI_OBJ_ID(sub_id) (ELM_ATSPI_OBJ_BASE_ID + sub_id)
-
-/* Elm_Atspi_Object events */
-extern const Eo_Event_Description _EV_ATSPI_OBJ_NAME_CHANGED;
-#define EV_ATSPI_OBJ_NAME_CHANGED (&(_EV_ATSPI_OBJ_NAME_CHANGED))
-
-extern const Eo_Event_Description _EV_ATSPI_OBJ_CHILD_ADD;
-#define EV_ATSPI_OBJ_CHILD_ADD (&(_EV_ATSPI_OBJ_CHILD_ADD))
-
-extern const Eo_Event_Description _EV_ATSPI_OBJ_CHILD_DEL;
-#define EV_ATSPI_OBJ_CHILD_DEL (&(_EV_ATSPI_OBJ_CHILD_DEL))
-
-extern const Eo_Event_Description _EV_ATSPI_OBJ_STATE_CHANGED;
-#define EV_ATSPI_OBJ_STATE_CHANGED (&(_EV_ATSPI_OBJ_STATE_CHANGED))
-
-#endif
-/* Component Interface */
-#include "elm_interface_atspi_component.eo.h"
-
-#if 0
-#define ELM_ATSPI_COMPONENT_INTERFACE elm_atspi_component_interface_get()
-
-const Eo_Class *elm_atspi_component_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_COMPONENT_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_CONTAINS,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_ACCESSIBLE_AT_POINT_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_EXTENTS_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_EXTENTS_SET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_POSITION_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_POSITION_SET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_SIZE_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_SIZE_SET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_LAYER_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_Z_ORDER_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_FOCUS_GRAB,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_ALPHA_GET,
- ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_LAST
-};
-
-#define ELM_ATSPI_COMPONENT_INTERFACE_ID(sub_id) (ELM_ATSPI_COMPONENT_INTERFACE_BASE_ID + sub_id)
-#endif
-/* Component Interface - END */
-
-/* Window Interface */
-#include "elm_interface_atspi_window.eo.h"
-#if 0
-#define ELM_ATSPI_WINDOW_INTERFACE elm_atspi_window_interface_get()
-const Eo_Class *elm_atspi_window_interface_get(void) EINA_CONST;
-
-extern const Eo_Event_Description _EV_ATSPI_OBJ_WINDOW_ACTIVATED;
-#define EV_ATSPI_OBJ_WINDOW_ACTIVATED (&(_EV_ATSPI_OBJ_WINDOW_ACTIVATED))
-
-extern const Eo_Event_Description _EV_ATSPI_OBJ_WINDOW_DEACTIVATED;
-#define EV_ATSPI_OBJ_WINDOW_DEACTIVATED (&(_EV_ATSPI_OBJ_WINDOW_DEACTIVATED))
-#endif
-/* Window Interface - END */
-
-/* Action Interface */
-#define ELM_ATSPI_ACTION_INTERFACE elm_accessible_action_interface_get()
-
-const Eo_Class *elm_accessible_action_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_ACTION_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_ACTION_COUNT,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_ACTION_DO,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_DESCRIPTION_GET,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_NAME_GET,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_LOCALIZED_NAME_GET,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_KEY_BINDING_GET,
- ELM_ATSPI_ACTION_INTERFACE_SUB_ID_LAST
-};
-/* Action Interface - END */
-
-/* Text Interface */
-#define ELM_ATSPI_TEXT_INTERFACE elm_accessible_text_interface_get()
-
-const Eo_Class *elm_accessible_text_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_TEXT_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_CHARACTER_COUNT,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_CARET_OFFSET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_CARET_OFFSET_SET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_TEXT_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_TEXT_BEFORE_OFFSET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_TEXT_AT_OFFSET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_TEXT_AFTER_OFFSET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_CHARACTER_AT_OFFSET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_ATTRIBUTE_VALUE_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_ATTRIBUTES_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_DEFAULT_ATTRIBUTES_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_CHARACTER_EXTENTS_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_OFFSET_AT_POINT_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_SELECTIONS_COUNT,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_SELECTION_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_SELECTION_ADD,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_SELECTION_REMOVE,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_SELECTION_SET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_RANGE_EXTENTS_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_BAOUNDED_RANGES_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_ATTRIBUTE_RUN_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_DEFAULT_ATTRIBUTE_SET_GET,
- ELM_ATSPI_TEXT_INTERFACE_SUB_ID_LAST
-};
-/* Text Interface - END */
-
-
-/* EditableText Interface */
-#define ELM_ATSPI_EDITABLE_TEXT_INTERFACE elm_accessible_editable_text_interface_get()
-
-const Eo_Class *elm_accessible_editable_text_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_EDITABLE_TEXT_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_CONTENTS_SET,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_INSERT,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_COPY,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_CUT,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_DELETE,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_TEXT_PASTE,
- ELM_ATSPI_EDITABLE_TEXT_INTERFACE_SUB_ID_LAST
-};
-/* EditableText Interface - END */
-
-/* Value Interface */
-#define ELM_ATSPI_VALUE_INTERFACE elm_accessible_value_interface_get()
-
-const Eo_Class *elm_accessible_value_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_VALUE_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_MINIMUM_GET,
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_MAXIMUM_GET,
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_MINIMUM_INCREMENT_GET,
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_VALUE_GET,
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_VALUE_SET,
- ELM_ATSPI_VALUE_INTERFACE_SUB_ID_LAST
-};
-/* Value Interface - END */
-
-
-/* Image Interface */
-const Eo_Class *elm_accessible_image_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_IMAGE_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_IMAGE_DESCRIPTION_GET,
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_IMAGE_LOCALE_GET,
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_IMAGE_EXTENTS_GET,
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_IMAGE_POSITION_GET,
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_IMAGE_SIZE_GET,
- ELM_ATSPI_IMAGE_INTERFACE_SUB_ID_LAST
-};
-/* Image Interface - END */
-
-/* Selection Interface */
-const Eo_Class *elm_accessible_selection_interface_get(void) EINA_CONST;
-
-extern EAPI Eo_Op ELM_ATSPI_SELECTION_INTERFACE_BASE_ID;
-
-enum
-{
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_SELECTED_CHILDREN_COUNT,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_SELECTED_CHILD_GET,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_CHILD_SELECT,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_CHILD_DESELECT,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_SELECT_ALL,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_SELECTION_CLEAR,
- ELM_ATSPI_SELECTION_INTERFACE_SUB_ID_LAST
-};
-/* Selection Interface - END */
-
-#if 0
-/**
- * @def elm_atspi_obj_name_get
- * @since 1.10
- *
- * @param[out] ret obj name
- */
-#define elm_atspi_obj_name_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_NAME_GET), \
- EO_TYPECHECK(const char **, ret)
-
-/**
- * @def elm_atspi_obj_role_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_role_get(role)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_ROLE_GET), \
- EO_TYPECHECK(AtspiRole*, role)
-
-/**
- * @def elm_atspi_obj_role_name_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_role_name_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_ROLE_NAME_GET),\
- EO_TYPECHECK(const char **, ret)
-
-/**
- * @def elm_atspi_obj_localized_role_name_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_localized_role_name_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_LOCALIZED_ROLE_NAME_GET),\
- EO_TYPECHECK(const char **, ret)
-
-/**
- * @def elm_atspi_obj_description_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_description_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_DESCRIPTION_GET),\
- EO_TYPECHECK(const char **, ret)
-
-/**
- * @def elm_atspi_obj_child_at_index_get
- * @since 1.10
- *
- * @param[in] idx
- * @param[out] ret
- */
-#define elm_atspi_obj_child_at_index_get(idx, ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_CHILD_AT_INDEX_GET), \
- EO_TYPECHECK(int, idx),\
- EO_TYPECHECK(Elm_Atspi_Object**, ret)
-
-/**
- * @def elm_atspi_obj_children_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_children_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_CHILDREN_GET),\
- EO_TYPECHECK(Eina_List**, ret)
-
-/**
- * @def elm_atspi_obj_parent_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_parent_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_PARENT_GET),\
- EO_TYPECHECK(Elm_Atspi_Object**, ret)
-
-/**
- * @def elm_atspi_obj_object_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_object_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_OBJECT_GET),\
- EO_TYPECHECK(Evas_Object**, ret)
-
-/**
- * @def elm_atspi_obj_index_in_parent_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_obj_index_in_parent_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_INDEX_IN_PARENT_GET),\
- EO_TYPECHECK(int*, ret)
-
-/**
- * @def elm_atspi_obj_relation_set_get
- * @since 1.10
- */
-#define elm_atspi_obj_relation_set_get()\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_RELATION_SET_GET),\
- EO_TYPECHECK()
-
-/**
- * @def elm_atspi_obj_state_get
- * @since 1.10
- *
- * @param[out] ret state
- */
-#define elm_atspi_obj_state_get(ret)\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_STATE_GET),\
- EO_TYPECHECK(Elm_Atspi_State*, ret)
-
-/**
- * @def elm_atspi_obj_attributes_get
- * @since 1.10
- *
- */
-#define elm_atspi_obj_attributes_get()\
- ELM_ATSPI_OBJ_ID(ELM_ATSPI_OBJ_SUB_ID_ATTRIBUTES_GET),\
- EO_TYPECHECK()
-#endif
-
-#if 0
-/**
- * @def elm_atspi_component_interface_contains
- * @since 1.10
- *
- * @param[in] x
- * @param[in] y
- * @param[in] type
- * @param[out] ret
- */
-#define elm_atspi_component_interface_contains(x, y, type, ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_CONTAINS),\
- EO_TYPECHECK(int, x),\
- EO_TYPECHECK(int, y),\
- EO_TYPECHECK(AtspiCoordType, type),\
- EO_TYPECHECK(Eina_Bool*, ret)
-
-/**
- * @def elm_atspi_component_interface_accessible_at_point_get
- * @since 1.10
- *
- * @param[in] x
- * @param[in] y
- * @param[in] type
- * @param[out] ret
- */
-#define elm_atspi_component_interface_accessible_at_point_get(x, y, type, ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_ACCESSIBLE_AT_POINT_GET),\
- EO_TYPECHECK(int, x),\
- EO_TYPECHECK(int, y),\
- EO_TYPECHECK(AtspiCoordType, type),\
- EO_TYPECHECK(Elm_Atspi_Object**, ret)
-
-/**
- * @def elm_atspi_component_interface_extents_get
- * @since 1.10
- *
- * @param[out] x
- * @param[out] y
- * @param[out] w
- * @param[out] h
- * @param[out] type
- */
-#define elm_atspi_component_interface_extents_get(x, y, w, h, type)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_EXTENTS_GET),\
- EO_TYPECHECK(int*, x),\
- EO_TYPECHECK(int*, y),\
- EO_TYPECHECK(int*, w),\
- EO_TYPECHECK(int*, h), \
- EO_TYPECHECK(AtspiCoordType, type)
-
-/**
- * @def elm_atspi_component_interface_extents_set
- * @since 1.10
- *
- * @param[in] x
- * @param[in] y
- * @param[in] w
- * @param[in] h
- * @param[in] type
- * @param[out] ret
- */
-#define elm_atspi_component_interface_extents_set(x, y, w, h, type, ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_EXTENTS_SET),\
- EO_TYPECHECK(int, x),\
- EO_TYPECHECK(int, y),\
- EO_TYPECHECK(int, w),\
- EO_TYPECHECK(int, h),\
- EO_TYPECHECK(AtspiCoordType, type),\
- EO_TYPECHECK(Eina_Bool*, ret)
-
-/**
- * @def elm_atspi_component_interface_position_get
- * @since 1.10
- *
- * @param[out] x
- * @param[out] y
- * @param[in] type
- */
-#define elm_atspi_component_interface_position_get(x, y, type)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_POSITION_GET),\
- EO_TYPECHECK(int*, x),\
- EO_TYPECHECK(int*, y), \
- EO_TYPECHECK(AtspiCoordType, type)
-
-/**
- * @def elm_atspi_component_interface_position_set
- * @since 1.10
- *
- * @param[in] x
- * @param[in] y
- * @param[in] type
- * @param[out] ret
- */
-#define elm_atspi_component_interface_position_set(x, y, type, ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_POSITION_SET),\
- EO_TYPECHECK(int, x),\
- EO_TYPECHECK(int, y),\
- EO_TYPECHECK(AtspiCoordType, type),\
- EO_TYPECHECK(Eina_Bool*, ret)
-
-/**
- * @def elm_atspi_component_interface_size_get
- * @since 1.10
- *
- * @param[out] x
- * @param[out] y
- */
-#define elm_atspi_component_interface_size_get(x, y)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_SIZE_GET),\
- EO_TYPECHECK(int*, x),\
- EO_TYPECHECK(int*, y)
-
-/**
- * @def elm_atspi_component_interface_size_set
- * @since 1.10
- *
- * @param[in] x
- * @param[in] y
- * @param[out] ret
- */
-#define elm_atspi_component_interface_size_set(x, y, ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_SIZE_SET),\
- EO_TYPECHECK(int, x),\
- EO_TYPECHECK(int, y),\
- EO_TYPECHECK(Eina_Bool*, ret)
-
-/**
- * @def elm_atspi_component_interface_layer_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_component_interface_layer_get(ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_LAYER_GET),\
- EO_TYPECHECK(int*, ret)
-
-/**
- * @def elm_atspi_component_interface_z_order_get
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_component_interface_z_order_get(ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_Z_ORDER_GET),\
- EO_TYPECHECK(int*, ret)
-
-/**
- * @def elm_atspi_component_interface_focus_grab
- * @since 1.10
- *
- * @param[out] ret
- */
-#define elm_atspi_component_interface_focus_grab(ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_FOCUS_GRAB),\
- EO_TYPECHECK(Eina_Bool*, ret)
-
-/**
- * @def elm_atspi_component_interface_alpha_get
- * @since 1.10
- *
- * @param[out] ret alpha
- */
-#define elm_atspi_component_interface_alpha_get(ret)\
- ELM_ATSPI_COMPONENT_INTERFACE_ID(ELM_ATSPI_COMPONENT_INTERFACE_SUB_ID_ALPHA_GET),\
- EO_TYPECHECK(double*, ret)
-#endif
-
+++ /dev/null
-// to be removed to private:
-
--- /dev/null
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_widget.h"
+#include "elm_priv.h"
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+
+
+const char* Atspi_Name[] = {
+ "invalid",
+ "accelerator label",
+ "alert",
+ "animation",
+ "arrow",
+ "calendar",
+ "canvas",
+ "check box",
+ "check menu item",
+ "color chooser",
+ "column header",
+ "combo box",
+ "dateeditor",
+ "desktop icon",
+ "desktop frame",
+ "dial",
+ "dialog",
+ "directory pane",
+ "drawing area",
+ "file chooser",
+ "filler",
+ "focus traversable",
+ "font chooser",
+ "frame",
+ "glass pane",
+ "html container",
+ "icon",
+ "image",
+ "internal frame",
+ "label",
+ "layered pane",
+ "list",
+ "list item",
+ "menu",
+ "menu bar",
+ "menu item",
+ "option pane",
+ "page tab",
+ "page tab list",
+ "panel",
+ "password text",
+ "popup menu",
+ "progress bar",
+ "push button",
+ "radio button",
+ "radio menu item",
+ "root pane",
+ "row header",
+ "scroll bar",
+ "scroll pane",
+ "separator",
+ "slider",
+ "spin button",
+ "split pane",
+ "status bar",
+ "table",
+ "table cell",
+ "table column header",
+ "table row header",
+ "tearoff menu item",
+ "terminal",
+ "text",
+ "toggle button",
+ "tool bar",
+ "tool tip",
+ "tree",
+ "tree table",
+ "unknown",
+ "viewport",
+ "window",
+ "extended",
+ "header",
+ "footer",
+ "paragraph",
+ "ruler",
+ "application",
+ "autocomplete",
+ "editbar",
+ "embedded",
+ "entry",
+ "chart",
+ "caption",
+ "document frame",
+ "heading",
+ "page",
+ "section",
+ "redundant object",
+ "form",
+ "link",
+ "input method window",
+ "table row",
+ "tree item",
+ "document spreadsheet",
+ "document presentation",
+ "document text",
+ "document web",
+ "document email",
+ "comment",
+ "list box",
+ "grouping",
+ "image map",
+ "notification",
+ "info bar",
+ "last defined"
+};
+
+
+EOLIAN static int
+_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, void *pd EINA_UNUSED)
+{
+ Eina_List *l, *children = NULL;
+ Eo *chld, *parent = NULL;
+ int ret = 0;
+
+ eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
+ if (!parent) return -1;
+
+ eo_do(parent, children = elm_interface_atspi_accessible_children_get());
+ if (!children) return -1;
+
+ EINA_LIST_FOREACH(children, l, chld)
+ {
+ if (obj == chld)
+ break;
+ ret++;
+ }
+ if (ret == (int)eina_list_count(children))
+ {
+ ERR("Object %s not present in its AT-SPI parents (%s) children list! This should never happen.", eo_class_name_get(eo_class_get(obj)), eo_class_name_get(eo_class_get(parent)));
+ return -1;
+ }
+ return ret;
+}
+
+EOLIAN static Eo *
+_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ Eo *parent = NULL;
+
+ /* By default using Eo_Base object hierarchy */
+ eo_do(obj, parent = eo_parent_get());
+ if (!parent) return NULL;
+
+ return eo_isa(parent, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS) ? parent : NULL;
+}
+
+EOLIAN static void
+_elm_interface_atspi_accessible_parent_set(Eo *obj, void *priv EINA_UNUSED, Eo *new_parent EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_parent_set\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+EOLIAN void
+_elm_interface_atspi_accessible_attributes_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_attributes_set\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+EOLIAN static Elm_Atspi_Role
+_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ return ELM_ATSPI_ROLE_UNKNOWN;
+}
+
+EOLIAN static void
+_elm_interface_atspi_accessible_role_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Elm_Atspi_Role role EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_role_set\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+EOLIAN const char *
+_elm_interface_atspi_accessible_role_name_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ Elm_Atspi_Role role;
+
+ eo_do(obj, role = elm_interface_atspi_accessible_role_get());
+
+ return role > ELM_ATSPI_ROLE_LAST_DEFINED ? "" : Atspi_Name[role];
+}
+
+EOLIAN const char *
+_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_name_get\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+ return NULL;
+}
+
+EOLIAN static void
+_elm_interface_atspi_accessible_name_set(Eo *obj, void *pd EINA_UNUSED, const char *val EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_name_set\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+const char * _elm_interface_atspi_accessible_description_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_description_get\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+ return NULL;
+}
+
+EOLIAN static void
+_elm_interface_atspi_accessible_description_set(Eo *obj, void *pd EINA_UNUSED, const char *val EINA_UNUSED)
+{
+ WRN("The %s object does not implement the \"accessible_description_set\" function.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+EOLIAN static const char *
+_elm_interface_atspi_accessible_localized_role_name_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ const char *ret = NULL;
+ eo_do(obj, ret = elm_interface_atspi_accessible_role_name_get());
+#ifdef ENABLE_NLS
+ ret = gettext(ret);
+#endif
+ return ret;
+}
+
+EOLIAN static Eina_List *
+_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ Eina_List *children = NULL;
+ Eina_Iterator *iter = NULL;
+ Eo *chld;
+
+ // By default use Eo_Base object hierarchy
+ eo_do(obj, iter = eo_children_iterator_new());
+ if (!iter) return NULL;
+
+ EINA_ITERATOR_FOREACH(iter, chld)
+ {
+ if (eo_isa(chld, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ children = eina_list_append(children, chld);
+ }
+ eina_iterator_free(iter);
+
+ return children;
+}
+
+EOLIAN static Elm_Atspi_State_Set
+_elm_interface_atspi_accessible_state_set_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+ Elm_Atspi_State_Set ret = 0;
+ return ret;
+}
+
+#include "elm_interface_atspi_accessible.eo.c"
--- /dev/null
+mixin Elm_Interface_Atspi_Accessible ()
+{
+ legacy_prefix: null;
+ eo_prefix: elm_interface_atspi_accessible;
+ data: null;
+ properties {
+ protected localized_role_name {
+ get {
+ /*@ Gets an localized string describing ATSPI widget role name. */
+ }
+ values {
+ const char *localized_name;
+ }
+ }
+ protected name {
+ get {
+ /*@ Gets an string describing ATSPI widget role name. */
+ }
+ set {
+ }
+ values {
+ const char *name; /*@ obj name */
+ }
+ }
+ protected relation_set {
+ get {
+ /*@ Gets an string describing ATSPI widget role name. */
+ }
+ }
+ protected role {
+ get {
+ /*@ Gets the role of the widget in ATSPI Accessibility domain. */
+ }
+ set {
+ }
+ values {
+ Elm_Atspi_Role role;
+ }
+ }
+ protected children {
+ get {
+ /*@ Gets widget's accessible children. */
+ }
+ values {
+ Eina_List *children;
+ }
+ }
+ protected role_name {
+ get {
+ /*@ Gets human-readable string indentifying widget accessibility
+ * role. */
+ }
+ values {
+ const char *role_name;
+ }
+ }
+ protected attributes {
+ get {
+ /*@ Gets human-readable string indentifying widget accessibility
+ * role. */
+ }
+ }
+ protected index_in_parent {
+ get {
+ /*@ Gets index of the child in parent's children list. */
+ }
+ values {
+ int idx;
+ }
+ }
+ description {
+ get {
+ /*@ Gets widget contextual information. */
+ }
+ set {
+ /*@ Sets contextual information about widget. */
+ }
+ values {
+ const char *description;
+ }
+ }
+ protected parent {
+ get {
+ /*@ Gets widget accessible parent. */
+ }
+ set {
+ /*@ Sets widget accessible parent. */
+ }
+ values {
+ Eo *parent;
+ }
+ }
+ protected state_set {
+ get {
+ /*@ Gets set describing widget accessible states. */
+ }
+ values {
+ Elm_Atspi_State_Set states;
+ }
+ }
+ }
+ implements {
+ virtual::relation_set::get;
+ }
+ events {
+ property,changed (const char *);
+ children,changed (Elm_Atspi_Event_Children_Changed_Data);
+ state,changed (Elm_Atspi_Event_State_Changed_Data);
+ visible,data,changed;
+ active,descendants,changed;
+ }
+}
--- /dev/null
+
+/**
+ * ATSPI object state set.
+ */
+typedef uint64_t Elm_Atspi_State_Set;
+
+/*
+ * Sets a particilar state type for given state set.
+ */
+#define STATE_TYPE_SET(state_set, type) (state_set|= (1 << type))
+
+/**
+ * Unsets a particilar state type for given state set.
+ */
+#define STATE_TYPE_UNSET(state_set, type) (state_set &= ~(1 << type))
+
+/**
+ * Gets value of a particilar state type for given state set.
+ */
+#define STATE_TYPE_GET(state_set, type) (state_set & (1 << type))
+
+
+typedef enum _Elm_Atspi_Role Elm_Atspi_Role;
+
+/**
+ * @enum _Elm_Atspi_Role
+ * Describes the role of an object visible to AT-SPI Clients.
+ */
+enum _Elm_Atspi_Role
+{
+ ELM_ATSPI_ROLE_INVALID,
+ ELM_ATSPI_ROLE_ACCELERATOR_LABEL,
+ ELM_ATSPI_ROLE_ALERT,
+ ELM_ATSPI_ROLE_ANIMATION,
+ ELM_ATSPI_ROLE_ARROW,
+ ELM_ATSPI_ROLE_CALENDAR,
+ ELM_ATSPI_ROLE_CANVAS,
+ ELM_ATSPI_ROLE_CHECK_BOX,
+ ELM_ATSPI_ROLE_CHECK_MENU_ITEM,
+ ELM_ATSPI_ROLE_COLOR_CHOOSER,
+ ELM_ATSPI_ROLE_COLUMN_HEADER,
+ ELM_ATSPI_ROLE_COMBO_BOX,
+ ELM_ATSPI_ROLE_DATE_EDITOR,
+ ELM_ATSPI_ROLE_DESKTOP_ICON,
+ ELM_ATSPI_ROLE_DESKTOP_FRAME,
+ ELM_ATSPI_ROLE_DIAL,
+ ELM_ATSPI_ROLE_DIALOG,
+ ELM_ATSPI_ROLE_DIRECTORY_PANE,
+ ELM_ATSPI_ROLE_DRAWING_AREA,
+ ELM_ATSPI_ROLE_FILE_CHOOSER,
+ ELM_ATSPI_ROLE_FILLER,
+ ELM_ATSPI_ROLE_FOCUS_TRAVERSABLE,
+ ELM_ATSPI_ROLE_FONT_CHOOSER,
+ ELM_ATSPI_ROLE_FRAME,
+ ELM_ATSPI_ROLE_GLASS_PANE,
+ ELM_ATSPI_ROLE_HTML_CONTAINER,
+ ELM_ATSPI_ROLE_ICON,
+ ELM_ATSPI_ROLE_IMAGE,
+ ELM_ATSPI_ROLE_INTERNAL_FRAME,
+ ELM_ATSPI_ROLE_LABEL,
+ ELM_ATSPI_ROLE_LAYERED_PANE,
+ ELM_ATSPI_ROLE_LIST,
+ ELM_ATSPI_ROLE_LIST_ITEM,
+ ELM_ATSPI_ROLE_MENU,
+ ELM_ATSPI_ROLE_MENU_BAR,
+ ELM_ATSPI_ROLE_MENU_ITEM,
+ ELM_ATSPI_ROLE_OPTION_PANE,
+ ELM_ATSPI_ROLE_PAGE_TAB,
+ ELM_ATSPI_ROLE_PAGE_TAB_LIST,
+ ELM_ATSPI_ROLE_PANEL,
+ ELM_ATSPI_ROLE_PASSWORD_TEXT,
+ ELM_ATSPI_ROLE_POPUP_MENU,
+ ELM_ATSPI_ROLE_PROGRESS_BAR,
+ ELM_ATSPI_ROLE_PUSH_BUTTON,
+ ELM_ATSPI_ROLE_RADIO_BUTTON,
+ ELM_ATSPI_ROLE_RADIO_MENU_ITEM,
+ ELM_ATSPI_ROLE_ROOT_PANE,
+ ELM_ATSPI_ROLE_ROW_HEADER,
+ ELM_ATSPI_ROLE_SCROLL_BAR,
+ ELM_ATSPI_ROLE_SCROLL_PANE,
+ ELM_ATSPI_ROLE_SEPARATOR,
+ ELM_ATSPI_ROLE_SLIDER,
+ ELM_ATSPI_ROLE_SPIN_BUTTON,
+ ELM_ATSPI_ROLE_SPLIT_PANE,
+ ELM_ATSPI_ROLE_STATUS_BAR,
+ ELM_ATSPI_ROLE_TABLE,
+ ELM_ATSPI_ROLE_TABLE_CELL,
+ ELM_ATSPI_ROLE_TABLE_COLUMN_HEADER,
+ ELM_ATSPI_ROLE_TABLE_ROW_HEADER,
+ ELM_ATSPI_ROLE_TEAROFF_MENU_ITEM,
+ ELM_ATSPI_ROLE_TERMINAL,
+ ELM_ATSPI_ROLE_TEXT,
+ ELM_ATSPI_ROLE_TOGGLE_BUTTON,
+ ELM_ATSPI_ROLE_TOOL_BAR,
+ ELM_ATSPI_ROLE_TOOL_TIP,
+ ELM_ATSPI_ROLE_TREE,
+ ELM_ATSPI_ROLE_TREE_TABLE,
+ ELM_ATSPI_ROLE_UNKNOWN,
+ ELM_ATSPI_ROLE_VIEWPORT,
+ ELM_ATSPI_ROLE_WINDOW,
+ ELM_ATSPI_ROLE_EXTENDED,
+ ELM_ATSPI_ROLE_HEADER,
+ ELM_ATSPI_ROLE_FOOTER,
+ ELM_ATSPI_ROLE_PARAGRAPH,
+ ELM_ATSPI_ROLE_RULER,
+ ELM_ATSPI_ROLE_APPLICATION,
+ ELM_ATSPI_ROLE_AUTOCOMPLETE,
+ ELM_ATSPI_ROLE_EDITBAR,
+ ELM_ATSPI_ROLE_EMBEDDED,
+ ELM_ATSPI_ROLE_ENTRY,
+ ELM_ATSPI_ROLE_CHART,
+ ELM_ATSPI_ROLE_CAPTION,
+ ELM_ATSPI_ROLE_DOCUMENT_FRAME,
+ ELM_ATSPI_ROLE_HEADING,
+ ELM_ATSPI_ROLE_PAGE,
+ ELM_ATSPI_ROLE_SECTION,
+ ELM_ATSPI_ROLE_REDUNDANT_OBJECT,
+ ELM_ATSPI_ROLE_FORM,
+ ELM_ATSPI_ROLE_LINK,
+ ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW,
+ ELM_ATSPI_ROLE_TABLE_ROW,
+ ELM_ATSPI_ROLE_TREE_ITEM,
+ ELM_ATSPI_ROLE_DOCUMENT_SPREADSHEET,
+ ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION,
+ ELM_ATSPI_ROLE_DOCUMENT_TEXT,
+ ELM_ATSPI_ROLE_DOCUMENT_WEB,
+ ELM_ATSPI_ROLE_DOCUMENT_EMAIL,
+ ELM_ATSPI_ROLE_COMMENT,
+ ELM_ATSPI_ROLE_LIST_BOX,
+ ELM_ATSPI_ROLE_GROUPING,
+ ELM_ATSPI_ROLE_IMAGE_MAP,
+ ELM_ATSPI_ROLE_NOTIFICATION,
+ ELM_ATSPI_ROLE_INFO_BAR,
+ ELM_ATSPI_ROLE_LAST_DEFINED,
+};
+
+typedef enum _Elm_Atspi_State_Type Elm_Atspi_State_Type;
+
+/**
+ * @enum _Elm_Atspi_State_Type
+ * Describes a possible states of an object visibile to AT-SPI clients.
+ */
+enum _Elm_Atspi_State_Type
+{
+ ELM_ATSPI_STATE_INVALID,
+ ELM_ATSPI_STATE_ACTIVE,
+ ELM_ATSPI_STATE_ARMED,
+ ELM_ATSPI_STATE_BUSY,
+ ELM_ATSPI_STATE_CHECKED,
+ ELM_ATSPI_STATE_COLLAPSED,
+ ELM_ATSPI_STATE_DEFUNCT,
+ ELM_ATSPI_STATE_EDITABLE,
+ ELM_ATSPI_STATE_ENABLED,
+ ELM_ATSPI_STATE_EXPANDABLE,
+ ELM_ATSPI_STATE_EXPANDED,
+ ELM_ATSPI_STATE_FOCUSABLE,
+ ELM_ATSPI_STATE_FOCUSED,
+ ELM_ATSPI_STATE_HAS_TOOLTIP,
+ ELM_ATSPI_STATE_HORIZONTAL,
+ ELM_ATSPI_STATE_ICONIFIED,
+ ELM_ATSPI_STATE_MODAL,
+ ELM_ATSPI_STATE_MULTI_LINE,
+ ELM_ATSPI_STATE_MULTISELECTABLE,
+ ELM_ATSPI_STATE_OPAQUE,
+ ELM_ATSPI_STATE_PRESSED,
+ ELM_ATSPI_STATE_RESIZABLE,
+ ELM_ATSPI_STATE_SELECTABLE,
+ ELM_ATSPI_STATE_SELECTED,
+ ELM_ATSPI_STATE_SENSITIVE,
+ ELM_ATSPI_STATE_SHOWING,
+ ELM_ATSPI_STATE_SINGLE_LINE,
+ ELM_ATSPI_STATE_STALE,
+ ELM_ATSPI_STATE_TRANSIENT,
+ ELM_ATSPI_STATE_VERTICAL,
+ ELM_ATSPI_STATE_VISIBLE,
+ ELM_ATSPI_STATE_MANAGES_DESCENDANTS,
+ ELM_ATSPI_STATE_INDETERMINATE,
+ ELM_ATSPI_STATE_REQUIRED,
+ ELM_ATSPI_STATE_TRUNCATED,
+ ELM_ATSPI_STATE_ANIMATED,
+ ELM_ATSPI_STATE_INVALID_ENTRY,
+ ELM_ATSPI_STATE_SUPPORTS_AUTOCOMPLETION,
+ ELM_ATSPI_STATE_SELECTABLE_TEXT,
+ ELM_ATSPI_STATE_IS_DEFAULT,
+ ELM_ATSPI_STATE_VISITED,
+ ELM_ATSPI_STATE_LAST_DEFINED,
+};
+
+
+typedef struct _Elm_Atspi_Event_State_Changed_Data Elm_Atspi_Event_State_Changed_Data;
+
+struct _Elm_Atspi_Event_State_Changed_Data
+{
+ Elm_Atspi_State_Type type;
+ Eina_Bool new_value;
+};
+
+typedef struct _Elm_Atspi_Event_Children_Changed_Data Elm_Atspi_Event_Children_Changed_Data;
+
+struct _Elm_Atspi_Event_Children_Changed_Data
+{
+ Eina_Bool is_added;
+ Eo *child;
+};
+
+/**
+ * Emits ATSPI 'StateChanged' dbus signal.
+ */
+#define elm_interface_atspi_accessible_state_changed_signal_emit(obj, tp, nvl) \
+ { do { \
+ Elm_Atspi_Event_State_Changed_Data evinfo; \
+ evinfo.type = (tp); \
+ evinfo.new_value = (nvl); \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, (void*)&evinfo)); \
+ } while(0); }
+
+/**
+ * Emits ATSPI 'PropertyChanged' dbus signal for 'Name' property.
+ */
+#define elm_interface_atspi_accessible_name_changed_signal_emit(obj) \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "name"));
+
+/**
+ * Emits ATSPI 'PropertyChanged' dbus signal for 'Description' property.
+ */
+#define elm_interface_atspi_accessible_description_changed_signal_emit(obj) \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "description"));
+
+/**
+ * Emits ATSPI 'PropertyChanged' dbus signal for 'Parent' property.
+ */
+#define elm_interface_atspi_accessible_parent_changed_signal_emit(obj) \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "parent"));
+
+/**
+ * Emits ATSPI 'PropertyChanged' dbus signal for 'Role' property.
+ */
+#define elm_interface_atspi_accessible_role_changed_signal_emit(obj) \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "role"));
+
+/**
+ * Emits ATSPI 'ChildrenChanged' dbus signal with added child as argument.
+ */
+#define elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, child) \
+ do { \
+ Elm_Atspi_Event_Children_Changed_Data data = { EINA_TRUE, child }; \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &data)); \
+ } while(0);
+
+/**
+ * Emits ATSPI 'ChildrenChanged' dbus signal with deleted child as argument.
+ */
+#define elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, child) \
+ do { \
+ Elm_Atspi_Event_Children_Changed_Data data = { EINA_FALSE, child }; \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &data)); \
+ } while(0);
+
+/**
+ * Emits ATSPI 'ActiveDescendantsChanged' dbus signal with deleted child as argument.
+ */
+#define elm_interface_atspi_accessible_active_descendants_changed_signal_emit(obj, desc) \
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ACTIVE_DESCENDANT_CHANGED, desc));
#include "elm_priv.h"
#include "elm_interface_atspi_component.eo.h"
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+
EOLIAN static void
-_elm_interface_atspi_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,int *x, int *y, AtspiCoordType type)
+_elm_interface_atspi_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int *x, int *y)
{
- eo_do(obj, elm_interface_atspi_component_extents_get(x, y, NULL, NULL, type));
+ eo_do(obj, elm_interface_atspi_component_extents_get(type, x, y, NULL, NULL));
}
EOLIAN static Eina_Bool
-_elm_interface_atspi_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int x, int y, AtspiCoordType type)
+_elm_interface_atspi_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
{
Eina_Bool ret = EINA_FALSE;
int c_w, c_h;
- eo_do(obj, elm_interface_atspi_component_extents_get(NULL, NULL, &c_w, &c_h, type));
- eo_do(obj, ret = elm_interface_atspi_component_extents_set(x, y, c_w, c_h, type));
+ eo_do(obj, elm_interface_atspi_component_extents_get(type, NULL, NULL, &c_w, &c_h));
+ eo_do(obj, ret = elm_interface_atspi_component_extents_set(type, x, y, c_w, c_h));
+
return ret;
}
Eina_Bool ret = EINA_FALSE;
int c_x = 0, c_y = 0;
- eo_do(obj, elm_interface_atspi_component_extents_get(&c_x, &c_y, NULL, NULL, ATSPI_COORD_TYPE_WINDOW));
- eo_do(obj, ret = elm_interface_atspi_component_extents_set(c_x, c_y, w, h, ATSPI_COORD_TYPE_WINDOW));
+ eo_do(obj, elm_interface_atspi_component_extents_get(EINA_FALSE, &c_x, &c_y, NULL, NULL));
+ eo_do(obj, elm_interface_atspi_component_extents_set(EINA_FALSE, c_x, c_y, w, h));
return ret;
}
EOLIAN static void
_elm_interface_atspi_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
{
- eo_do(obj, elm_interface_atspi_component_extents_get(NULL, NULL, w, h, ATSPI_COORD_TYPE_WINDOW));
+ eo_do(obj, elm_interface_atspi_component_extents_get(EINA_FALSE, NULL, NULL, w, h));
}
EOLIAN static Eina_Bool
-_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
- int x, int y, AtspiCoordType type)
+_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
{
int w_x = 0, w_y = 0, w_w = 0, w_h = 0;
- eo_do(obj, elm_interface_atspi_component_extents_get(&w_x, &w_y, &w_w, &w_h, type));
+ eo_do(obj, elm_interface_atspi_component_extents_get(type, &w_x, &w_y, &w_w, &w_h));
if ((x >= w_x) && (x <= w_x + w_w) && (y >= w_y) && (y <= w_y + w_h))
return EINA_TRUE;
return EINA_FALSE;
}
+EOLIAN static double
+_elm_interface_atspi_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
+{
+ int alpha;
+
+ evas_object_color_get(obj, NULL, NULL, NULL, &alpha);
+ return (double)alpha / 255.0;
+}
+
+EOLIAN static Evas_Object *
+_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
+{
+ Evas_Object *evobj;
+ int ee_x, ee_y;
+ Eina_List *l, *objs;
+ Evas_Object *ret = NULL;
+
+ if (screen_coords)
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return NULL;
+ ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+ x -= ee_x;
+ y -= ee_y;
+ }
+ objs = evas_objects_at_xy_get(evas_object_evas_get(obj), x, y, EINA_TRUE, EINA_TRUE);
+ EINA_LIST_FOREACH(objs, l, evobj)
+ {
+ // return first only, test if there is atspi interface for eo
+ if (eo_isa(evobj, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ {
+ ret = evobj;
+ break;
+ }
+ }
+ eina_list_free(objs);
+ return ret;
+}
+
+EOLIAN static void
+_elm_interface_atspi_component_extents_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
+{
+ int ee_x, ee_y;
+
+ evas_object_geometry_get(obj, x, y, w, h);
+ if (screen_coords)
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return;
+ ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+ if (x) *x += ee_x;
+ if (y) *y += ee_y;
+ }
+}
+
+EOLIAN static Eina_Bool
+_elm_interface_atspi_component_extents_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y, int w, int h)
+{
+ int wx, wy;
+
+ if ((x < 0) || (y < 0) || (w < 0) || (h < 0)) return EINA_FALSE;
+
+ if (screen_coords)
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return EINA_FALSE;
+ evas_object_geometry_get(obj, &wx, &wy, NULL, NULL);
+ ecore_evas_move(ee, x - wx, y - wy);
+ }
+ else
+ evas_object_move(obj, x, y);
+
+ evas_object_resize(obj, w, h);
+ return EINA_TRUE;
+}
+
+EOLIAN static int
+_elm_interface_atspi_component_layer_get(Eo *obj, void *_pd EINA_UNUSED)
+{
+ return evas_object_layer_get(obj);
+}
+
+EOLIAN static int
+_elm_interface_atspi_component_z_order_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ // Currently not used.
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_elm_interface_atspi_component_focus_grab(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ evas_object_focus_set(obj, EINA_TRUE);
+ return evas_object_focus_get(obj);
+}
+
#include "elm_interface_atspi_component.eo.c"
eo_prefix: elm_interface_atspi_component;
data: null;
properties {
- size {
+ protected size {
set {
+ /*@ Sets size of accessible widget. */
return Eina_Bool;
}
get {
+ /*@ Gets size of accessible widget. */
}
values {
- int x;
- int y;
+ int w;
+ int h;
}
}
- layer {
+ protected layer {
get {
+ /*@ Sets evas layer of accessible widget. */
}
values {
- int ret;
+ int layer;
}
}
- alpha {
+ protected alpha {
get {
+ /*@ Gets alpha of accessible widget. */
}
values {
- double ret; /*@ alpha */
+ double alpha; /*@ alpha value in [0, 1] range. */
}
}
- z_order {
+ protected z_order {
get {
+ /*@ Gets the depth at which the component is shown in relation to
+ * other components in the same container. */
}
values {
- int ret;
+ int z_order;
}
}
- }
- methods {
- protected extents_set {
- params {
- @in int x;
- @in int y;
- @in int w;
- @in int h;
- @in AtspiCoordType type;
+ protected extents {
+ get {
+ /*@ Gets geometry of accessible widget. */
+ }
+ set {
+ /*@ Sets geometry of accessible widget. */
+ return Eina_Bool;
+ }
+ keys {
+ Eina_Bool screen_coords; /*@ If true x and y values will be relative
+ to screen origin, otherwise relative to
+ canvas */
+ }
+ values {
+ int x;
+ int y;
+ int w;
+ int h;
}
- return Eina_Bool;
}
- protected extents_get {
- params {
- @out int x;
- @out int y;
- @out int w;
- @out int h;
- @in AtspiCoordType type;
+ protected position {
+ set {
+ /*@ Sets position of accessible widget. */
+ return Eina_Bool;
+ }
+ get {
+ /*@ Gets position of accessible widget. */
+ }
+ keys {
+ Eina_Bool screen_coords; /*@ If true x and y values will be relative
+ to screen origin, otherwise relative to
+ canvas */
+ }
+ values {
+ int x;
+ int y;
}
}
+ }
+ methods {
protected contains {
params {
+ Eina_Bool screen_coords; /*@ If true x and y values will be relative
+ to screen origin, otherwise relative to
+ canvas */
@in int x;
@in int y;
- @in AtspiCoordType type;
}
return Eina_Bool;
}
focus_grab {
+ /*@ Focuses accessible widget.
+
+ @return true if focus grab focus has successed, false otherwise. */
+
return Eina_Bool;
}
protected accessible_at_point_get {
+ /*@ Gets top component object occupying space at given coordinates. */
params {
+ Eina_Bool screen_coords; /*@ If true x and y values will be relative
+ to screen origin, otherwise relative to
+ canvas */
@in int x;
@in int y;
- @in AtspiCoordType type;
- }
- return Elm_Atspi_Object *;
- }
- protected position_set {
- params {
- @in int x;
- @in int y;
- @in AtspiCoordType type;
- }
- return Eina_Bool;
- }
- protected position_get {
- params {
- @out int x;
- @out int y;
- @in AtspiCoordType type;
}
+ return Evas_Object *;
}
}
- implements {
- virtual::z_order::get;
- virtual::layer::get;
- virtual::extents_set;
- virtual::extents_get;
- virtual::accessible_at_point_get;
- virtual::focus_grab;
- virtual::alpha::get;
- }
-
}
--- /dev/null
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_widget.h"
+#include "elm_priv.h"
+
+#include "assert.h"
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
+
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+#include "elm_interface_atspi_component.eo.h"
+#include "elm_interface_atspi_widget.eo.h"
+
+typedef struct _Elm_Interface_Atspi_Widget_Data Elm_Interface_Atspi_Widget_Data;
+
+struct _Elm_Interface_Atspi_Widget_Data {
+ Elm_Atspi_Role role;
+ const char *description;
+};
+
+static void
+_on_focus_change(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = data ? EINA_TRUE : EINA_FALSE;
+ elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_FOCUSED, val);
+}
+
+EOLIAN void
+_elm_interface_atspi_widget_eo_base_constructor(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *pd)
+{
+ eo_do_super(obj, ELM_INTERFACE_ATSPI_WIDGET_CLASS, eo_constructor());
+
+ pd->role = ELM_ATSPI_ROLE_UNKNOWN;
+
+ // Elm_Widget_Access_Object can only be constructed on top of Elm_Widget
+ assert(eo_isa(obj, ELM_OBJ_WIDGET_CLASS));
+
+ evas_object_smart_callback_add(obj, "focused", _on_focus_change, (void*)1);
+ evas_object_smart_callback_add(obj, "unfocused", _on_focus_change, NULL);
+}
+
+EOLIAN void
+_elm_interface_atspi_widget_eo_base_destructor(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *pd)
+{
+ Eo *parent;
+ if (pd->description) eina_stringshare_del(pd->description);
+
+ eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
+
+ if (parent && !eo_destructed_is(parent))
+ elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, obj);
+
+ eo_do_super(obj, ELM_INTERFACE_ATSPI_WIDGET_CLASS, eo_destructor());
+}
+
+EOLIAN static Eina_Bool
+_elm_interface_atspi_widget_elm_interface_atspi_component_focus_grab(Eo *obj, Elm_Interface_Atspi_Widget_Data *pd EINA_UNUSED)
+{
+ if (elm_object_focus_allow_get(obj))
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (!ee) return EINA_FALSE;
+ ecore_evas_activate(ee);
+ elm_object_focus_set(obj, EINA_TRUE);
+ return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EOLIAN static const char*
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *_pd EINA_UNUSED)
+{
+ return elm_object_text_get(obj);
+}
+
+EOLIAN static const char*
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_description_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *_pd)
+{
+ return _pd->description;
+}
+
+EOLIAN static void
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_description_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *_pd, const char *descr)
+{
+ eina_stringshare_replace(&_pd->description, descr);
+}
+
+EOLIAN static Elm_Atspi_Role
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *pd EINA_UNUSED)
+{
+ return pd->role;
+}
+
+EOLIAN static void
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_role_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *pd, Elm_Atspi_Role role)
+{
+ pd->role = role;
+}
+
+EOLIAN static Eina_List*
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Widget_Data *pd EINA_UNUSED)
+{
+ Eina_List *l, *accs = NULL;
+ Elm_Widget_Smart_Data *wd;
+ Evas_Object *widget;
+
+ wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
+ if (!wd) return NULL;
+
+ EINA_LIST_FOREACH(wd->subobjs, l, widget)
+ {
+ if (!elm_object_widget_check(widget)) continue;
+ if (eo_isa(widget, ELM_INTERFACE_ATSPI_ACCESSIBLE_CLASS))
+ accs = eina_list_append(accs, widget);
+ }
+ return accs;
+}
+
+EOLIAN static Elm_Atspi_State_Set
+_elm_interface_atspi_widget_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Interface_Atspi_Widget_Data *pd EINA_UNUSED)
+{
+ Elm_Atspi_State_Set states = 0;
+
+ eo_do_super(obj, ELM_INTERFACE_ATSPI_WIDGET_CLASS, states = elm_interface_atspi_accessible_state_set_get());
+
+ if (evas_object_visible_get(obj))
+ {
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_VISIBLE);
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_SHOWING);
+ }
+ if (elm_object_focus_get(obj))
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSED);
+ if (elm_object_focus_allow_get(obj))
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSABLE);
+ if (!elm_object_disabled_get(obj))
+ {
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_ENABLED);
+ STATE_TYPE_SET(states, ELM_ATSPI_STATE_ACTIVE);
+ }
+
+ return states;
+}
+
+#include "elm_interface_atspi_widget.eo.c"
--- /dev/null
+mixin Elm_Interface_Atspi_Widget (Elm_Interface_Atspi_Accessible, Elm_Interface_Atspi_Component, Eo_Base)
+{
+ eo_prefix: elm_interface_atspi_widget;
+ data: Elm_Interface_Atspi_Widget_Data;
+ implements {
+ Eo_Base::constructor;
+ Eo_Base::destructor;
+ Elm_Interface_Atspi_Accessible::name::get;
+ Elm_Interface_Atspi_Accessible::description::get;
+ Elm_Interface_Atspi_Accessible::description::set;
+ Elm_Interface_Atspi_Accessible::role::get;
+ Elm_Interface_Atspi_Accessible::role::set;
+ Elm_Interface_Atspi_Accessible::state_set::get;
+ Elm_Interface_Atspi_Accessible::children::get;
+ Elm_Interface_Atspi_Component::focus_grab;
+ }
+}
--- /dev/null
+#ifdef HAVE_CONFIG_H
+ #include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_widget.h"
+#include "elm_priv.h"
+
+#include "elm_interface_atspi_window.eo.h"
+#include "elm_interface_atspi_window.eo.c"
{
data: null;
events {
- window,activated; /*@ Called when new window has been activated. (unfocuesed) */
+ window,created; /*@ Called when new window has been created. */
+ window,activated; /*@ Called when new window has been activated. (unfocused) */
window,deactivated; /*@ Called when new window has been deactivated (unfocused). */
}
-
}
ecore_event_handler_del(system_handlers[1]);
_elm_win_shutdown();
+ _elm_atspi_bridge_shutdown();
+
while (_elm_win_deferred_free) ecore_main_loop_iterate();
_elm_clouseau_unload();
- _elm_atspi_bridge_shutdown();
// wrningz :(
// _prefix_shutdown();
ELM_SAFE_FREE(app_name, eina_stringshare_del);
Elm_Datetime_Field_Type field_type);
};
+void _elm_atspi_init(void);
+void _elm_atspi_shutdown(void);
+Eo *_elm_atspi_root_get(void);
+
void _elm_atspi_bridge_init(void);
void _elm_atspi_bridge_shutdown(void);
+
void _elm_prefs_init(void);
void _elm_prefs_shutdown(void);
#include "elm_priv.h"
#include "elm_widget_container.h"
#include "elm_interface_scrollable.h"
+#include "elm_interface_atspi_widget.eo.h"
#define MY_CLASS ELM_OBJ_WIDGET_CLASS
#endif
}
-static Eina_Bool
-_atspi_obj_create(void *data)
-{
- Elm_Atspi_Object *parent = NULL;
- Elm_Atspi_Object *obj = _elm_atspi_factory_construct(data);
- if (obj)
- {
- eo_do(obj, parent = elm_atspi_obj_parent_get());
- eo_do(parent, eo_event_callback_call(ELM_ATSPI_OBJECT_EVENT_CHILD_ADDED, obj));
- }
- return EINA_FALSE;
-}
-
EOLIAN static void
_elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd)
{
parent = eo_parent_get());
eo_do(obj, elm_obj_widget_parent_set(parent));
sd->on_create = EINA_FALSE;
-
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ecore_idle_enterer_add(_atspi_obj_create, obj);
}
EOLIAN static Eina_Bool
-abstract Elm_Widget (Evas_Smart)
+abstract Elm_Widget (Evas_Smart, Elm_Interface_Atspi_Widget)
{
eo_prefix: elm_obj_widget;
data: Elm_Widget_Smart_Data;
virtual::focus_next;
virtual::parent_widget::get;
}
-
}
+++ /dev/null
-class Elm_Widget_Access_Object (Elm_Atspi_Object)
-{
- data:null;
- implements {
- Eo_Base::constructor;
- Elm_Interface_Atspi_Component::focus_grab;
- Elm_Atspi_Object::name::get;
- Elm_Atspi_Object::parent::get;
- Elm_Atspi_Object::state::get;
- Elm_Atspi_Object::role::get;
- Elm_Atspi_Object::children::get;
- }
-
-}
#include "elm_priv.h"
#include "elm_widget_menu.h"
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+
+#include "elm_interface_atspi_accessible.h"
+#include "elm_interface_atspi_accessible.eo.h"
+#include "elm_interface_atspi_window.eo.h"
+#include "elm_interface_atspi_widget.eo.h"
+
#define MY_CLASS ELM_OBJ_WIN_CLASS
#define MY_CLASS_NAME "Elm_Win"
edje_object_update_hints_set(sd->layout, EINA_TRUE);
evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_elm_win_on_resize_obj_changed_size_hints, obj);
+
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ {
+ eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
+ elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_root_get(), obj);
+ eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
+ }
+
evas_object_show(sd->layout);
}
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
+EOLIAN static Eo*
+_elm_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd EINA_UNUSED)
+{
+ // attach all kinds of windows directly to ATSPI application root object
+ return _elm_atspi_root_get();
+}
+
#include "elm_win.eo.c"
-class Elm_Win (Elm_Widget)
+class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window)
{
eo_prefix: elm_obj_win;
constructors {
Elm_Widget::theme_apply;
Elm_Widget::on_focus;
Elm_Widget::event;
+ Elm_Interface_Atspi_Accessible::parent::get;
}
events {
delete,request;
+++ /dev/null
-class Elm_Win_Access_Object (Elm_Widget_Access_Object, Elm_Interface_Atspi_Window)
-{
- data:null;
- implements {
- Eo_Base::constructor;
- Eo_Base::destructor;
- Elm_Atspi_Object::name::get;
- Elm_Atspi_Object::parent::get;
- }
-
-}
-