summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
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
commitcf7323ef9afb58a3b3aafb7dcd8c354146d8725c (patch)
tree532d218d0f831505e5262e34f889f5ab18f666d3 /legacy/elementary/src/lib/elm_interface_atspi_accessible.c
parent8d92d3267630bddeca35962a54b11426a3b3e1bc (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
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/lib/elm_interface_atspi_accessible.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/legacy/elementary/src/lib/elm_interface_atspi_accessible.c b/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
index 2a38380c8c..357e609f32 100644
--- a/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
+++ b/legacy/elementary/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"