summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/elm_atspi_bridge.c21
-rw-r--r--src/lib/elm_interface_atspi_accessible.c53
-rw-r--r--src/lib/elm_interface_atspi_accessible.eo21
-rw-r--r--src/lib/elm_priv.h1
-rw-r--r--src/lib/elm_win.c31
-rw-r--r--src/lib/elm_win.eo1
6 files changed, 93 insertions, 35 deletions
diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c
index 782d1fdd2..eebb68ecc 100644
--- a/src/lib/elm_atspi_bridge.c
+++ b/src/lib/elm_atspi_bridge.c
@@ -3779,8 +3779,11 @@ _registered_listeners_get(void *data, const Eldbus_Message *msg, Eldbus_Pending
3779 } 3779 }
3780 3780
3781 if (!pd->connected) 3781 if (!pd->connected)
3782 eo_do(data, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, NULL)); 3782 {
3783 pd->connected = EINA_TRUE; 3783 pd->connected = EINA_TRUE;
3784 eo_do(data, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, NULL));
3785 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_init());
3786 }
3784} 3787}
3785 3788
3786static void 3789static void
@@ -4262,8 +4265,12 @@ _a11y_connection_shutdown(Eo *bridge)
4262 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_del(pd->event_hdlr)); 4265 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_del(pd->event_hdlr));
4263 pd->event_hdlr = NULL; 4266 pd->event_hdlr = NULL;
4264 4267
4265 eo_do(bridge, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL)); 4268 if (pd->connected)
4266 pd->connected = EINA_FALSE; 4269 {
4270 pd->connected = EINA_FALSE;
4271 eo_do(bridge, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL));
4272 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_shutdown());
4273 }
4267} 4274}
4268 4275
4269static void _disconnect_cb(void *data, Eldbus_Connection *conn EINA_UNUSED, void *event_info EINA_UNUSED) 4276static void _disconnect_cb(void *data, Eldbus_Connection *conn EINA_UNUSED, void *event_info EINA_UNUSED)
@@ -4451,12 +4458,6 @@ _elm_atspi_bridge_init(void)
4451 } 4458 }
4452} 4459}
4453 4460
4454EAPI Eo*
4455_elm_atspi_bridge_get(void)
4456{
4457 return _instance;
4458}
4459
4460void 4461void
4461_elm_atspi_bridge_shutdown(void) 4462_elm_atspi_bridge_shutdown(void)
4462{ 4463{
diff --git a/src/lib/elm_interface_atspi_accessible.c b/src/lib/elm_interface_atspi_accessible.c
index 19a020f0d..552b79172 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_Atspi_Type type: 2; 131 Elm_Atspi_Type type: 2;
132 Eina_Bool access : 1;
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;
@@ -136,6 +137,7 @@ typedef struct _Elm_Interface_Atspi_Accessible_Data Elm_Interface_Atspi_Accessib
136 137
137static Eina_List *global_callbacks; 138static Eina_List *global_callbacks;
138static Eo *root; 139static Eo *root;
140static int init_count;
139 141
140EOLIAN static int 142EOLIAN static int
141_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd EINA_UNUSED) 143_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd EINA_UNUSED)
@@ -288,7 +290,9 @@ _elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm_Interface_
288 EINA_ITERATOR_FOREACH(iter, chld) 290 EINA_ITERATOR_FOREACH(iter, chld)
289 { 291 {
290 if (eo_isa(chld, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) 292 if (eo_isa(chld, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
291 children = eina_list_append(children, chld); 293 {
294 children = eina_list_append(children, chld);
295 }
292 } 296 }
293 eina_iterator_free(iter); 297 eina_iterator_free(iter);
294 298
@@ -584,23 +588,68 @@ EOLIAN void
584_elm_interface_atspi_accessible_type_set(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd, Elm_Atspi_Type val) 588_elm_interface_atspi_accessible_type_set(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd, Elm_Atspi_Type val)
585{ 589{
586 Elm_Interface_Atspi_Accessible *parent; 590 Elm_Interface_Atspi_Accessible *parent;
591 Eina_Bool accessed;
587 if (val == pd->type) 592 if (val == pd->type)
588 return; 593 return;
589 594
590 eo_do(obj, parent = elm_interface_atspi_accessible_parent_get()); 595 eo_do(obj,
596 parent = elm_interface_atspi_accessible_parent_get(),
597 accessed = elm_interface_atspi_accessible_is_accessed());
591 598
592 switch (val) 599 switch (val)
593 { 600 {
594 case ELM_ATSPI_TYPE_DISABLED: 601 case ELM_ATSPI_TYPE_DISABLED:
595 case ELM_ATSPI_TYPE_SKIPPED: 602 case ELM_ATSPI_TYPE_SKIPPED:
603 if (accessed) eo_do(obj, elm_interface_atspi_accessible_on_access(EINA_FALSE));
596 if (parent) elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, obj); 604 if (parent) elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, obj);
597 elm_interface_atspi_accessible_removed(obj); 605 elm_interface_atspi_accessible_removed(obj);
598 break; 606 break;
599 case ELM_ATSPI_TYPE_REGULAR: 607 case ELM_ATSPI_TYPE_REGULAR:
608 if (!accessed) eo_do(obj, elm_interface_atspi_accessible_on_access(EINA_TRUE));
600 if (parent) elm_interface_atspi_accessible_children_changed_added_signal_emit(parent, obj); 609 if (parent) elm_interface_atspi_accessible_children_changed_added_signal_emit(parent, obj);
601 elm_interface_atspi_accessible_added(obj); 610 elm_interface_atspi_accessible_added(obj);
602 } 611 }
603 pd->type = val; 612 pd->type = val;
604} 613}
605 614
615EOLIAN void
616_elm_interface_atspi_accessible_on_access(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd, Eina_Bool val)
617{
618 pd->access = !!val;
619}
620
621EOLIAN Eina_Bool
622_elm_interface_atspi_accessible_is_accessed(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
623{
624 return pd->access;
625}
626
627EOLIAN int
628_elm_interface_atspi_accessible_init(Eo *obj EINA_UNUSED, void *sd EINA_UNUSED)
629{
630 Eo *r;
631 if (!init_count++)
632 {
633 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, r = elm_interface_atspi_accessible_root_get());
634 eo_do(r, elm_interface_atspi_accessible_on_access(EINA_TRUE));
635 }
636 return init_count;
637}
638
639EOLIAN void
640_elm_interface_atspi_accessible_shutdown(Eo *obj EINA_UNUSED, void *sd EINA_UNUSED)
641{
642 if (init_count > 0)
643 {
644 init_count--;
645 if (!init_count)
646 {
647 eo_do(root, elm_interface_atspi_accessible_on_access(EINA_FALSE));
648 eo_del(root);
649 root = NULL;
650 }
651 }
652}
653
654
606#include "elm_interface_atspi_accessible.eo.c" 655#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 378674ee8..feb69c412 100644
--- a/src/lib/elm_interface_atspi_accessible.eo
+++ b/src/lib/elm_interface_atspi_accessible.eo
@@ -210,6 +210,27 @@ mixin Elm_Interface_Atspi_Accessible ()
210 } 210 }
211 } 211 }
212 } 212 }
213 on_access @protected {
214 [[Function invoked when atspi accessible class gets initialized
215 or shutdowned.
216
217 Overwrite to provide custom initialization method for the object.
218
219 By default function traverses all children and invokes "on_activate"
220 method them.]]
221 params {
222 @in state: bool;[[True is atspi accessibily get intitialized, False otherwise]]
223 }
224 }
225 is_accessed @protected {
226 return: bool;
227 }
228 init @class {
229 return: int;
230 }
231 shutdown @class {
232 }
233
213 } 234 }
214 events { 235 events {
215 property,changed: const(char)*; 236 property,changed: const(char)*;
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index f8ff69351..faa1d5754 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -356,7 +356,6 @@ struct _Elm_Module
356 int references; 356 int references;
357}; 357};
358 358
359Eo *_elm_atspi_bridge_get(void);
360void _elm_atspi_bridge_init(void); 359void _elm_atspi_bridge_init(void);
361void _elm_atspi_bridge_shutdown(void); 360void _elm_atspi_bridge_shutdown(void);
362 361
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index f75ba93f2..c8c6d1195 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -3980,9 +3980,6 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3980 } 3980 }
3981 3981
3982 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3982 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3983 if (_elm_config->atspi_mode)
3984 elm_interface_atspi_window_created_signal_emit(obj);
3985
3986 evas_object_show(sd->edje); 3983 evas_object_show(sd->edje);
3987 3984
3988 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd), 3985 eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, sd),
@@ -5726,13 +5723,11 @@ elm_win_window_id_get(const Evas_Object *obj)
5726 return ret; 5723 return ret;
5727} 5724}
5728 5725
5729static Eina_Bool 5726EOLIAN static void
5730_on_atspi_bus_connected(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 5727_elm_win_elm_interface_atspi_accessible_on_access(Eo *obj, Elm_Win_Data *pd EINA_UNUSED, Eina_Bool val)
5731{ 5728{
5732 Evas_Object *win; 5729 eo_do_super(obj, ELM_WIN_CLASS, elm_interface_atspi_accessible_on_access(val));
5733 Eina_List *l; 5730 if (val)
5734
5735 EINA_LIST_FOREACH(_elm_win_list, l, win)
5736 { 5731 {
5737 /** 5732 /**
5738 * Reemit accessibility events when AT-SPI2 connection is begin 5733 * Reemit accessibility events when AT-SPI2 connection is begin
@@ -5740,35 +5735,27 @@ _on_atspi_bus_connected(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Ev
5740 * receive all org.a11y.window events and could keep track of active 5735 * receive all org.a11y.window events and could keep track of active
5741 * windows whithin system. 5736 * windows whithin system.
5742 */ 5737 */
5743 elm_interface_atspi_window_created_signal_emit(win); 5738 elm_interface_atspi_window_created_signal_emit(obj);
5744 if (elm_win_focus_get(win)) 5739 if (elm_win_focus_get(obj))
5745 { 5740 {
5746 elm_interface_atspi_window_activated_signal_emit(win); 5741 elm_interface_atspi_window_activated_signal_emit(obj);
5747 /** Reemit focused event to inform atspi clients about currently 5742 /** Reemit focused event to inform atspi clients about currently
5748 * focused object **/ 5743 * focused object **/
5749 unsigned int order = 0; 5744 unsigned int order = 0;
5750 Evas_Object *target; 5745 Evas_Object *target;
5751 eo_do(win, target = elm_obj_widget_newest_focus_order_get(&order, EINA_TRUE)); 5746 eo_do(obj, target = elm_obj_widget_newest_focus_order_get(&order, EINA_TRUE));
5752 if (target) 5747 if (target)
5753 elm_interface_atspi_accessible_state_changed_signal_emit(target, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 5748 elm_interface_atspi_accessible_state_changed_signal_emit(target, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
5754 } 5749 }
5755 else 5750 else
5756 elm_interface_atspi_window_deactivated_signal_emit(win); 5751 elm_interface_atspi_window_deactivated_signal_emit(obj);
5757 } 5752 }
5758 return EINA_TRUE;
5759} 5753}
5760 5754
5761EOLIAN static void 5755EOLIAN static void
5762_elm_win_class_constructor(Eo_Class *klass) 5756_elm_win_class_constructor(Eo_Class *klass)
5763{ 5757{
5764 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 5758 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
5765
5766 if (_elm_config->atspi_mode)
5767 {
5768 Eo *bridge = _elm_atspi_bridge_get();
5769 if (bridge)
5770 eo_do(bridge, eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _on_atspi_bus_connected, NULL));
5771 }
5772} 5759}
5773 5760
5774EOLIAN static Eo* 5761EOLIAN static Eo*
diff --git a/src/lib/elm_win.eo b/src/lib/elm_win.eo
index 97fb151e5..52bdc5e62 100644
--- a/src/lib/elm_win.eo
+++ b/src/lib/elm_win.eo
@@ -1284,6 +1284,7 @@ class Elm.Win (Elm.Widget, Elm_Interface_Atspi_Window,
1284 Elm_Interface_Atspi_Accessible.state_set.get; 1284 Elm_Interface_Atspi_Accessible.state_set.get;
1285 Elm_Interface_Atspi_Accessible.name.get; 1285 Elm_Interface_Atspi_Accessible.name.get;
1286 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 1286 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
1287 Elm_Interface_Atspi_Accessible.on_access;
1287 } 1288 }
1288 constructors { 1289 constructors {
1289 .name; 1290 .name;