forked from enlightenment/efl
atspi: refactor atspi_object class into mixins.
Summary: Allow to create ATSPI aware objects only by attaching Atspi interface to Eo object. Apply protected rule to all methods, properties which should not be available to app developer. Remove public atspi header from Elementary.h. Make Elm_Widget inherit from Atspi interfaces, Elm_Win inherits additional Atspi_Window interface. Unified file names - all atspi related objects/interfaces can be found under elm_atspi_* and elm_interface_atspi_*. Test Plan: build&install, out-off tree example compilation with gcc and g++, Orca screen reader tests on Ubuntu 12.04. Reviewers: raster, seoz, tasn, JackDanielZ Differential Revision: https://phab.enlightenment.org/D718
This commit is contained in:
parent
0312fd5b3d
commit
c3b541bcda
|
@ -161,7 +161,6 @@ EAPI extern Elm_Version *elm_version;
|
||||||
|
|
||||||
/* special widgets - types used elsewhere */
|
/* special widgets - types used elsewhere */
|
||||||
#include <elm_access.h>
|
#include <elm_access.h>
|
||||||
#include <elm_atspi_object.h>
|
|
||||||
#include <elm_icon.h>
|
#include <elm_icon.h>
|
||||||
#include <elm_scroller.h>
|
#include <elm_scroller.h>
|
||||||
#include <elm_entry.h>
|
#include <elm_entry.h>
|
||||||
|
|
|
@ -162,10 +162,6 @@ elm_app_client.h \
|
||||||
elm_app_client_view_eo.h \
|
elm_app_client_view_eo.h \
|
||||||
elm_app_client_view.h \
|
elm_app_client_view.h \
|
||||||
elm_app.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_authors.h \
|
||||||
elm_bg.h \
|
elm_bg.h \
|
||||||
elm_bg_eo.h \
|
elm_bg_eo.h \
|
||||||
|
@ -417,7 +413,7 @@ elm_app_server.c \
|
||||||
elm_app_server_view.c \
|
elm_app_server_view.c \
|
||||||
elm_app_client.c \
|
elm_app_client.c \
|
||||||
elm_app_client_view.c \
|
elm_app_client_view.c \
|
||||||
elm_atspi_object.c \
|
elm_atspi_app_object.c \
|
||||||
elm_atspi_bridge.c \
|
elm_atspi_bridge.c \
|
||||||
elm_bg.c \
|
elm_bg.c \
|
||||||
elm_box.c \
|
elm_box.c \
|
||||||
|
@ -450,7 +446,10 @@ elm_hover.c \
|
||||||
elm_icon.c \
|
elm_icon.c \
|
||||||
elm_image.c \
|
elm_image.c \
|
||||||
elm_index.c \
|
elm_index.c \
|
||||||
|
elm_interface_atspi_accessible.c \
|
||||||
elm_interface_atspi_component.c \
|
elm_interface_atspi_component.c \
|
||||||
|
elm_interface_atspi_widget.c \
|
||||||
|
elm_interface_atspi_window.c \
|
||||||
elm_interface_fileselector.c \
|
elm_interface_fileselector.c \
|
||||||
elm_interface_scrollable.c \
|
elm_interface_scrollable.c \
|
||||||
elm_inwin.c \
|
elm_inwin.c \
|
||||||
|
@ -545,8 +544,6 @@ BUILT_SOURCES = \
|
||||||
elm_access.eo.h \
|
elm_access.eo.h \
|
||||||
elm_actionslider.eo.c \
|
elm_actionslider.eo.c \
|
||||||
elm_actionslider.eo.h \
|
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.c \
|
||||||
elm_app_client.eo.h \
|
elm_app_client.eo.h \
|
||||||
elm_app_client_view.eo.c \
|
elm_app_client_view.eo.c \
|
||||||
|
@ -555,12 +552,8 @@ BUILT_SOURCES = \
|
||||||
elm_app_server.eo.h \
|
elm_app_server.eo.h \
|
||||||
elm_app_server_view.eo.c \
|
elm_app_server_view.eo.c \
|
||||||
elm_app_server_view.eo.h \
|
elm_app_server_view.eo.h \
|
||||||
elm_interface_atspi_component.eo.c \
|
elm_atspi_app_object.eo.c \
|
||||||
elm_interface_atspi_component.eo.h \
|
elm_atspi_app_object.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_bg.eo.c \
|
elm_bg.eo.c \
|
||||||
elm_bg.eo.h \
|
elm_bg.eo.h \
|
||||||
elm_box.eo.c \
|
elm_box.eo.c \
|
||||||
|
@ -621,6 +614,14 @@ BUILT_SOURCES = \
|
||||||
elm_icon.eo.h \
|
elm_icon.eo.h \
|
||||||
elm_index.eo.c \
|
elm_index.eo.c \
|
||||||
elm_index.eo.h \
|
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.c \
|
||||||
elm_interface_fileselector.eo.h \
|
elm_interface_fileselector.eo.h \
|
||||||
elm_inwin.eo.c \
|
elm_inwin.eo.c \
|
||||||
|
@ -691,10 +692,6 @@ BUILT_SOURCES = \
|
||||||
elm_video.eo.h \
|
elm_video.eo.h \
|
||||||
elm_web.eo.c \
|
elm_web.eo.c \
|
||||||
elm_web.eo.h \
|
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.c \
|
||||||
elm_win.eo.h
|
elm_win.eo.h
|
||||||
|
|
||||||
|
@ -708,14 +705,15 @@ EXTRA_DIST += \
|
||||||
elm_hover.eo \
|
elm_hover.eo \
|
||||||
elm_access.eo \
|
elm_access.eo \
|
||||||
elm_actionslider.eo \
|
elm_actionslider.eo \
|
||||||
elm_app_access_object.eo \
|
|
||||||
elm_app_client.eo \
|
elm_app_client.eo \
|
||||||
elm_app_client_view.eo \
|
elm_app_client_view.eo \
|
||||||
elm_app_server.eo \
|
elm_app_server.eo \
|
||||||
elm_app_server_view.eo \
|
elm_app_server_view.eo \
|
||||||
|
elm_atspi_app_object.eo \
|
||||||
|
elm_interface_atspi_accessible.eo \
|
||||||
elm_interface_atspi_component.eo \
|
elm_interface_atspi_component.eo \
|
||||||
|
elm_interface_atspi_widget.eo \
|
||||||
elm_interface_atspi_window.eo \
|
elm_interface_atspi_window.eo \
|
||||||
elm_atspi_object.eo \
|
|
||||||
elm_bg.eo \
|
elm_bg.eo \
|
||||||
elm_box.eo \
|
elm_box.eo \
|
||||||
elm_bubble.eo \
|
elm_bubble.eo \
|
||||||
|
@ -781,8 +779,6 @@ EXTRA_DIST += \
|
||||||
elm_toolbar.eo \
|
elm_toolbar.eo \
|
||||||
elm_video.eo \
|
elm_video.eo \
|
||||||
elm_web.eo \
|
elm_web.eo \
|
||||||
elm_widget_access_object.eo \
|
|
||||||
elm_win_access_object.eo \
|
|
||||||
elm_win.eo
|
elm_win.eo
|
||||||
|
|
||||||
nodist_includesunstable_HEADERS = \
|
nodist_includesunstable_HEADERS = \
|
||||||
|
@ -795,14 +791,15 @@ nodist_includesunstable_HEADERS = \
|
||||||
elm_access.eo.h \
|
elm_access.eo.h \
|
||||||
elm_hover.eo.h \
|
elm_hover.eo.h \
|
||||||
elm_actionslider.eo.h \
|
elm_actionslider.eo.h \
|
||||||
elm_app_access_object.eo.h \
|
|
||||||
elm_app_client.eo.h \
|
elm_app_client.eo.h \
|
||||||
elm_app_client_view.eo.h \
|
elm_app_client_view.eo.h \
|
||||||
elm_app_server.eo.h \
|
elm_app_server.eo.h \
|
||||||
elm_app_server_view.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_component.eo.h \
|
||||||
|
elm_interface_atspi_widget.eo.h \
|
||||||
elm_interface_atspi_window.eo.h \
|
elm_interface_atspi_window.eo.h \
|
||||||
elm_atspi_object.eo.h \
|
|
||||||
elm_box.eo.h \
|
elm_box.eo.h \
|
||||||
elm_bg.eo.h \
|
elm_bg.eo.h \
|
||||||
elm_bubble.eo.h \
|
elm_bubble.eo.h \
|
||||||
|
@ -868,7 +865,5 @@ nodist_includesunstable_HEADERS = \
|
||||||
elm_toolbar.eo.h \
|
elm_toolbar.eo.h \
|
||||||
elm_video.eo.h \
|
elm_video.eo.h \
|
||||||
elm_web.eo.h \
|
elm_web.eo.h \
|
||||||
elm_widget_access_object.eo.h \
|
|
||||||
elm_win_access_object.eo.h \
|
|
||||||
elm_win.eo.h
|
elm_win.eo.h
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
#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"
|
|
@ -0,0 +1,10 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,721 +0,0 @@
|
||||||
#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"
|
|
|
@ -1,117 +0,0 @@
|
||||||
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. */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
#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
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
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);
|
|
||||||
|
|
|
@ -1,520 +0,0 @@
|
||||||
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
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
// to be removed to private:
|
|
||||||
|
|
|
@ -0,0 +1,267 @@
|
||||||
|
#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"
|
|
@ -0,0 +1,112 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,263 @@
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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));
|
|
@ -9,21 +9,25 @@
|
||||||
|
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "elm_interface_atspi_component.eo.h"
|
#include "elm_interface_atspi_component.eo.h"
|
||||||
|
#include "elm_interface_atspi_accessible.h"
|
||||||
|
#include "elm_interface_atspi_accessible.eo.h"
|
||||||
|
|
||||||
|
|
||||||
EOLIAN static void
|
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
|
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;
|
Eina_Bool ret = EINA_FALSE;
|
||||||
int c_w, c_h;
|
int c_w, c_h;
|
||||||
|
|
||||||
eo_do(obj, elm_interface_atspi_component_extents_get(NULL, NULL, &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(x, y, c_w, c_h, type));
|
eo_do(obj, ret = elm_interface_atspi_component_extents_set(type, x, y, c_w, c_h));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,28 +37,123 @@ _elm_interface_atspi_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUS
|
||||||
Eina_Bool ret = EINA_FALSE;
|
Eina_Bool ret = EINA_FALSE;
|
||||||
int c_x = 0, c_y = 0;
|
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, elm_interface_atspi_component_extents_get(EINA_FALSE, &c_x, &c_y, NULL, NULL));
|
||||||
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_set(EINA_FALSE, c_x, c_y, w, h));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_interface_atspi_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
|
_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
|
EOLIAN static Eina_Bool
|
||||||
_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
|
_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Eina_Bool type, int x, int y)
|
||||||
int x, int y, AtspiCoordType type)
|
|
||||||
{
|
{
|
||||||
int w_x = 0, w_y = 0, w_w = 0, w_h = 0;
|
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))
|
if ((x >= w_x) && (x <= w_x + w_w) && (y >= w_y) && (y <= w_y + w_h))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
return EINA_FALSE;
|
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"
|
#include "elm_interface_atspi_component.eo.c"
|
||||||
|
|
|
@ -4,102 +4,111 @@ mixin Elm_Interface_Atspi_Component ()
|
||||||
eo_prefix: elm_interface_atspi_component;
|
eo_prefix: elm_interface_atspi_component;
|
||||||
data: null;
|
data: null;
|
||||||
properties {
|
properties {
|
||||||
size {
|
protected size {
|
||||||
set {
|
set {
|
||||||
|
/*@ Sets size of accessible widget. */
|
||||||
return Eina_Bool;
|
return Eina_Bool;
|
||||||
}
|
}
|
||||||
get {
|
get {
|
||||||
|
/*@ Gets size of accessible widget. */
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
int w;
|
||||||
|
int h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected layer {
|
||||||
|
get {
|
||||||
|
/*@ Sets evas layer of accessible widget. */
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
int layer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected alpha {
|
||||||
|
get {
|
||||||
|
/*@ Gets alpha of accessible widget. */
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
double alpha; /*@ alpha value in [0, 1] range. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected z_order {
|
||||||
|
get {
|
||||||
|
/*@ Gets the depth at which the component is shown in relation to
|
||||||
|
* other components in the same container. */
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
int z_order;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 {
|
values {
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layer {
|
|
||||||
get {
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
int ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
alpha {
|
|
||||||
get {
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
double ret; /*@ alpha */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
z_order {
|
|
||||||
get {
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
int ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
methods {
|
methods {
|
||||||
protected extents_set {
|
|
||||||
params {
|
|
||||||
@in int x;
|
|
||||||
@in int y;
|
|
||||||
@in int w;
|
|
||||||
@in int h;
|
|
||||||
@in AtspiCoordType type;
|
|
||||||
}
|
|
||||||
return Eina_Bool;
|
|
||||||
}
|
|
||||||
protected extents_get {
|
|
||||||
params {
|
|
||||||
@out int x;
|
|
||||||
@out int y;
|
|
||||||
@out int w;
|
|
||||||
@out int h;
|
|
||||||
@in AtspiCoordType type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected contains {
|
protected contains {
|
||||||
params {
|
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 x;
|
||||||
@in int y;
|
@in int y;
|
||||||
@in AtspiCoordType type;
|
|
||||||
}
|
}
|
||||||
return Eina_Bool;
|
return Eina_Bool;
|
||||||
}
|
}
|
||||||
focus_grab {
|
focus_grab {
|
||||||
|
/*@ Focuses accessible widget.
|
||||||
|
|
||||||
|
@return true if focus grab focus has successed, false otherwise. */
|
||||||
|
|
||||||
return Eina_Bool;
|
return Eina_Bool;
|
||||||
}
|
}
|
||||||
protected accessible_at_point_get {
|
protected accessible_at_point_get {
|
||||||
|
/*@ Gets top component object occupying space at given coordinates. */
|
||||||
params {
|
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 x;
|
||||||
@in int y;
|
@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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
#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"
|
|
@ -0,0 +1,17 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#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"
|
|
@ -2,8 +2,8 @@ interface Elm_Interface_Atspi_Window ()
|
||||||
{
|
{
|
||||||
data: null;
|
data: null;
|
||||||
events {
|
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). */
|
window,deactivated; /*@ Called when new window has been deactivated (unfocused). */
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,10 +330,11 @@ elm_shutdown(void)
|
||||||
ecore_event_handler_del(system_handlers[1]);
|
ecore_event_handler_del(system_handlers[1]);
|
||||||
|
|
||||||
_elm_win_shutdown();
|
_elm_win_shutdown();
|
||||||
|
_elm_atspi_bridge_shutdown();
|
||||||
|
|
||||||
while (_elm_win_deferred_free) ecore_main_loop_iterate();
|
while (_elm_win_deferred_free) ecore_main_loop_iterate();
|
||||||
|
|
||||||
_elm_clouseau_unload();
|
_elm_clouseau_unload();
|
||||||
_elm_atspi_bridge_shutdown();
|
|
||||||
// wrningz :(
|
// wrningz :(
|
||||||
// _prefix_shutdown();
|
// _prefix_shutdown();
|
||||||
ELM_SAFE_FREE(app_name, eina_stringshare_del);
|
ELM_SAFE_FREE(app_name, eina_stringshare_del);
|
||||||
|
|
|
@ -341,8 +341,13 @@ struct _Elm_Datetime_Module_Data
|
||||||
Elm_Datetime_Field_Type field_type);
|
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_init(void);
|
||||||
void _elm_atspi_bridge_shutdown(void);
|
void _elm_atspi_bridge_shutdown(void);
|
||||||
|
|
||||||
void _elm_prefs_init(void);
|
void _elm_prefs_init(void);
|
||||||
void _elm_prefs_shutdown(void);
|
void _elm_prefs_shutdown(void);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "elm_widget_container.h"
|
#include "elm_widget_container.h"
|
||||||
#include "elm_interface_scrollable.h"
|
#include "elm_interface_scrollable.h"
|
||||||
|
#include "elm_interface_atspi_widget.eo.h"
|
||||||
|
|
||||||
#define MY_CLASS ELM_OBJ_WIDGET_CLASS
|
#define MY_CLASS ELM_OBJ_WIDGET_CLASS
|
||||||
|
|
||||||
|
@ -5278,19 +5279,6 @@ elm_widget_tree_dot_dump(const Evas_Object *top,
|
||||||
#endif
|
#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
|
EOLIAN static void
|
||||||
_elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd)
|
_elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd)
|
||||||
{
|
{
|
||||||
|
@ -5303,9 +5291,6 @@ _elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd)
|
||||||
parent = eo_parent_get());
|
parent = eo_parent_get());
|
||||||
eo_do(obj, elm_obj_widget_parent_set(parent));
|
eo_do(obj, elm_obj_widget_parent_set(parent));
|
||||||
sd->on_create = EINA_FALSE;
|
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
|
EOLIAN static Eina_Bool
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
abstract Elm_Widget (Evas_Smart)
|
abstract Elm_Widget (Evas_Smart, Elm_Interface_Atspi_Widget)
|
||||||
{
|
{
|
||||||
eo_prefix: elm_obj_widget;
|
eo_prefix: elm_obj_widget;
|
||||||
data: Elm_Widget_Smart_Data;
|
data: Elm_Widget_Smart_Data;
|
||||||
|
@ -827,5 +827,4 @@ abstract Elm_Widget (Evas_Smart)
|
||||||
virtual::focus_next;
|
virtual::focus_next;
|
||||||
virtual::parent_widget::get;
|
virtual::parent_widget::get;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -8,6 +8,13 @@
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "elm_widget_menu.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 ELM_OBJ_WIN_CLASS
|
||||||
|
|
||||||
#define MY_CLASS_NAME "Elm_Win"
|
#define MY_CLASS_NAME "Elm_Win"
|
||||||
|
@ -3307,6 +3314,14 @@ _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type t
|
||||||
edje_object_update_hints_set(sd->layout, EINA_TRUE);
|
edje_object_update_hints_set(sd->layout, EINA_TRUE);
|
||||||
evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_elm_win_on_resize_obj_changed_size_hints, obj);
|
_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_object_show(sd->layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4772,4 +4787,11 @@ _elm_win_class_constructor(Eo_Class *klass)
|
||||||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
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"
|
#include "elm_win.eo.c"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Elm_Win (Elm_Widget)
|
class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window)
|
||||||
{
|
{
|
||||||
eo_prefix: elm_obj_win;
|
eo_prefix: elm_obj_win;
|
||||||
constructors {
|
constructors {
|
||||||
|
@ -1315,6 +1315,7 @@ class Elm_Win (Elm_Widget)
|
||||||
Elm_Widget::theme_apply;
|
Elm_Widget::theme_apply;
|
||||||
Elm_Widget::on_focus;
|
Elm_Widget::on_focus;
|
||||||
Elm_Widget::event;
|
Elm_Widget::event;
|
||||||
|
Elm_Interface_Atspi_Accessible::parent::get;
|
||||||
}
|
}
|
||||||
events {
|
events {
|
||||||
delete,request;
|
delete,request;
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue