summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-11-26 16:53:32 +0100
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-12-01 16:06:51 +0100
commite2b1e28a12741b3be9db2aa4edae9e42877049e6 (patch)
tree6201d71f0fa313abc2475f9e59440c73c1812a6a
parent63677ba6849debc02613f205d8033d72e88cd120 (diff)
atspi: add type of accessibility object
Type API provides possibility to skip/ignore widgets in accessiblity tree. It make sense to ignore object if it do not provide any valuable contextual information for disabled users. Skipped objects are usually container objects and are ommited in parent-child relationship. @feature
-rw-r--r--src/lib/elm_atspi_app_object.c6
-rw-r--r--src/lib/elm_interface_atspi_accessible.c44
-rw-r--r--src/lib/elm_interface_atspi_accessible.eo19
-rw-r--r--src/lib/elm_widget.c41
4 files changed, 95 insertions, 15 deletions
diff --git a/src/lib/elm_atspi_app_object.c b/src/lib/elm_atspi_app_object.c
index 6e4989137..11d5bb2f5 100644
--- a/src/lib/elm_atspi_app_object.c
+++ b/src/lib/elm_atspi_app_object.c
@@ -33,7 +33,11 @@ _elm_atspi_app_object_elm_interface_atspi_accessible_children_get(Eo *obj EINA_U
33 33
34 EINA_LIST_FOREACH(_elm_win_list, l, win) 34 EINA_LIST_FOREACH(_elm_win_list, l, win)
35 { 35 {
36 if (eo_isa(win, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) 36 Elm_Atspi_Type type;
37 if (!eo_isa(win, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
38 continue;
39 eo_do(win, type = elm_interface_atspi_accessible_type_get());
40 if (type == ELM_ATSPI_TYPE_REGULAR)
37 accs = eina_list_append(accs, win); 41 accs = eina_list_append(accs, win);
38 } 42 }
39 43
diff --git a/src/lib/elm_interface_atspi_accessible.c b/src/lib/elm_interface_atspi_accessible.c
index 2a38380c8..357e609f3 100644
--- a/src/lib/elm_interface_atspi_accessible.c
+++ b/src/lib/elm_interface_atspi_accessible.c
@@ -129,6 +129,7 @@ struct _Elm_Interface_Atspi_Accessible_Data
129 const char *translation_domain; 129 const char *translation_domain;
130 Elm_Atspi_Relation_Set relations; 130 Elm_Atspi_Relation_Set relations;
131 Elm_Interface_Atspi_Accessible *parent; 131 Elm_Interface_Atspi_Accessible *parent;
132 Elm_Atspi_Type type: 2;
132}; 133};
133 134
134typedef struct _Elm_Interface_Atspi_Accessible_Data Elm_Interface_Atspi_Accessible_Data; 135typedef struct _Elm_Interface_Atspi_Accessible_Data Elm_Interface_Atspi_Accessible_Data;
@@ -168,11 +169,25 @@ _elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, Elm_Interface_Atspi
168EOLIAN static Elm_Interface_Atspi_Accessible * 169EOLIAN static Elm_Interface_Atspi_Accessible *
169_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd) 170_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
170{ 171{
171 return pd->parent; 172 Elm_Atspi_Type type;
173 Eo *parent = obj;
174
175 if (pd->parent) return pd->parent;
176
177 do {
178 eo_do(obj, parent = eo_parent_get());
179 if (eo_isa(parent, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
180 {
181 eo_do(parent, type = elm_interface_atspi_accessible_type_get());
182 if (type != ELM_ATSPI_TYPE_SKIPPED) break;
183 }
184 } while (parent);
185
186 return eo_isa(parent, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN) ? parent : NULL;
172} 187}
173 188
174EOLIAN static void 189EOLIAN static void
175_elm_interface_atspi_accessible_parent_set(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd, Elm_Interface_Atspi_Accessible *new_parent) 190_elm_interface_atspi_accessible_parent_set(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd EINA_UNUSED, Elm_Interface_Atspi_Accessible *new_parent)
176{ 191{
177 if (pd->parent != new_parent) 192 if (pd->parent != new_parent)
178 { 193 {
@@ -314,6 +329,7 @@ _elm_interface_atspi_accessible_event_emit(Eo *class EINA_UNUSED, void *pd EINA_
314{ 329{
315 Eina_List *l; 330 Eina_List *l;
316 Elm_Atspi_Event_Handler *hdl; 331 Elm_Atspi_Event_Handler *hdl;
332 Elm_Atspi_Type type;
317 333
318 if (!accessible || !event || !eo_isa(accessible, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) 334 if (!accessible || !event || !eo_isa(accessible, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
319 { 335 {
@@ -321,6 +337,18 @@ _elm_interface_atspi_accessible_event_emit(Eo *class EINA_UNUSED, void *pd EINA_
321 return; 337 return;
322 } 338 }
323 339
340 eo_do(accessible, type = elm_interface_atspi_accessible_type_get());
341 if (type != ELM_ATSPI_TYPE_REGULAR)
342 return;
343
344 if (event == ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED)
345 {
346 Elm_Atspi_Event_Children_Changed_Data *atspi_data = event_info;
347 eo_do(atspi_data->child, type = elm_interface_atspi_accessible_type_get());
348 if (type != ELM_ATSPI_TYPE_REGULAR)
349 return;
350 }
351
324 EINA_LIST_FOREACH(global_callbacks, l, hdl) 352 EINA_LIST_FOREACH(global_callbacks, l, hdl)
325 { 353 {
326 if (hdl->cb) 354 if (hdl->cb)
@@ -552,4 +580,16 @@ _elm_interface_atspi_accessible_root_get(Eo *class EINA_UNUSED, void *pd EINA_UN
552 return root; 580 return root;
553} 581}
554 582
583EOLIAN Elm_Atspi_Type
584_elm_interface_atspi_accessible_type_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
585{
586 return pd->type;
587}
588
589EOLIAN void
590_elm_interface_atspi_accessible_type_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd, Elm_Atspi_Type val)
591{
592 pd->type = val;
593}
594
555#include "elm_interface_atspi_accessible.eo.c" 595#include "elm_interface_atspi_accessible.eo.c"
diff --git a/src/lib/elm_interface_atspi_accessible.eo b/src/lib/elm_interface_atspi_accessible.eo
index f337e5663..378674ee8 100644
--- a/src/lib/elm_interface_atspi_accessible.eo
+++ b/src/lib/elm_interface_atspi_accessible.eo
@@ -1,3 +1,11 @@
1enum Elm.Atspi.Type
2{
3 [[Type of accessibility object]]
4 regular, [[default accessibile object]]
5 disabled, [[skip object and its children in accessibility hierarchy]]
6 skipped [[skip object in accessibility hierarchy]]
7}
8
1mixin Elm_Interface_Atspi_Accessible () 9mixin Elm_Interface_Atspi_Accessible ()
2{ 10{
3 legacy_prefix: null; 11 legacy_prefix: null;
@@ -147,6 +155,17 @@ mixin Elm_Interface_Atspi_Accessible ()
147 domain: const(char)*; [[ translation domain ]] 155 domain: const(char)*; [[ translation domain ]]
148 } 156 }
149 } 157 }
158 @property type {
159 get {
160 [[Get type of accessibility object]]
161 }
162 set {
163 [[Set type of accessibility object]]
164 }
165 values {
166 type: Elm.Atspi.Type;
167 }
168 }
150 relationship_append { 169 relationship_append {
151 [[Defines the relationship between two accessible objects. 170 [[Defines the relationship between two accessible objects.
152 171
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index c850e4656..9e7e086c8 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -5860,31 +5860,48 @@ _elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Wid
5860} 5860}
5861 5861
5862EOLIAN static Eina_List* 5862EOLIAN static Eina_List*
5863_elm_widget_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED) 5863_elm_widget_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
5864{ 5864{
5865 Eina_List *l, *accs = NULL; 5865 Eina_List *l, *accs = NULL;
5866 Elm_Widget_Smart_Data *wd;
5867 Evas_Object *widget; 5866 Evas_Object *widget;
5867 Elm_Atspi_Type type;
5868 5868
5869 wd = eo_data_scope_get(obj, ELM_WIDGET_CLASS); 5869 EINA_LIST_FOREACH(pd->subobjs, l, widget)
5870 if (!wd) return NULL;
5871
5872 EINA_LIST_FOREACH(wd->subobjs, l, widget)
5873 { 5870 {
5874 if (!elm_object_widget_check(widget)) continue; 5871 if (!elm_object_widget_check(widget)) continue;
5875 if (eo_isa(widget, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) 5872 if (!eo_isa(widget, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) continue;
5876 accs = eina_list_append(accs, widget); 5873 eo_do(widget, type = elm_interface_atspi_accessible_type_get());
5874 if (type == ELM_ATSPI_TYPE_DISABLED) continue;
5875 if (type == ELM_ATSPI_TYPE_SKIPPED)
5876 {
5877 Eina_List *children;
5878 eo_do(widget, children = elm_interface_atspi_accessible_children_get());
5879 accs = eina_list_merge(accs, children);
5880 continue;
5881 }
5882 accs = eina_list_append(accs, widget);
5877 } 5883 }
5878 return accs; 5884 return accs;
5879} 5885}
5880 5886
5881EOLIAN static Eo* 5887EOLIAN static Eo*
5882_elm_widget_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd) 5888_elm_widget_elm_interface_atspi_accessible_parent_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
5883{ 5889{
5884 Eo *ret; 5890 Elm_Atspi_Type type;
5885 eo_do_super(obj, ELM_WIDGET_CLASS, ret = elm_interface_atspi_accessible_parent_get()); 5891 Elm_Interface_Atspi_Accessible *parent;
5892
5893 eo_do_super(obj, ELM_WIDGET_CLASS, parent = elm_interface_atspi_accessible_parent_get());
5894 if (parent)
5895 return parent;
5896
5897 parent = obj;
5898 do {
5899 ELM_WIDGET_DATA_GET_OR_RETURN(parent, wd, NULL);
5900 parent = wd->parent_obj;
5901 eo_do(parent, type = elm_interface_atspi_accessible_type_get());
5902 } while (parent && (type == ELM_ATSPI_TYPE_SKIPPED));
5886 5903
5887 return ret ? ret : pd->parent_obj; 5904 return eo_isa(parent, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN) ? parent : NULL;
5888} 5905}
5889 5906
5890EOLIAN static Elm_Atspi_State_Set 5907EOLIAN static Elm_Atspi_State_Set