aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-01-24 07:18:43 +0100
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2019-01-24 07:18:43 +0100
commitec147384aa3b4c8943597465ab3b410caa971c1e (patch)
treea452be1e793aac3cdf0335371bc4428262c54e41
parentefl_access: remove Efl.Object.invalidate implementation (diff)
downloadefl-devs/stanluk/mixin_removal.tar.gz
efl_access: refactor Efl.Access.Object to interfacedevs/stanluk/mixin_removal
-rw-r--r--src/lib/elementary/efl_access_object.c496
-rw-r--r--src/lib/elementary/efl_access_object.eo6
-rw-r--r--src/lib/elementary/efl_ui_widget.c813
-rw-r--r--src/lib/elementary/efl_ui_widget.eo18
-rw-r--r--src/lib/elementary/elm_atspi_app_object.c354
-rw-r--r--src/lib/elementary/elm_atspi_app_object.eo20
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c50
-rw-r--r--src/lib/elementary/elm_widget.h21
-rw-r--r--src/lib/elementary/elm_widget_item.eo18
9 files changed, 1239 insertions, 557 deletions
diff --git a/src/lib/elementary/efl_access_object.c b/src/lib/elementary/efl_access_object.c
index c011e62cfc..6a69f4b67a 100644
--- a/src/lib/elementary/efl_access_object.c
+++ b/src/lib/elementary/efl_access_object.c
@@ -8,368 +8,6 @@
#include "elm_widget.h"
#include "elm_priv.h"
-const char* Access_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"
-};
-
-struct _Efl_Access_Object_Data
-{
- Eina_List *relations;
- Eina_List *attr_list;
- const char *name;
- const char *description;
- const char *translation_domain;
- Efl_Access_Role role;
- Efl_Access_Reading_Info_Type reading_info;
- Efl_Access_Object *access_parent;
-};
-
-typedef struct _Efl_Access_Object_Data Efl_Access_Object_Data;
-
-EOLIAN static int
-_efl_access_object_index_in_parent_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- Eina_List *l, *children = NULL;
- Eo *chld, *parent = NULL;
- int ret = 0;
-
- parent = efl_access_object_access_parent_get(obj);
- if (!parent) return -1;
-
- children = efl_access_object_access_children_get(parent);
- 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.", efl_class_name_get(efl_class_get(obj)), efl_class_name_get(efl_class_get(parent)));
- ret = -1;
- }
- eina_list_free(children);
- return ret;
-}
-
-
-EOLIAN static Efl_Access_Object*
-_efl_access_object_access_parent_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- return pd->access_parent;
-}
-
-EOLIAN static void
-_efl_access_object_access_parent_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED, Efl_Access_Object *parent)
-{
- pd->access_parent = parent;
-}
-
-EOLIAN Eina_List*
-_efl_access_object_attributes_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- Eina_List *attr_list = NULL;
- if (pd->attr_list)
- {
- Eina_List *l = NULL;
- Efl_Access_Attribute *t_attr = NULL;
- EINA_LIST_FOREACH(pd->attr_list, l, t_attr)
- {
- Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (!attr)
- return attr_list;
-
- attr->key = eina_stringshare_add(t_attr->key);
- attr->value = eina_stringshare_add(t_attr->value);
- attr_list = eina_list_append(attr_list, attr);
- }
- }
- return attr_list;
-}
-
-EOLIAN static void
-_efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *key, const char *value)
-{
- Eina_List *l;
- Efl_Access_Attribute *attr = NULL;
-
- if (!key || !value) return;
-
- /* Check existing attributes has this key */
- EINA_LIST_FOREACH(pd->attr_list, l, attr)
- {
- if (!strcmp((const char *)attr->key, key))
- {
- eina_stringshare_replace(&attr->value, value);
- return;
- }
- }
-
- /* Add new attribute */
- attr = calloc(1, sizeof(Efl_Access_Attribute));
- if (!attr) return;
-
- attr->key = eina_stringshare_add(key);
- attr->value = eina_stringshare_add(value);
- pd->attr_list = eina_list_append(pd->attr_list, attr);
-}
-
-EOLIAN static void _efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- if (!pd->attr_list) return;
- Efl_Access_Attribute *attr;
- EINA_LIST_FREE(pd->attr_list, attr)
- {
- eina_stringshare_del(attr->key);
- eina_stringshare_del(attr->value);
- free(attr);
- }
- pd->attr_list = NULL;
-}
-
-EOLIAN static void
-_efl_access_object_reading_info_type_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Reading_Info_Type reading_info)
-{
- Eina_Strbuf *buf = NULL;
- pd->reading_info = reading_info;
- buf = eina_strbuf_new();
- eina_strbuf_reset(buf);
- if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
- {
- eina_strbuf_append(buf, "name");
- eina_strbuf_append_char(buf, '|');
- }
- if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE))
- {
- eina_strbuf_append(buf, "role");
- eina_strbuf_append_char(buf, '|');
- }
- if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION))
- {
- eina_strbuf_append(buf, "description");
- eina_strbuf_append_char(buf, '|');
- }
- if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE))
- {
- eina_strbuf_append(buf, "state");
- }
- efl_access_object_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
- eina_strbuf_free(buf);
-}
-
-EOLIAN Efl_Access_Reading_Info_Type
-_efl_access_object_reading_info_type_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- return pd->reading_info;
-}
-
-EOLIAN static Efl_Access_Role
-_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- return pd->role;
-}
-
-EOLIAN static void
-_efl_access_object_role_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Role role)
-{
- if (pd->role != role)
- {
- pd->role = role;
- efl_access_role_changed_signal_emit(obj);
- }
-}
-
-EOLIAN const char *
-_efl_access_object_role_name_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- Efl_Access_Role role;
-
- role = efl_access_object_role_get(obj);
-
- return role > EFL_ACCESS_ROLE_LAST_DEFINED ? "" : Access_Name[role];
-}
-
-EOLIAN const char *
-_efl_access_object_i18n_name_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
-#ifdef ENABLE_NLS
- if (pd->translation_domain)
- return dgettext(pd->translation_domain, pd->name);
-#endif
- return pd->name;
-}
-
-EOLIAN static void
-_efl_access_object_i18n_name_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *val)
-{
- eina_stringshare_replace(&pd->name, val);
-}
-
-const char * _efl_access_object_description_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
-#ifdef ENABLE_NLS
- if (pd->translation_domain)
- return dgettext(pd->translation_domain, pd->description);
-#endif
- return pd->description;
-}
-
-EOLIAN static void
-_efl_access_object_description_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *val)
-{
- eina_stringshare_replace(&pd->description, val);
-}
-
-EOLIAN static const char *
-_efl_access_object_localized_role_name_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- const char *ret = NULL;
- ret = efl_access_object_role_name_get(obj);
-#ifdef ENABLE_NLS
- ret = gettext(ret);
-#endif
- return ret;
-}
-
-EOLIAN static Eina_List *
-_efl_access_object_access_children_get(const Eo *obj, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- Eina_List *children = NULL;
- Eina_Iterator *iter = NULL;
- Eo *chld;
-
- // By default use Efl_Object object hierarchy
- /* XXX const */
- iter = efl_children_iterator_new((Eo *)obj);
- if (!iter) return NULL;
-
- EINA_ITERATOR_FOREACH(iter, chld)
- {
- if (efl_isa(chld, EFL_ACCESS_OBJECT_MIXIN))
- children = eina_list_append(children, chld);
- }
- eina_iterator_free(iter);
-
- return children;
-}
-
-EOLIAN static Efl_Access_State_Set
-_efl_access_object_state_set_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd EINA_UNUSED)
-{
- return 0;
-}
-
-EOLIAN Eina_Iterator *
-_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- return eina_list_iterator_new(pd->relations);
-}
-
EAPI void efl_access_attributes_list_free(Eina_List *list)
{
Efl_Access_Attribute *attr;
@@ -381,138 +19,4 @@ EAPI void efl_access_attributes_list_free(Eina_List *list)
}
}
-EOLIAN void
-_efl_access_object_translation_domain_set(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd, const char *domain)
-{
- eina_stringshare_replace(&pd->translation_domain, domain);
-}
-
-
-EOLIAN const char*
-_efl_access_object_translation_domain_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Data *pd)
-{
- return pd->translation_domain;
-}
-
-static void
-_on_rel_obj_del(void *data, const Efl_Event *event)
-{
- Efl_Access_Object_Data *sd = data;
- Efl_Access_Relation *rel;
- Eina_List *l, *l2, *p, *p2;
- Eo *rel_obj;
-
- EINA_LIST_FOREACH_SAFE(sd->relations, l, l2, rel)
- {
- EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
- {
- if (rel_obj == event->object)
- rel->objects = eina_list_remove_list(rel->objects, p);
- }
- if (!rel->objects)
- {
- sd->relations = eina_list_remove_list(sd->relations, l);
- free(rel);
- }
- }
-}
-
-EOLIAN static Eina_Bool
-_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
-{
- Efl_Access_Relation *rel;
- Eina_List *l;
-
- EINA_LIST_FOREACH(sd->relations, l, rel)
- {
- if (rel->type == type)
- {
- if (!eina_list_data_find(rel->objects, relation))
- {
- rel->objects = eina_list_append(rel->objects, relation);
- efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
- }
- return EINA_TRUE;
- }
- }
-
- rel = calloc(1, sizeof(Efl_Access_Relation));
- if (!rel) return EINA_FALSE;
-
- rel->type = type;
- rel->objects = eina_list_append(rel->objects, relation);
- sd->relations = eina_list_append(sd->relations, rel);
-
- efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
-
- return EINA_TRUE;
-}
-
-EOLIAN static void
-_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
-{
- Efl_Access_Relation *rel;
- Eina_List *l;
-
- EINA_LIST_FOREACH(sd->relations, l, rel)
- {
- if (rel->type == type)
- {
- if (relation)
- {
- if (eina_list_data_find(rel->objects, relation))
- {
- efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
- rel->objects = eina_list_remove(rel->objects, relation);
- }
- if (!rel->objects)
- {
- sd->relations = eina_list_remove(sd->relations, rel);
- free(rel);
- }
- }
- else
- {
- Eina_List *ll;
- Eo *ro;
-
- EINA_LIST_FOREACH(rel->objects, ll, ro)
- efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del, sd);
- sd->relations = eina_list_remove(sd->relations, rel);
- free(rel);
- }
- return ;
- }
- }
-}
-
-EOLIAN static void
-_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Efl_Access_Object_Data *sd)
-{
- Efl_Access_Relation *rel;
-
- EINA_LIST_FREE(sd->relations, rel)
- {
- Eina_List *l;
-
- EINA_LIST_FOREACH(rel->objects, l, obj)
- efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, sd);
- eina_list_free(rel->objects);
- free(rel);
- }
-}
-
-EOLIAN void
-_efl_access_object_efl_object_destructor(Eo *obj, Efl_Access_Object_Data *pd)
-{
- efl_access_object_attributes_clear(obj);
- efl_access_object_relationships_clear(obj);
-
- eina_stringshare_del(pd->name);
- eina_stringshare_del(pd->description);
- eina_stringshare_del(pd->translation_domain);
-
- efl_destructor(efl_super(obj, EFL_ACCESS_OBJECT_MIXIN));
-}
-
#include "efl_access_object.eo.c"
diff --git a/src/lib/elementary/efl_access_object.eo b/src/lib/elementary/efl_access_object.eo
index 96f6fc0a00..305385735f 100644
--- a/src/lib/elementary/efl_access_object.eo
+++ b/src/lib/elementary/efl_access_object.eo
@@ -231,11 +231,10 @@ struct Efl.Access.Relation
objects: list<Efl.Object>; [[List with relation objects]]
}
-mixin Efl.Access.Object requires Efl.Object
+interface Efl.Access.Object
{
[[Accessibility accessible mixin]]
eo_prefix: efl_access_object;
- data: Efl_Access_Object_Data;
methods {
@property localized_role_name @protected @beta {
[[Gets an localized string describing accessible object role name.]]
@@ -407,9 +406,6 @@ mixin Efl.Access.Object requires Efl.Object
[[Removes all relationships in accessible object.]]
}
}
- implements {
- Efl.Object.destructor;
- }
events {
property,changed: string; [[Called when property has changed]]
children,changed: Efl.Access.Event.Children_Changed.Data; [[Called when children have changed]]
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 86ea7c6aba..8a69cccb19 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -1479,7 +1479,7 @@ _efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Ob
if (_elm_widget_is(sobj))
sdc = efl_data_scope_get(sobj, MY_CLASS);
- if (efl_isa(sobj, EFL_ACCESS_OBJECT_MIXIN))
+ if (efl_isa(sobj, EFL_ACCESS_OBJECT_INTERFACE))
efl_access_object_access_parent_set(sobj, obj);
if (sobj == sd->parent_obj)
@@ -1594,7 +1594,7 @@ _efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Ob
EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE);
- if (efl_isa(sobj, EFL_ACCESS_OBJECT_MIXIN))
+ if (efl_isa(sobj, EFL_ACCESS_OBJECT_INTERFACE))
efl_access_object_access_parent_set(sobj, NULL);
sobj_parent = evas_object_data_del(sobj, "elm-parent");
@@ -4061,6 +4061,13 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
eina_hash_free(item->labels);
efl_access_removed(eo_item);
+ efl_access_object_attributes_clear(eo_item);
+ efl_access_object_relationships_clear(eo_item);
+
+ eina_stringshare_del(item->name);
+ eina_stringshare_del(item->description);
+ eina_stringshare_del(item->translation_domain);
+
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
@@ -5370,6 +5377,13 @@ _efl_ui_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
sd->manager.provider = NULL;
}
efl_access_removed(obj);
+ efl_access_object_attributes_clear(obj);
+ efl_access_object_relationships_clear(obj);
+
+ eina_stringshare_del(sd->name);
+ eina_stringshare_del(sd->description);
+ eina_stringshare_del(sd->translation_domain);
+
if (sd->logical.parent)
{
efl_weak_unref(&sd->logical.parent);
@@ -5455,10 +5469,17 @@ _efl_ui_widget_efl_access_component_focus_grab(Eo *obj, Elm_Widget_Smart_Data *p
EOLIAN static const char*
_efl_ui_widget_efl_access_object_i18n_name_get(const Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
- const char *ret, *name;
- name = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
+ const char *ret;
- if (name) return name;
+ if (_pd->name)
+ {
+#ifdef ENABLE_NLS
+ if (_pd->translation_domain)
+ return dgettext(_pd->translation_domain, _pd->name);
+ else
+#endif
+ return _pd->name;
+ }
ret = elm_object_text_get(obj);
if (!ret) return NULL;
@@ -5475,7 +5496,7 @@ _efl_ui_widget_efl_access_object_access_children_get(const Eo *obj EINA_UNUSED,
EINA_LIST_FOREACH(pd->subobjs, l, widget)
{
if (!elm_object_widget_check(widget)) continue;
- if (!efl_isa(widget, EFL_ACCESS_OBJECT_MIXIN)) continue;
+ if (!efl_isa(widget, EFL_ACCESS_OBJECT_INTERFACE)) continue;
accs = eina_list_append(accs, widget);
}
return accs;
@@ -5486,8 +5507,6 @@ _efl_ui_widget_efl_access_object_state_set_get(const Eo *obj, Elm_Widget_Smart_D
{
Efl_Access_State_Set states = 0;
- states = efl_access_object_state_set_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
-
if (evas_object_visible_get(obj))
{
STATE_TYPE_SET(states, EFL_ACCESS_STATE_VISIBLE);
@@ -5518,7 +5537,21 @@ _efl_ui_widget_efl_access_object_attributes_get(const Eo *obj, Elm_Widget_Smart_
Eina_List *attr_list = NULL;
Efl_Access_Attribute *attr = NULL;
- attr_list = efl_access_object_attributes_get(efl_super(obj, EFL_UI_WIDGET_CLASS));
+ if (pd->attr_list)
+ {
+ Eina_List *l = NULL;
+ Efl_Access_Attribute *t_attr = NULL;
+ EINA_LIST_FOREACH(pd->attr_list, l, t_attr)
+ {
+ Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr)
+ return attr_list;
+
+ attr->key = eina_stringshare_add(t_attr->key);
+ attr->value = eina_stringshare_add(t_attr->value);
+ attr_list = eina_list_append(attr_list, attr);
+ }
+ }
//Add type and style information in addition.
type = elm_widget_type_get(obj);
@@ -5555,7 +5588,21 @@ _elm_widget_item_efl_access_object_attributes_get(const Eo *eo_item, Elm_Widget_
Eina_List *attr_list = NULL;
Efl_Access_Attribute *attr = NULL;
- attr_list = efl_access_object_attributes_get(efl_super(eo_item, ELM_WIDGET_ITEM_CLASS));
+ if (pd->attr_list)
+ {
+ Eina_List *l = NULL;
+ Efl_Access_Attribute *t_attr = NULL;
+ EINA_LIST_FOREACH(pd->attr_list, l, t_attr)
+ {
+ Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr)
+ return attr_list;
+
+ attr->key = eina_stringshare_add(t_attr->key);
+ attr->value = eina_stringshare_add(t_attr->value);
+ attr_list = eina_list_append(attr_list, attr);
+ }
+ }
style = elm_object_item_style_get(eo_item);
if (style)
@@ -5614,7 +5661,7 @@ _efl_ui_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd
if ((klass == EFL_CONFIG_INTERFACE) || (klass == EFL_CONFIG_GLOBAL_CLASS))
return _efl_config_obj;
- if (klass == EFL_ACCESS_OBJECT_MIXIN)
+ if (klass == EFL_ACCESS_OBJECT_INTERFACE)
return (Eo*)obj;
if (pd->provider_lookup) return NULL;
@@ -6592,6 +6639,750 @@ _elm_widget_item_access_actions_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_D
/* Efl.Access.Action end */
+const char* Access_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
+_efl_ui_widget_efl_access_object_index_in_parent_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ Eina_List *l, *children = NULL;
+ Eo *chld, *parent = NULL;
+ int ret = 0;
+
+ parent = efl_access_object_access_parent_get(obj);
+ if (!parent) return -1;
+
+ children = efl_access_object_access_children_get(parent);
+ 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.", efl_class_name_get(efl_class_get(obj)), efl_class_name_get(efl_class_get(parent)));
+ ret = -1;
+ }
+ eina_list_free(children);
+ return ret;
+}
+
+
+EOLIAN static Efl_Access_Object*
+_efl_ui_widget_efl_access_object_access_parent_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ return pd->access_parent;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_access_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED, Efl_Access_Object *parent)
+{
+ pd->access_parent = parent;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, const char *key, const char *value)
+{
+ Eina_List *l;
+ Efl_Access_Attribute *attr = NULL;
+
+ if (!key || !value) return;
+
+ /* Check existing attributes has this key */
+ EINA_LIST_FOREACH(pd->attr_list, l, attr)
+ {
+ if (!strcmp((const char *)attr->key, key))
+ {
+ eina_stringshare_replace(&attr->value, value);
+ return;
+ }
+ }
+
+ /* Add new attribute */
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr) return;
+
+ attr->key = eina_stringshare_add(key);
+ attr->value = eina_stringshare_add(value);
+ pd->attr_list = eina_list_append(pd->attr_list, attr);
+}
+
+EOLIAN static void _efl_ui_widget_efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+ if (!pd->attr_list) return;
+ Efl_Access_Attribute *attr;
+ EINA_LIST_FREE(pd->attr_list, attr)
+ {
+ eina_stringshare_del(attr->key);
+ eina_stringshare_del(attr->value);
+ free(attr);
+ }
+ pd->attr_list = NULL;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_reading_info_type_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Access_Reading_Info_Type reading_info)
+{
+ Eina_Strbuf *buf = NULL;
+ pd->reading_info = reading_info;
+ buf = eina_strbuf_new();
+ eina_strbuf_reset(buf);
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
+ {
+ eina_strbuf_append(buf, "name");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE))
+ {
+ eina_strbuf_append(buf, "role");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION))
+ {
+ eina_strbuf_append(buf, "description");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE))
+ {
+ eina_strbuf_append(buf, "state");
+ }
+ efl_access_object_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
+ eina_strbuf_free(buf);
+}
+
+EOLIAN Efl_Access_Reading_Info_Type
+_efl_ui_widget_efl_access_object_reading_info_type_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+ return pd->reading_info;
+}
+
+EOLIAN static Efl_Access_Role
+_efl_ui_widget_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+ return pd->role;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_role_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Access_Role role)
+{
+ if (pd->role != role)
+ {
+ pd->role = role;
+ efl_access_role_changed_signal_emit(obj);
+ }
+}
+
+EOLIAN const char *
+_efl_ui_widget_efl_access_object_role_name_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ Efl_Access_Role role;
+
+ role = efl_access_object_role_get(obj);
+
+ return role > EFL_ACCESS_ROLE_LAST_DEFINED ? "" : Access_Name[role];
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_i18n_name_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->name, val);
+}
+
+const char * _efl_ui_widget_efl_access_object_description_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+#ifdef ENABLE_NLS
+ if (pd->translation_domain)
+ return dgettext(pd->translation_domain, pd->description);
+#endif
+ return pd->description;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_description_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->description, val);
+}
+
+EOLIAN static const char *
+_efl_ui_widget_efl_access_object_localized_role_name_get(const Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
+{
+ const char *ret = NULL;
+ ret = efl_access_object_role_name_get(obj);
+#ifdef ENABLE_NLS
+ ret = gettext(ret);
+#endif
+ return ret;
+}
+
+EOLIAN Eina_Iterator *
+_efl_ui_widget_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+ return eina_list_iterator_new(pd->relations);
+}
+
+EOLIAN void
+_efl_ui_widget_efl_access_object_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, const char *domain)
+{
+ eina_stringshare_replace(&pd->translation_domain, domain);
+}
+
+
+EOLIAN const char*
+_efl_ui_widget_efl_access_object_translation_domain_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+ return pd->translation_domain;
+}
+
+static void
+_on_rel_obj_del(void *data, const Efl_Event *event)
+{
+ Elm_Widget_Smart_Data *sd = data;
+ Efl_Access_Relation *rel;
+ Eina_List *l, *l2, *p, *p2;
+ Eo *rel_obj;
+
+ EINA_LIST_FOREACH_SAFE(sd->relations, l, l2, rel)
+ {
+ EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
+ {
+ if (rel_obj == event->object)
+ rel->objects = eina_list_remove_list(rel->objects, p);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove_list(sd->relations, l);
+ free(rel);
+ }
+ }
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_widget_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (!eina_list_data_find(rel->objects, relation))
+ {
+ rel->objects = eina_list_append(rel->objects, relation);
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ }
+ return EINA_TRUE;
+ }
+ }
+
+ rel = calloc(1, sizeof(Efl_Access_Relation));
+ if (!rel) return EINA_FALSE;
+
+ rel->type = type;
+ rel->objects = eina_list_append(rel->objects, relation);
+ sd->relations = eina_list_append(sd->relations, rel);
+
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+
+ return EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (relation)
+ {
+ if (eina_list_data_find(rel->objects, relation))
+ {
+ efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ rel->objects = eina_list_remove(rel->objects, relation);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ }
+ else
+ {
+ Eina_List *ll;
+ Eo *ro;
+
+ EINA_LIST_FOREACH(rel->objects, ll, ro)
+ efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ return ;
+ }
+ }
+}
+
+EOLIAN static void
+_efl_ui_widget_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+{
+ Efl_Access_Relation *rel;
+
+ EINA_LIST_FREE(sd->relations, rel)
+ {
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ eina_list_free(rel->objects);
+ free(rel);
+ }
+}
+
+// Elm.Widget.Item
+
+EOLIAN static int
+_elm_widget_item_efl_access_object_index_in_parent_get(const Eo *obj, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ Eina_List *l, *children = NULL;
+ Eo *chld, *parent = NULL;
+ int ret = 0;
+
+ parent = efl_access_object_access_parent_get(obj);
+ if (!parent) return -1;
+
+ children = efl_access_object_access_children_get(parent);
+ 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.", efl_class_name_get(efl_class_get(obj)), efl_class_name_get(efl_class_get(parent)));
+ ret = -1;
+ }
+ eina_list_free(children);
+ return ret;
+}
+
+
+EOLIAN static Efl_Access_Object*
+_elm_widget_item_efl_access_object_access_parent_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ return pd->access_parent;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_access_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd EINA_UNUSED, Efl_Access_Object *parent)
+{
+ pd->access_parent = parent;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd, const char *key, const char *value)
+{
+ Eina_List *l;
+ Efl_Access_Attribute *attr = NULL;
+
+ if (!key || !value) return;
+
+ /* Check existing attributes has this key */
+ EINA_LIST_FOREACH(pd->attr_list, l, attr)
+ {
+ if (!strcmp((const char *)attr->key, key))
+ {
+ eina_stringshare_replace(&attr->value, value);
+ return;
+ }
+ }
+
+ /* Add new attribute */
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr) return;
+
+ attr->key = eina_stringshare_add(key);
+ attr->value = eina_stringshare_add(value);
+ pd->attr_list = eina_list_append(pd->attr_list, attr);
+}
+
+EOLIAN static void _elm_widget_item_efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+ if (!pd->attr_list) return;
+ Efl_Access_Attribute *attr;
+ EINA_LIST_FREE(pd->attr_list, attr)
+ {
+ eina_stringshare_del(attr->key);
+ eina_stringshare_del(attr->value);
+ free(attr);
+ }
+ pd->attr_list = NULL;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_reading_info_type_set(Eo *obj, Elm_Widget_Item_Data *pd, Efl_Access_Reading_Info_Type reading_info)
+{
+ Eina_Strbuf *buf = NULL;
+ pd->reading_info = reading_info;
+ buf = eina_strbuf_new();
+ eina_strbuf_reset(buf);
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
+ {
+ eina_strbuf_append(buf, "name");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE))
+ {
+ eina_strbuf_append(buf, "role");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION))
+ {
+ eina_strbuf_append(buf, "description");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE))
+ {
+ eina_strbuf_append(buf, "state");
+ }
+ efl_access_object_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
+ eina_strbuf_free(buf);
+}
+
+EOLIAN Efl_Access_Reading_Info_Type
+_elm_widget_item_efl_access_object_reading_info_type_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+ return pd->reading_info;
+}
+
+EOLIAN static Efl_Access_Role
+_elm_widget_item_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+ return pd->role;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_role_set(Eo *obj, Elm_Widget_Item_Data *pd, Efl_Access_Role role)
+{
+ if (pd->role != role)
+ {
+ pd->role = role;
+ efl_access_role_changed_signal_emit(obj);
+ }
+}
+
+EOLIAN const char *
+_elm_widget_item_efl_access_object_role_name_get(const Eo *obj, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ Efl_Access_Role role;
+
+ role = efl_access_object_role_get(obj);
+
+ return role > EFL_ACCESS_ROLE_LAST_DEFINED ? "" : Access_Name[role];
+}
+
+EOLIAN const char *
+_elm_widget_item_efl_access_object_i18n_name_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+#ifdef ENABLE_NLS
+ if (pd->translation_domain)
+ return dgettext(pd->translation_domain, pd->name);
+#endif
+ return pd->name;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_i18n_name_set(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->name, val);
+}
+
+const char * _elm_widget_item_efl_access_object_description_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+#ifdef ENABLE_NLS
+ if (pd->translation_domain)
+ return dgettext(pd->translation_domain, pd->description);
+#endif
+ return pd->description;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_description_set(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->description, val);
+}
+
+EOLIAN static const char *
+_elm_widget_item_efl_access_object_localized_role_name_get(const Eo *obj, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ const char *ret = NULL;
+ ret = efl_access_object_role_name_get(obj);
+#ifdef ENABLE_NLS
+ ret = gettext(ret);
+#endif
+ return ret;
+}
+
+EOLIAN static Eina_List *
+_elm_widget_item_efl_access_object_access_children_get(const Eo *obj, Elm_Widget_Item_Data *pd EINA_UNUSED)
+{
+ Eina_List *children = NULL;
+ Eina_Iterator *iter = NULL;
+ Eo *chld;
+
+ // By default use Efl_Object object hierarchy
+ /* XXX const */
+ iter = efl_children_iterator_new((Eo *)obj);
+ if (!iter) return NULL;
+
+ EINA_ITERATOR_FOREACH(iter, chld)
+ {
+ if (efl_isa(chld, EFL_ACCESS_OBJECT_INTERFACE))
+ children = eina_list_append(children, chld);
+ }
+ eina_iterator_free(iter);
+
+ return children;
+}
+
+EOLIAN Eina_Iterator *
+_elm_widget_item_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+ return eina_list_iterator_new(pd->relations);
+}
+
+EOLIAN void
+_elm_widget_item_efl_access_object_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd, const char *domain)
+{
+ eina_stringshare_replace(&pd->translation_domain, domain);
+}
+
+
+EOLIAN const char*
+_elm_widget_item_efl_access_object_translation_domain_get(const Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *pd)
+{
+ return pd->translation_domain;
+}
+
+static void
+_on_rel_obj_del2(void *data, const Efl_Event *event)
+{
+ Elm_Widget_Item_Data *sd = data;
+ Efl_Access_Relation *rel;
+ Eina_List *l, *l2, *p, *p2;
+ Eo *rel_obj;
+
+ EINA_LIST_FOREACH_SAFE(sd->relations, l, l2, rel)
+ {
+ EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
+ {
+ if (rel_obj == event->object)
+ rel->objects = eina_list_remove_list(rel->objects, p);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove_list(sd->relations, l);
+ free(rel);
+ }
+ }
+}
+
+EOLIAN static Eina_Bool
+_elm_widget_item_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (!eina_list_data_find(rel->objects, relation))
+ {
+ rel->objects = eina_list_append(rel->objects, relation);
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del2, sd);
+ }
+ return EINA_TRUE;
+ }
+ }
+
+ rel = calloc(1, sizeof(Efl_Access_Relation));
+ if (!rel) return EINA_FALSE;
+
+ rel->type = type;
+ rel->objects = eina_list_append(rel->objects, relation);
+ sd->relations = eina_list_append(sd->relations, rel);
+
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del2, sd);
+
+ return EINA_TRUE;
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (relation)
+ {
+ if (eina_list_data_find(rel->objects, relation))
+ {
+ efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del2, sd);
+ rel->objects = eina_list_remove(rel->objects, relation);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ }
+ else
+ {
+ Eina_List *ll;
+ Eo *ro;
+
+ EINA_LIST_FOREACH(rel->objects, ll, ro)
+ efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del2, sd);
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ return ;
+ }
+ }
+}
+
+EOLIAN static void
+_elm_widget_item_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *sd)
+{
+ Efl_Access_Relation *rel;
+
+ EINA_LIST_FREE(sd->relations, rel)
+ {
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del2, sd);
+ eina_list_free(rel->objects);
+ free(rel);
+ }
+}
/* Internal EO APIs and hidden overrides */
EFL_FUNC_BODY_CONST(efl_ui_widget_default_content_part_get, const char *, NULL)
diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo
index 736b9ecca6..36c427fee2 100644
--- a/src/lib/elementary/efl_ui_widget.eo
+++ b/src/lib/elementary/efl_ui_widget.eo
@@ -583,10 +583,26 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
Efl.Canvas.Group.group_calculate;
Efl.Canvas.Group.group_member_del;
Efl.Canvas.Group.group_member_add;
- Efl.Access.Object.i18n_name { get; }
Efl.Access.Object.state_set { get; }
Efl.Access.Object.access_children { get; }
Efl.Access.Object.attributes { get; }
+ //TODO remove
+ Efl.Access.Object.access_parent { get; set; }
+ Efl.Access.Object.localized_role_name { get; }
+ Efl.Access.Object.index_in_parent { get; }
+ Efl.Access.Object.i18n_name { get; set; }
+ Efl.Access.Object.attribute_append;
+ Efl.Access.Object.attributes_clear;
+ Efl.Access.Object.reading_info_type { get; set; }
+ Efl.Access.Object.role { get; set; }
+ Efl.Access.Object.role_name { get; }
+ Efl.Access.Object.description { get; set; }
+ Efl.Access.Object.relations_get;
+ Efl.Access.Object.translation_domain { get; set; }
+ Efl.Access.Object.relationship_append;
+ Efl.Access.Object.relationship_remove;
+ Efl.Access.Object.relationships_clear;
+ //TODO end
Efl.Access.Component.focus_grab;
Efl.Access.Component.screen_position { get; set; }
Efl.Access.Component.contains;
diff --git a/src/lib/elementary/elm_atspi_app_object.c b/src/lib/elementary/elm_atspi_app_object.c
index 3f4261df57..5b1360dd12 100644
--- a/src/lib/elementary/elm_atspi_app_object.c
+++ b/src/lib/elementary/elm_atspi_app_object.c
@@ -15,7 +15,15 @@ typedef struct _Elm_Atspi_App_Object_Data Elm_Atspi_App_Object_Data;
struct _Elm_Atspi_App_Object_Data
{
- const char *descr;
+ //TODO Efl.Access.Object - remove during refactor
+ Eina_List *relations;
+ Eina_List *attr_list;
+ const char *name;
+ const char *description;
+ const char *translation_domain;
+ Efl_Access_Role role;
+ Efl_Access_Reading_Info_Type reading_info;
+ Efl_Access_Object *access_parent;
};
EOLIAN static Eo*
@@ -29,13 +37,20 @@ _elm_atspi_app_object_efl_object_constructor(Eo *obj, Elm_Atspi_App_Object_Data
obj = efl_constructor(efl_super(obj, ELM_ATSPI_APP_OBJECT_CLASS));
instance = obj;
+ _pd->role = EFL_ACCESS_ROLE_APPLICATION;
return obj;
}
EOLIAN static void
-_elm_atspi_app_object_efl_object_destructor(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd)
+_elm_atspi_app_object_efl_object_destructor(Eo *obj, Elm_Atspi_App_Object_Data *_pd)
{
- if (_pd->descr) eina_stringshare_del(_pd->descr);
+ efl_access_removed(obj);
+ efl_access_object_attributes_clear(obj);
+ efl_access_object_relationships_clear(obj);
+
+ eina_stringshare_del(_pd->name);
+ eina_stringshare_del(_pd->description);
+ eina_stringshare_del(_pd->translation_domain);
efl_destructor(efl_super(obj, ELM_ATSPI_APP_OBJECT_CLASS));
}
@@ -48,7 +63,7 @@ _elm_atspi_app_object_efl_access_object_access_children_get(const Eo *obj EINA_U
EINA_LIST_FOREACH(_elm_win_list, l, win)
{
- if (!efl_isa(win, EFL_ACCESS_OBJECT_MIXIN))
+ if (!efl_isa(win, EFL_ACCESS_OBJECT_INTERFACE))
continue;
accs = eina_list_append(accs, win);
}
@@ -64,30 +79,337 @@ _elm_atspi_app_object_efl_access_object_i18n_name_get(const Eo *obj EINA_UNUSED,
return ret;
}
-EOLIAN static const char*
-_elm_atspi_app_object_efl_access_object_description_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd)
+EOLIAN static Elm_Atspi_App_Object*
+_elm_atspi_app_object_instance_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+{
+ if (!instance)
+ instance = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, efl_main_loop_get());
+ return instance;
+}
+
+EOLIAN static int
+_elm_atspi_app_object_efl_access_object_index_in_parent_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd EINA_UNUSED)
+{
+ Eina_List *l, *children = NULL;
+ Eo *chld, *parent = NULL;
+ int ret = 0;
+
+ parent = efl_access_object_access_parent_get(obj);
+ if (!parent) return -1;
+
+ children = efl_access_object_access_children_get(parent);
+ 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.", efl_class_name_get(efl_class_get(obj)), efl_class_name_get(efl_class_get(parent)));
+ ret = -1;
+ }
+ eina_list_free(children);
+ return ret;
+}
+
+EOLIAN static Efl_Access_Object*
+_elm_atspi_app_object_efl_access_object_access_parent_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd EINA_UNUSED)
+{
+ return pd->access_parent;
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_access_parent_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd EINA_UNUSED, Efl_Access_Object *parent)
+{
+ pd->access_parent = parent;
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_attribute_append(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd, const char *key, const char *value)
+{
+ Eina_List *l;
+ Efl_Access_Attribute *attr = NULL;
+
+ if (!key || !value) return;
+
+ /* Check existing attributes has this key */
+ EINA_LIST_FOREACH(pd->attr_list, l, attr)
+ {
+ if (!strcmp((const char *)attr->key, key))
+ {
+ eina_stringshare_replace(&attr->value, value);
+ return;
+ }
+ }
+
+ /* Add new attribute */
+ attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr) return;
+
+ attr->key = eina_stringshare_add(key);
+ attr->value = eina_stringshare_add(value);
+ pd->attr_list = eina_list_append(pd->attr_list, attr);
+}
+
+EOLIAN static void _elm_atspi_app_object_efl_access_object_attributes_clear(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
{
- return _pd->descr;
+ if (!pd->attr_list) return;
+ Efl_Access_Attribute *attr;
+ EINA_LIST_FREE(pd->attr_list, attr)
+ {
+ eina_stringshare_del(attr->key);
+ eina_stringshare_del(attr->value);
+ free(attr);
+ }
+ pd->attr_list = NULL;
}
EOLIAN static void
-_elm_atspi_app_object_efl_access_object_description_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED, const char *descr)
+_elm_atspi_app_object_efl_access_object_reading_info_type_set(Eo *obj, Elm_Atspi_App_Object_Data *pd, Efl_Access_Reading_Info_Type reading_info)
{
- eina_stringshare_replace(&_pd->descr, descr);
+ Eina_Strbuf *buf = NULL;
+ pd->reading_info = reading_info;
+ buf = eina_strbuf_new();
+ eina_strbuf_reset(buf);
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
+ {
+ eina_strbuf_append(buf, "name");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE))
+ {
+ eina_strbuf_append(buf, "role");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION))
+ {
+ eina_strbuf_append(buf, "description");
+ eina_strbuf_append_char(buf, '|');
+ }
+ if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE))
+ {
+ eina_strbuf_append(buf, "state");
+ }
+ efl_access_object_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
+ eina_strbuf_free(buf);
+}
+
+EOLIAN Efl_Access_Reading_Info_Type
+_elm_atspi_app_object_efl_access_object_reading_info_type_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
+{
+ return pd->reading_info;
}
EOLIAN static Efl_Access_Role
-_elm_atspi_app_object_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
+_elm_atspi_app_object_efl_access_object_role_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
{
- return EFL_ACCESS_ROLE_APPLICATION;
+ return pd->role;
}
-EOLIAN static Elm_Atspi_App_Object*
-_elm_atspi_app_object_instance_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_role_set(Eo *obj, Elm_Atspi_App_Object_Data *pd, Efl_Access_Role role)
{
- if (!instance)
- instance = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, efl_main_loop_get());
- return instance;
+ if (pd->role != role)
+ {
+ pd->role = role;
+ efl_access_role_changed_signal_emit(obj);
+ }
+}
+
+EOLIAN const char *
+_elm_atspi_app_object_efl_access_object_role_name_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd EINA_UNUSED)
+{
+ return "application";
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_i18n_name_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->name, val);
+}
+
+const char * _elm_atspi_app_object_efl_access_object_description_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
+{
+#ifdef ENABLE_NLS
+ if (pd->translation_domain)
+ return dgettext(pd->translation_domain, pd->description);
+#endif
+ return pd->description;
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_description_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd, const char *val)
+{
+ eina_stringshare_replace(&pd->description, val);
+}
+
+EOLIAN static const char *
+_elm_atspi_app_object_efl_access_object_localized_role_name_get(const Eo *obj, Elm_Atspi_App_Object_Data *pd EINA_UNUSED)
+{
+ const char *ret = NULL;
+ ret = efl_access_object_role_name_get(obj);
+#ifdef ENABLE_NLS
+ ret = gettext(ret);
+#endif
+ return ret;
+}
+
+EOLIAN Eina_Iterator *
+_elm_atspi_app_object_efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
+{
+ return eina_list_iterator_new(pd->relations);
+}
+
+EOLIAN void
+_elm_atspi_app_object_efl_access_object_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd, const char *domain)
+{
+ eina_stringshare_replace(&pd->translation_domain, domain);
+}
+
+EOLIAN Efl_Access_State_Set
+_elm_atspi_app_object_efl_access_object_state_set_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN const char*
+_elm_atspi_app_object_efl_access_object_translation_domain_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
+{
+ return pd->translation_domain;
+}
+
+static void
+_on_rel_obj_del(void *data, const Efl_Event *event)
+{
+ Elm_Atspi_App_Object_Data *sd = data;
+ Efl_Access_Relation *rel;
+ Eina_List *l, *l2, *p, *p2;
+ Eo *rel_obj;
+
+ EINA_LIST_FOREACH_SAFE(sd->relations, l, l2, rel)
+ {
+ EINA_LIST_FOREACH_SAFE(rel->objects, p, p2, rel_obj)
+ {
+ if (rel_obj == event->object)
+ rel->objects = eina_list_remove_list(rel->objects, p);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove_list(sd->relations, l);
+ free(rel);
+ }
+ }
+}
+
+EOLIAN static Eina_Bool
+_elm_atspi_app_object_efl_access_object_relationship_append(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (!eina_list_data_find(rel->objects, relation))
+ {
+ rel->objects = eina_list_append(rel->objects, relation);
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ }
+ return EINA_TRUE;
+ }
+ }
+
+ rel = calloc(1, sizeof(Efl_Access_Relation));
+ if (!rel) return EINA_FALSE;
+
+ rel->type = type;
+ rel->objects = eina_list_append(rel->objects, relation);
+ sd->relations = eina_list_append(sd->relations, rel);
+
+ efl_event_callback_add((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+
+ return EINA_TRUE;
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_relationship_remove(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *sd, Efl_Access_Relation_Type type, const Efl_Access_Object *relation)
+{
+ Efl_Access_Relation *rel;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(sd->relations, l, rel)
+ {
+ if (rel->type == type)
+ {
+ if (relation)
+ {
+ if (eina_list_data_find(rel->objects, relation))
+ {
+ efl_event_callback_del((Eo *) relation, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ rel->objects = eina_list_remove(rel->objects, relation);
+ }
+ if (!rel->objects)
+ {
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ }
+ else
+ {
+ Eina_List *ll;
+ Eo *ro;
+
+ EINA_LIST_FOREACH(rel->objects, ll, ro)
+ efl_event_callback_del(ro, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ sd->relations = eina_list_remove(sd->relations, rel);
+ free(rel);
+ }
+ return ;
+ }
+ }
+}
+
+EOLIAN static void
+_elm_atspi_app_object_efl_access_object_relationships_clear(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *sd)
+{
+ Efl_Access_Relation *rel;
+
+ EINA_LIST_FREE(sd->relations, rel)
+ {
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(rel->objects, l, obj)
+ efl_event_callback_del(obj, EFL_EVENT_DEL, _on_rel_obj_del, sd);
+ eina_list_free(rel->objects);
+ free(rel);
+ }
+}
+
+EOLIAN static Eina_List*
+_elm_atspi_app_object_efl_access_object_attributes_get(const Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *pd)
+{
+ Eina_List *attr_list = NULL;
+
+ if (pd->attr_list)
+ {
+ Eina_List *l = NULL;
+ Efl_Access_Attribute *t_attr = NULL;
+ EINA_LIST_FOREACH(pd->attr_list, l, t_attr)
+ {
+ Efl_Access_Attribute *attr = calloc(1, sizeof(Efl_Access_Attribute));
+ if (!attr)
+ return attr_list;
+
+ attr->key = eina_stringshare_add(t_attr->key);
+ attr->value = eina_stringshare_add(t_attr->value);
+ attr_list = eina_list_append(attr_list, attr);
+ }
+ }
+ return attr_list;
}
#include "elm_atspi_app_object.eo.c"
diff --git a/src/lib/elementary/elm_atspi_app_object.eo b/src/lib/elementary/elm_atspi_app_object.eo
index 456c7f19d5..86ca6b8b25 100644
--- a/src/lib/elementary/elm_atspi_app_object.eo
+++ b/src/lib/elementary/elm_atspi_app_object.eo
@@ -15,9 +15,23 @@ class Elm.Atspi.App.Object extends Efl.Object implements Efl.Access.Object
implements {
Efl.Object.destructor;
Efl.Object.constructor;
- Efl.Access.Object.i18n_name { get; }
- Efl.Access.Object.description { get; set; }
- Efl.Access.Object.role { get; }
+ Efl.Access.Object.i18n_name { get; set; }
Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.access_parent { get; set; }
+ Efl.Access.Object.index_in_parent { get; }
+ Efl.Access.Object.attribute_append;
+ Efl.Access.Object.attributes_clear;
+ Efl.Access.Object.attributes { get; }
+ Efl.Access.Object.reading_info_type { get; set; }
+ Efl.Access.Object.state_set { get; }
+ Efl.Access.Object.role { get; set; }
+ Efl.Access.Object.role_name { get; }
+ Efl.Access.Object.localized_role_name { get; }
+ Efl.Access.Object.description { get; set; }
+ Efl.Access.Object.relations_get;
+ Efl.Access.Object.translation_domain { get; set; }
+ Efl.Access.Object.relationship_append;
+ Efl.Access.Object.relationship_remove;
+ Efl.Access.Object.relationships_clear;
}
}
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index 663d3dcbd5..3ff24fe378 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -489,7 +489,7 @@ _accessible_get_role(const Eldbus_Service_Interface *iface, const Eldbus_Message
AtspiRole atspi_role = ATSPI_ROLE_INVALID;
Efl_Access_Role role;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
role = efl_access_object_role_get(obj);
@@ -508,7 +508,7 @@ _accessible_get_role_name(const Eldbus_Service_Interface *iface, const Eldbus_Me
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
role_name = efl_access_object_role_name_get(obj);
@@ -526,7 +526,7 @@ _accessible_get_localized_role_name(const Eldbus_Service_Interface *iface, const
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
l_role_name = efl_access_object_localized_role_name_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(l_role_name, NULL);
@@ -549,7 +549,7 @@ _accessible_get_children(const Eldbus_Service_Interface *iface, const Eldbus_Mes
Eldbus_Message_Iter *iter, *iter_array;
Eo *children;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
children_list = efl_access_object_access_children_get(obj);
@@ -584,7 +584,7 @@ _accessible_get_application(const Eldbus_Service_Interface *iface, const Eldbus_
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(bridge, pd, NULL);
ret = eldbus_message_method_return_new(msg);
@@ -608,7 +608,7 @@ _accessible_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_M
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
if (!ret) goto error;
@@ -650,7 +650,7 @@ _accessible_interfaces_get(const Eldbus_Service_Interface *iface, const Eldbus_M
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -720,7 +720,7 @@ _accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Messag
Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -756,7 +756,7 @@ _accessible_get_index_in_parent(const Eldbus_Service_Interface *iface EINA_UNUSE
Eldbus_Message *ret;
int idx = -1;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -780,7 +780,7 @@ _accessible_child_at_index(const Eldbus_Service_Interface *iface EINA_UNUSED, co
Eldbus_Message *ret;
Eldbus_Message_Iter *iter;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
if (!eldbus_message_arguments_get(msg, "i", &idx))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -811,7 +811,7 @@ _accessible_get_relation_set(const Eldbus_Service_Interface *iface EINA_UNUSED,
Eina_List *l;
Eina_Iterator *it;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -1222,7 +1222,7 @@ _image_extents_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *
Eo *obj = _bridge_object_from_path(bridge, obj_path);
Eina_Rect r;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
if (!eldbus_message_arguments_get(msg, "u", &type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -1248,7 +1248,7 @@ _image_position_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
int x = -1, y = -1;
Eina_Bool screen_coords;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
if (!eldbus_message_arguments_get(msg, "u", &type))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type.");
@@ -1276,7 +1276,7 @@ _image_size_get(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg
Eo *obj = _bridge_object_from_path(bridge, obj_path);
int w = -1, h = -1;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
ret = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
@@ -2044,7 +2044,7 @@ _bridge_object_from_path(Eo *bridge, const char *path)
return NULL;
}
- ret = efl_isa(eo, EFL_ACCESS_OBJECT_MIXIN) ? eo : NULL;
+ ret = efl_isa(eo, EFL_ACCESS_OBJECT_INTERFACE) ? eo : NULL;
return ret;
}
@@ -2075,7 +2075,7 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
Eo *bridge = eldbus_service_object_data_get(interface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *ret_obj = NULL, *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, request_msg, error);
+ ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, request_msg, error);
if (!strcmp(property, "Name"))
{
@@ -2235,7 +2235,7 @@ _image_properties_get(const Eldbus_Service_Interface *interface, const char *pro
Eo *bridge = eldbus_service_object_data_get(interface, ELM_ATSPI_BRIDGE_CLASS_NAME);
Eo *obj = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, request_msg, error);
+ ELM_ATSPI_PROPERTY_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, request_msg, error);
if (!strcmp(property, "ImageDescription"))
{
@@ -2984,7 +2984,7 @@ _collection_get_matches_from(const Eldbus_Service_Interface *iface EINA_UNUSED,
AtspiCollectionSortOrder sortby;
Eina_List *result = NULL;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -2996,7 +2996,7 @@ _collection_get_matches_from(const Eldbus_Service_Interface *iface EINA_UNUSED,
current = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_INTERFACE, msg);
if (!_collection_iter_match_rule_get(rule_iter, &rule))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Invalid match rule parameters.");
@@ -3056,7 +3056,7 @@ _collection_get_matches_to(const Eldbus_Service_Interface *iface EINA_UNUSED, co
Eina_List *result = NULL;
Eina_Bool limit;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -3068,7 +3068,7 @@ _collection_get_matches_to(const Eldbus_Service_Interface *iface EINA_UNUSED, co
current = _bridge_object_from_path(bridge, obj_path);
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(current, EFL_ACCESS_OBJECT_INTERFACE, msg);
if (!_collection_iter_match_rule_get(rule_iter, &rule))
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Invalid match rule parameters.");
@@ -3096,7 +3096,7 @@ _collection_get_matches(const Eldbus_Service_Interface *iface, const Eldbus_Mess
AtspiCollectionSortOrder sortby;
Eina_List *result = NULL;
- ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_MIXIN, msg);
+ ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_OBJECT_INTERFACE, msg);
iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
@@ -3170,7 +3170,7 @@ _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj)
iter_array = eldbus_message_iter_container_new(iter, 'a', "s");
if (!iter_array) return;
- if (efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
+ if (efl_isa(obj, EFL_ACCESS_OBJECT_INTERFACE))
{
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_ACCESSIBLE);
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COLLECTION);
@@ -3183,7 +3183,7 @@ _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj)
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_COMPONENT);
if (efl_isa(obj, EFL_ACCESS_EDITABLE_TEXT_INTERFACE))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_EDITABLE_TEXT);
- if (efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
+ if (efl_isa(obj, EFL_ACCESS_OBJECT_INTERFACE))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_IMAGE);
if (efl_isa(obj, EFL_ACCESS_SELECTION_INTERFACE))
eldbus_message_iter_basic_append(iter_array, 's', ATSPI_DBUS_INTERFACE_SELECTION);
@@ -4533,7 +4533,7 @@ static void _bridge_object_register(Eo *bridge, Eo *obj)
{
ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
- if (!efl_isa(obj, EFL_ACCESS_OBJECT_MIXIN))
+ if (!efl_isa(obj, EFL_ACCESS_OBJECT_INTERFACE))
{
WRN("Unable to register class w/o Efl_Access_Object!");
return;
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 99229851f8..628975a2a4 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -382,6 +382,17 @@ typedef struct _Elm_Widget_Smart_Data
Evas_Object *prev, *next, *up, *down, *right, *left;
Elm_Object_Item *item_prev, *item_next, *item_up, *item_down, *item_right, *item_left;
} legacy_focus;
+
+ //TODO Efl.Access.Object - remove during refactor
+ Eina_List *relations;
+ Eina_List *attr_list;
+ const char *name;
+ const char *description;
+ const char *translation_domain;
+ Efl_Access_Role role;
+ Efl_Access_Reading_Info_Type reading_info;
+ Efl_Access_Object *access_parent;
+
Eina_Bool scroll_x_locked : 1;
Eina_Bool scroll_y_locked : 1;
@@ -570,6 +581,16 @@ struct _Elm_Widget_Item_Data
Eina_Hash *labels;
Evas_Object *track_obj;
+ //TODO Efl.Access.Object - remove during refactor
+ Eina_List *relations;
+ Eina_List *attr_list;
+ const char *name;
+ const char *description;
+ const char *translation_domain;
+ Efl_Access_Role role;
+ Efl_Access_Reading_Info_Type reading_info;
+ Efl_Access_Object *access_parent;
+
Eina_Bool disabled : 1;
Eina_Bool on_deletion : 1;
Eina_Bool on_translate : 1;
diff --git a/src/lib/elementary/elm_widget_item.eo b/src/lib/elementary/elm_widget_item.eo
index 3760ace722..b39b5d03af 100644
--- a/src/lib/elementary/elm_widget_item.eo
+++ b/src/lib/elementary/elm_widget_item.eo
@@ -550,6 +550,24 @@ class Elm.Widget.Item extends Efl.Object implements Efl.Access.Object,
Efl.Object.invalidate;
Efl.Access.Object.state_set { get; }
Efl.Access.Object.attributes { get; }
+ //TODO remove
+ Efl.Access.Object.access_parent { get; set; }
+ Efl.Access.Object.access_children { get; }
+ Efl.Access.Object.localized_role_name { get; }
+ Efl.Access.Object.index_in_parent { get; }
+ Efl.Access.Object.i18n_name { get; set; }
+ Efl.Access.Object.attribute_append;
+ Efl.Access.Object.attributes_clear;
+ Efl.Access.Object.reading_info_type { get; set; }
+ Efl.Access.Object.role { get; set; }
+ Efl.Access.Object.role_name { get; }
+ Efl.Access.Object.description { get; set; }
+ Efl.Access.Object.relations_get;
+ Efl.Access.Object.translation_domain { get; set; }
+ Efl.Access.Object.relationship_append;
+ Efl.Access.Object.relationship_remove;
+ Efl.Access.Object.relationships_clear;
+ //TODO end
Efl.Access.Component.extents { get; set; }
Efl.Access.Component.focus_grab;
Efl.Access.Component.screen_position { get; set; }