summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-09-03 14:07:23 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-10-01 16:00:28 +0200
commita109bf0a016ba5f575a1eb18eae604f2df29eff5 (patch)
tree13f01519342704144b1bb2d48be897e9c4dbf993
parent65ba84629f8b3ce4fa78aa92969476c5a08980b5 (diff)
atspi: add global event emitterdevs/stanluk/perf
Introduce global event emitter for accessibility events. With such emitter there is no need to register array of callbacks on every accessibility object.
-rw-r--r--src/lib/Makefile.am1
-rw-r--r--src/lib/elm_atspi_bridge.c249
-rw-r--r--src/lib/elm_entry.c10
-rw-r--r--src/lib/elm_genlist.c21
-rw-r--r--src/lib/elm_interface_atspi_accessible.c55
-rw-r--r--src/lib/elm_interface_atspi_accessible.eo23
-rw-r--r--src/lib/elm_interface_atspi_accessible.h46
-rw-r--r--src/lib/elm_interface_atspi_window.h56
-rw-r--r--src/lib/elm_interfaces.h3
-rw-r--r--src/lib/elm_widget.c38
-rw-r--r--src/lib/elm_win.c36
-rw-r--r--src/tests/elm_test_genlist.c11
12 files changed, 364 insertions, 185 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 09225879d..3b6153272 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -39,6 +39,7 @@ elm_atspi_bridge.h \
39elm_interface_atspi_accessible.h \ 39elm_interface_atspi_accessible.h \
40elm_interface_atspi_text.h \ 40elm_interface_atspi_text.h \
41elm_interface_atspi_widget_action.h \ 41elm_interface_atspi_widget_action.h \
42elm_interface_atspi_window.h \
42elm_interface_fileselector.h \ 43elm_interface_fileselector.h \
43elm_interface_scrollable.h \ 44elm_interface_scrollable.h \
44elm_interfaces.h \ 45elm_interfaces.h \
diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c
index 5df00851a..345ab6b9a 100644
--- a/src/lib/elm_atspi_bridge.c
+++ b/src/lib/elm_atspi_bridge.c
@@ -93,14 +93,11 @@ typedef struct _Elm_Atspi_Bridge_Data
93 Eldbus_Service_Interface *text; 93 Eldbus_Service_Interface *text;
94 Eldbus_Service_Interface *value; 94 Eldbus_Service_Interface *value;
95 } interfaces; 95 } interfaces;
96 Elm_Atspi_Event_Handler *event_hdlr;
97 Eina_Hash *event_hash;
96 Eina_Bool connected : 1; 98 Eina_Bool connected : 1;
97} Elm_Atspi_Bridge_Data; 99} Elm_Atspi_Bridge_Data;
98 100
99struct cache_closure {
100 Eo *bridge;
101 Eldbus_Message_Iter *iter;
102};
103
104static Eo *_instance; 101static Eo *_instance;
105static int _init_count = 0; 102static int _init_count = 0;
106 103
@@ -109,6 +106,8 @@ static Eina_Bool _state_changed_signal_send(void *data, Eo *obj, const Eo_Event_
109static Eina_Bool _property_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info); 106static Eina_Bool _property_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info);
110static Eina_Bool _children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info); 107static Eina_Bool _children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info);
111static Eina_Bool _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); 108static Eina_Bool _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
109static Eina_Bool _visible_data_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
110static Eina_Bool _active_descendant_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
112static Eina_Bool _selection_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); 111static Eina_Bool _selection_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
113static Eina_Bool _text_text_inserted_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); 112static Eina_Bool _text_text_inserted_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
114static Eina_Bool _text_text_removed_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); 113static Eina_Bool _text_text_removed_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
@@ -116,7 +115,6 @@ static Eina_Bool _text_caret_moved_send(void *data, Eo *obj, const Eo_Event_Desc
116static Eina_Bool _text_selection_changed_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED); 115static Eina_Bool _text_selection_changed_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED);
117 116
118// bridge private methods 117// bridge private methods
119static void _bridge_cache_build(Eo *bridge, void *obj);
120static void _bridge_object_register(Eo *bridge, Eo *obj); 118static void _bridge_object_register(Eo *bridge, Eo *obj);
121static void _bridge_object_unregister(Eo *bridge, Eo *obj); 119static void _bridge_object_unregister(Eo *bridge, Eo *obj);
122static const char * _bridge_path_from_object(Eo *bridge, const Eo *eo); 120static const char * _bridge_path_from_object(Eo *bridge, const Eo *eo);
@@ -127,37 +125,36 @@ static void _bridge_iter_object_reference_append(Eo *bridge, Eldbus_Message_Iter
127// utility functions 125// utility functions
128static void _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj); 126static void _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj);
129static Eina_Bool _elm_atspi_bridge_key_filter(void *data, void *loop, int type, void *event); 127static Eina_Bool _elm_atspi_bridge_key_filter(void *data, void *loop, int type, void *event);
130static void _object_unregister(Eo *obj, void *data);
131static void _object_desktop_reference_append(Eldbus_Message_Iter *iter); 128static void _object_desktop_reference_append(Eldbus_Message_Iter *iter);
129static Eina_Bool _on_object_add(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED);
132static Eina_Bool _on_object_del(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED); 130static Eina_Bool _on_object_del(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED);
133 131
134EO_CALLBACKS_ARRAY_DEFINE(_events_cb, 132typedef struct {
135 { EO_EV_DEL, _on_object_del}, 133 const Eo_Event_Description *desc;
136 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, _property_changed_signal_send}, 134 const Eo_Event_Cb callback;
137 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_signal_send}, 135} Elm_Atspi_Bridge_Event_Handler;
138 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, _state_changed_signal_send}
139);
140 136
141EO_CALLBACKS_ARRAY_DEFINE(_window_cb, 137static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = {
138 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_signal_send},
139 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, _property_changed_signal_send},
140 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, _state_changed_signal_send},
141 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_VISIBLE_DATA_CHANGED, _visible_data_changed_signal_send},
142 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ACTIVE_DESCENDANTS_CHANGED, _active_descendant_changed_signal_send},
143 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ADDED, _on_object_add},
144 { ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_REMOVED, _on_object_del},
142 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send}, 145 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, _window_signal_send},
143 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, _window_signal_send}, 146 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, _window_signal_send},
144 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send}, 147 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, _window_signal_send},
145 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, _window_signal_send}, 148 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, _window_signal_send},
146 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, _window_signal_send}, 149 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, _window_signal_send},
147 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, _window_signal_send}, 150 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, _window_signal_send},
148 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, _window_signal_send} 151 { ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, _window_signal_send},
149); 152 { ELM_INTERFACE_ATSPI_SELECTION_EVENT_SELECTION_CHANGED, _selection_signal_send},
150
151EO_CALLBACKS_ARRAY_DEFINE(_selection_cb,
152 { ELM_INTERFACE_ATSPI_SELECTION_EVENT_SELECTION_CHANGED, _selection_signal_send}
153);
154
155EO_CALLBACKS_ARRAY_DEFINE(_text_cb,
156 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, _text_caret_moved_send }, 153 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, _text_caret_moved_send },
157 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_INSERTED, _text_text_inserted_send }, 154 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_INSERTED, _text_text_inserted_send },
158 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_REMOVED, _text_text_removed_send }, 155 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_REMOVED, _text_text_removed_send },
159 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, _text_selection_changed_send } 156 { ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, _text_selection_changed_send }
160); 157};
161 158
162enum _Atspi_Object_Child_Event_Type 159enum _Atspi_Object_Child_Event_Type
163{ 160{
@@ -659,6 +656,18 @@ _elm_atspi_state_hash_build(void)
659 return ret; 656 return ret;
660} 657}
661 658
659static Eina_Hash*
660_elm_atspi_event_hash_build(void)
661{
662 Eina_Hash *ret = eina_hash_pointer_new(NULL);
663 unsigned int i = 0;
664
665 for (i = 0; i < SIZE(event_handlers); i++)
666 eina_hash_add(ret, &(event_handlers[i].desc), event_handlers[i].callback);
667
668 return ret;
669}
670
662static Eldbus_Message * 671static Eldbus_Message *
663_accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg) 672_accessible_get_state(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
664{ 673{
@@ -2407,17 +2416,15 @@ _iter_interfaces_append(Eldbus_Message_Iter *iter, const Eo *obj)
2407} 2416}
2408 2417
2409static Eina_Bool 2418static Eina_Bool
2410_cache_item_reference_append_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata) 2419_cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_array)
2411{ 2420{
2412 if (!eo_ref_get(data) || eo_destructed_is(data)) 2421 if (!eo_ref_get(data) || eo_destructed_is(data))
2413 return EINA_TRUE; 2422 return EINA_TRUE;
2414 2423
2415 struct cache_closure *cl = fdata;
2416 Eldbus_Message_Iter *iter_struct, *iter_sub_array; 2424 Eldbus_Message_Iter *iter_struct, *iter_sub_array;
2417 Eldbus_Message_Iter *iter_array = cl->iter;
2418 Elm_Atspi_State_Set states; 2425 Elm_Atspi_State_Set states;
2419 Elm_Atspi_Role role; 2426 Elm_Atspi_Role role;
2420 Eo *root = elm_atspi_bridge_root_get(cl->bridge); 2427 Eo *root = elm_atspi_bridge_root_get(bridge);
2421 2428
2422 eo_do(data, role = elm_interface_atspi_accessible_role_get()); 2429 eo_do(data, role = elm_interface_atspi_accessible_role_get());
2423 2430
@@ -2425,10 +2432,10 @@ _cache_item_reference_append_cb(const Eina_Hash *hash EINA_UNUSED, const void *k
2425 EINA_SAFETY_ON_NULL_RETURN_VAL(iter_struct, EINA_TRUE); 2432 EINA_SAFETY_ON_NULL_RETURN_VAL(iter_struct, EINA_TRUE);
2426 2433
2427 /* Marshall object path */ 2434 /* Marshall object path */
2428 _bridge_iter_object_reference_append(cl->bridge, iter_struct, data); 2435 _bridge_iter_object_reference_append(bridge, iter_struct, data);
2429 2436
2430 /* Marshall application */ 2437 /* Marshall application */
2431 _bridge_iter_object_reference_append(cl->bridge, iter_struct, root); 2438 _bridge_iter_object_reference_append(bridge, iter_struct, root);
2432 2439
2433 Eo *parent = NULL; 2440 Eo *parent = NULL;
2434 eo_do(data, parent = elm_interface_atspi_accessible_parent_get()); 2441 eo_do(data, parent = elm_interface_atspi_accessible_parent_get());
@@ -2436,7 +2443,7 @@ _cache_item_reference_append_cb(const Eina_Hash *hash EINA_UNUSED, const void *k
2436 if ((!parent) && (ELM_ATSPI_ROLE_APPLICATION == role)) 2443 if ((!parent) && (ELM_ATSPI_ROLE_APPLICATION == role))
2437 _object_desktop_reference_append(iter_struct); 2444 _object_desktop_reference_append(iter_struct);
2438 else 2445 else
2439 _bridge_iter_object_reference_append(cl->bridge, iter_struct, parent); 2446 _bridge_iter_object_reference_append(bridge, iter_struct, parent);
2440 2447
2441 /* Marshall children */ 2448 /* Marshall children */
2442 Eina_List *children_list = NULL, *l; 2449 Eina_List *children_list = NULL, *l;
@@ -2447,7 +2454,7 @@ _cache_item_reference_append_cb(const Eina_Hash *hash EINA_UNUSED, const void *k
2447 EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail); 2454 EINA_SAFETY_ON_NULL_GOTO(iter_sub_array, fail);
2448 2455
2449 EINA_LIST_FOREACH(children_list, l, child) 2456 EINA_LIST_FOREACH(children_list, l, child)
2450 _bridge_iter_object_reference_append(cl->bridge, iter_sub_array, child); 2457 _bridge_iter_object_reference_append(bridge, iter_sub_array, child);
2451 2458
2452 eldbus_message_iter_container_close(iter_struct, iter_sub_array); 2459 eldbus_message_iter_container_close(iter_struct, iter_sub_array);
2453 eina_list_free(children_list); 2460 eina_list_free(children_list);
@@ -2498,9 +2505,10 @@ fail:
2498static Eldbus_Message * 2505static Eldbus_Message *
2499_cache_get_items(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg) 2506_cache_get_items(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
2500{ 2507{
2501 Eldbus_Message_Iter *iter; 2508 Eldbus_Message_Iter *iter, *iter_array;
2502 Eldbus_Message *ret; 2509 Eldbus_Message *ret;
2503 struct cache_closure cl; 2510 Eina_List *to_process;
2511 Eo *root;
2504 2512
2505 Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME); 2513 Eo *bridge = eldbus_service_object_data_get(iface, ELM_ATSPI_BRIDGE_CLASS_NAME);
2506 if (!bridge) return NULL; 2514 if (!bridge) return NULL;
@@ -2511,13 +2519,25 @@ _cache_get_items(const Eldbus_Service_Interface *iface, const Eldbus_Message *ms
2511 EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL); 2519 EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
2512 2520
2513 iter = eldbus_message_iter_get(ret); 2521 iter = eldbus_message_iter_get(ret);
2514 cl.iter = eldbus_message_iter_container_new(iter, 'a', CACHE_ITEM_SIGNATURE); 2522 iter_array = eldbus_message_iter_container_new(iter, 'a', CACHE_ITEM_SIGNATURE);
2515 EINA_SAFETY_ON_NULL_GOTO(cl.iter, fail); 2523 EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
2524
2525 eo_do(bridge, root = elm_obj_atspi_bridge_root_get());
2526 to_process = eina_list_append(NULL, root);
2527
2528 while (to_process)
2529 {
2530 Eo *obj = eina_list_data_get(to_process);
2531 to_process = eina_list_remove_list(to_process, to_process);
2532 _cache_item_reference_append_cb(bridge, obj, iter_array);
2533 _bridge_object_register(bridge, obj);
2516 2534
2517 cl.bridge = bridge; 2535 Eina_List *children;
2536 eo_do(obj, children = elm_interface_atspi_accessible_children_get());
2537 to_process = eina_list_merge(to_process, children);
2538 }
2518 2539
2519 eina_hash_foreach(pd->cache, _cache_item_reference_append_cb, &cl); 2540 eldbus_message_iter_container_close(iter, iter_array);
2520 eldbus_message_iter_container_close(iter, cl.iter);
2521 2541
2522 return ret; 2542 return ret;
2523fail: 2543fail:
@@ -2913,7 +2933,7 @@ _elm_atspi_bridge_app_unregister(Eo *bridge)
2913static void 2933static void
2914_cache_register(Eo *obj) 2934_cache_register(Eo *obj)
2915{ 2935{
2916 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(obj, ELM_ATSPI_BRIDGE_CLASS); 2936 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(obj, pd);
2917 pd->cache_interface = eldbus_service_interface_register(pd->a11y_bus, CACHE_INTERFACE_PATH, &cache_iface_desc); 2937 pd->cache_interface = eldbus_service_interface_register(pd->a11y_bus, CACHE_INTERFACE_PATH, &cache_iface_desc);
2918 eldbus_service_object_data_set(pd->cache_interface, ELM_ATSPI_BRIDGE_CLASS_NAME, obj); 2938 eldbus_service_object_data_set(pd->cache_interface, ELM_ATSPI_BRIDGE_CLASS_NAME, obj);
2919} 2939}
@@ -2922,7 +2942,7 @@ static void
2922_set_broadcast_flag(const char *event, Eo *bridge) 2942_set_broadcast_flag(const char *event, Eo *bridge)
2923{ 2943{
2924 char **tokens; 2944 char **tokens;
2925 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(bridge, ELM_ATSPI_BRIDGE_CLASS); 2945 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
2926 2946
2927 tokens = eina_str_split(event, ":", 3); 2947 tokens = eina_str_split(event, ":", 3);
2928 2948
@@ -2974,6 +2994,10 @@ _set_broadcast_flag(const char *event, Eo *bridge)
2974 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_SELECTION_CHANGED); 2994 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_SELECTION_CHANGED);
2975 else if (!strcmp(tokens[1], "TextAttributesChanged")) 2995 else if (!strcmp(tokens[1], "TextAttributesChanged"))
2976 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_ATTRIBUTES_CHANGED); 2996 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_ATTRIBUTES_CHANGED);
2997 else if (!strcmp(tokens[1], "VisibleDataChanged"))
2998 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_VISIBLE_DATA_CHANGED);
2999 else if (!strcmp(tokens[1], "ActiveDescendantsChanged"))
3000 STATE_TYPE_SET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED);
2977 } 3001 }
2978 else if (!strcmp(tokens[0], "Window")) 3002 else if (!strcmp(tokens[0], "Window"))
2979 { 3003 {
@@ -3005,7 +3029,7 @@ static void
3005_registered_listeners_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) 3029_registered_listeners_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
3006{ 3030{
3007 const char *event, *bus; 3031 const char *event, *bus;
3008 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(data, ELM_ATSPI_BRIDGE_CLASS); 3032 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd);
3009 pd->pending_requests = eina_list_remove(pd->pending_requests, pending); 3033 pd->pending_requests = eina_list_remove(pd->pending_requests, pending);
3010 3034
3011 DBG("Updating registered ATSPI signals list."); 3035 DBG("Updating registered ATSPI signals list.");
@@ -3041,7 +3065,7 @@ static void
3041_registered_events_list_update(Eo *bridge) 3065_registered_events_list_update(Eo *bridge)
3042{ 3066{
3043 Eldbus_Message *msg; 3067 Eldbus_Message *msg;
3044 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(bridge, ELM_ATSPI_BRIDGE_CLASS); 3068 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3045 Eldbus_Pending *p; 3069 Eldbus_Pending *p;
3046 3070
3047 msg = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_REGISTRY, ATSPI_DBUS_INTERFACE_REGISTRY, "GetRegisteredEvents"); 3071 msg = eldbus_message_method_call_new(ATSPI_DBUS_NAME_REGISTRY, ATSPI_DBUS_PATH_REGISTRY, ATSPI_DBUS_INTERFACE_REGISTRY, "GetRegisteredEvents");
@@ -3127,6 +3151,40 @@ _property_changed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_De
3127} 3151}
3128 3152
3129static Eina_Bool 3153static Eina_Bool
3154_visible_data_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
3155{
3156 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(data, pd, EINA_FALSE);
3157
3158 if (!STATE_TYPE_GET(pd->object_children_broadcast_mask, ATSPI_OBJECT_EVENT_VISIBLE_DATA_CHANGED))
3159 return EINA_FALSE;
3160
3161 _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
3162 &_event_obj_signals[ATSPI_OBJECT_EVENT_VISIBLE_DATA_CHANGED], "",
3163 0, 0, NULL, NULL);
3164
3165 return EINA_TRUE;
3166}
3167
3168static Eina_Bool
3169_active_descendant_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
3170{
3171 Eo *child = event_info;
3172 int idx;
3173
3174 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(data, pd, EINA_FALSE);
3175
3176 if (!STATE_TYPE_GET(pd->object_children_broadcast_mask, ATSPI_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED))
3177 return EINA_FALSE;
3178
3179 eo_do(child, idx = elm_interface_atspi_accessible_index_in_parent_get());
3180
3181 _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
3182 &_event_obj_signals[ATSPI_OBJECT_EVENT_ACTIVE_DESCENDANT_CHANGED], "",
3183 idx, 0, "(so)", eldbus_connection_unique_name_get(pd->a11y_bus), child);
3184 return EINA_TRUE;
3185}
3186
3187static Eina_Bool
3130_children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 3188_children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
3131{ 3189{
3132 const char *atspi_desc = NULL; 3190 const char *atspi_desc = NULL;
@@ -3138,10 +3196,6 @@ _children_changed_signal_send(void *data, Eo *obj, const Eo_Event_Description *d
3138 3196
3139 type = ev_data->is_added ? ATSPI_OBJECT_CHILD_ADDED : ATSPI_OBJECT_CHILD_REMOVED; 3197 type = ev_data->is_added ? ATSPI_OBJECT_CHILD_ADDED : ATSPI_OBJECT_CHILD_REMOVED;
3140 3198
3141 // update cached objects
3142 if (ev_data->is_added)
3143 _bridge_cache_build(data, ev_data->child);
3144
3145 if (!STATE_TYPE_GET(pd->object_children_broadcast_mask, type)) 3199 if (!STATE_TYPE_GET(pd->object_children_broadcast_mask, type))
3146 return EINA_FALSE; 3200 return EINA_FALSE;
3147 3201
@@ -3366,7 +3420,7 @@ _text_selection_changed_send(void *data, Eo *obj, const Eo_Event_Description *de
3366static void 3420static void
3367_event_handlers_register(Eo *bridge) 3421_event_handlers_register(Eo *bridge)
3368{ 3422{
3369 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(bridge, ELM_ATSPI_BRIDGE_CLASS); 3423 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3370 3424
3371 _registered_events_list_update(bridge); 3425 _registered_events_list_update(bridge);
3372 3426
@@ -3384,8 +3438,6 @@ _bridge_object_unregister(Eo *bridge, Eo *obj)
3384 3438
3385 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd); 3439 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3386 3440
3387 _object_unregister(obj, bridge);
3388
3389 sig = eldbus_service_signal_new(pd->cache_interface, ATSPI_OBJECT_CHILD_REMOVED); 3441 sig = eldbus_service_signal_new(pd->cache_interface, ATSPI_OBJECT_CHILD_REMOVED);
3390 Eldbus_Message_Iter *iter = eldbus_message_iter_get(sig); 3442 Eldbus_Message_Iter *iter = eldbus_message_iter_get(sig);
3391 _bridge_iter_object_reference_append(bridge, iter, obj); 3443 _bridge_iter_object_reference_append(bridge, iter, obj);
@@ -3395,36 +3447,20 @@ _bridge_object_unregister(Eo *bridge, Eo *obj)
3395} 3447}
3396 3448
3397static Eina_Bool 3449static Eina_Bool
3398_on_object_del(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED) 3450_on_object_add(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED)
3399{ 3451{
3400 Eo *bridge = data; 3452 Eo *bridge = data;
3401 3453 _bridge_object_register(bridge, obj);
3402 _bridge_object_unregister(bridge, obj);
3403 3454
3404 return EINA_TRUE; 3455 return EINA_TRUE;
3405} 3456}
3406 3457
3407static void 3458static Eina_Bool
3408_bridge_cache_build(Eo *bridge, void *obj) 3459_on_object_del(void *data, Eo *obj, const Eo_Event_Description *event EINA_UNUSED, void *event_info EINA_UNUSED)
3409{ 3460{
3410 Eina_List *children; 3461 Eo *bridge = data;
3411 Eo *child; 3462 _bridge_object_unregister(bridge, obj);
3412
3413 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3414
3415 if (!eo_isa(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
3416 return;
3417
3418 _bridge_object_register(bridge, obj);
3419
3420 eo_do(obj, children = elm_interface_atspi_accessible_children_get());
3421 EINA_LIST_FREE(children, child)
3422 _bridge_cache_build(bridge, child);
3423}
3424 3463
3425static Eina_Bool _unregister_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata)
3426{
3427 _object_unregister(data, fdata);
3428 return EINA_TRUE; 3464 return EINA_TRUE;
3429} 3465}
3430 3466
@@ -3452,17 +3488,14 @@ _interfaces_unregister(Eo *bridge)
3452static void 3488static void
3453_a11y_connection_shutdown(Eo *bridge) 3489_a11y_connection_shutdown(Eo *bridge)
3454{ 3490{
3455 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(bridge, ELM_ATSPI_BRIDGE_CLASS); 3491 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3456 Eldbus_Pending *pending; 3492 Eldbus_Pending *pending;
3457 3493
3458 if (pd->connected) 3494 if (pd->connected)
3459 _elm_atspi_bridge_app_unregister(bridge); 3495 _elm_atspi_bridge_app_unregister(bridge);
3460 3496
3461 if (pd->cache) 3497 if (pd->cache)
3462 { 3498 eina_hash_free(pd->cache);
3463 eina_hash_foreach(pd->cache, _unregister_cb, bridge);
3464 eina_hash_free(pd->cache);
3465 }
3466 pd->cache = NULL; 3499 pd->cache = NULL;
3467 3500
3468 if (pd->cache_interface) 3501 if (pd->cache_interface)
@@ -3490,6 +3523,12 @@ _a11y_connection_shutdown(Eo *bridge)
3490 if (pd->state_hash) eina_hash_free(pd->state_hash); 3523 if (pd->state_hash) eina_hash_free(pd->state_hash);
3491 pd->state_hash = NULL; 3524 pd->state_hash = NULL;
3492 3525
3526 if (pd->event_hash) eina_hash_free(pd->event_hash);
3527 pd->event_hash = NULL;
3528
3529 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_del(pd->event_hdlr));
3530 pd->event_hdlr = NULL;
3531
3493 eo_do(bridge, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL)); 3532 eo_do(bridge, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, NULL));
3494 pd->connected = EINA_FALSE; 3533 pd->connected = EINA_FALSE;
3495} 3534}
@@ -3541,11 +3580,19 @@ _interfaces_register(Eo *bridge)
3541 eldbus_service_object_data_set(pd->interfaces.value, ELM_ATSPI_BRIDGE_CLASS_NAME, bridge); 3580 eldbus_service_object_data_set(pd->interfaces.value, ELM_ATSPI_BRIDGE_CLASS_NAME, bridge);
3542} 3581}
3543 3582
3583static Eina_Bool
3584_bridge_accessible_event_dispatch(void *data, Eo *accessible, const Eo_Event_Description *desc, void *event_info)
3585{
3586 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN_VAL(data, pd, EINA_TRUE);
3587
3588 Eo_Event_Cb cb = eina_hash_find(pd->event_hash, &desc);
3589 return cb ? cb(data, accessible, desc, event_info) : EINA_TRUE;
3590}
3591
3544static void 3592static void
3545_a11y_bus_initialize(Eo *obj, const char *socket_addr) 3593_a11y_bus_initialize(Eo *obj, const char *socket_addr)
3546{ 3594{
3547 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(obj, ELM_ATSPI_BRIDGE_CLASS); 3595 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(obj, pd);
3548 Eo *root;
3549 3596
3550 pd->a11y_bus = eldbus_private_address_connection_get(socket_addr); 3597 pd->a11y_bus = eldbus_private_address_connection_get(socket_addr);
3551 if (!pd->a11y_bus) 3598 if (!pd->a11y_bus)
@@ -3556,6 +3603,7 @@ _a11y_bus_initialize(Eo *obj, const char *socket_addr)
3556 // init data structures 3603 // init data structures
3557 pd->cache = eina_hash_pointer_new(NULL); 3604 pd->cache = eina_hash_pointer_new(NULL);
3558 pd->state_hash = _elm_atspi_state_hash_build(); 3605 pd->state_hash = _elm_atspi_state_hash_build();
3606 pd->event_hash = _elm_atspi_event_hash_build();
3559 3607
3560 // dbus init 3608 // dbus init
3561 _cache_register(obj); 3609 _cache_register(obj);
@@ -3563,16 +3611,15 @@ _a11y_bus_initialize(Eo *obj, const char *socket_addr)
3563 _event_handlers_register(obj); 3611 _event_handlers_register(obj);
3564 _elm_atspi_bridge_app_register(obj); 3612 _elm_atspi_bridge_app_register(obj);
3565 3613
3566 // buid cache 3614 // register accesible object event listener
3567 eo_do(obj, root = elm_obj_atspi_bridge_root_get()); 3615 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, pd->event_hdlr = elm_interface_atspi_accessible_event_handler_add(_bridge_accessible_event_dispatch, obj));
3568 _bridge_cache_build(obj, root);
3569} 3616}
3570 3617
3571static void 3618static void
3572_a11y_bus_address_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) 3619_a11y_bus_address_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
3573{ 3620{
3574 const char *errname, *errmsg, *sock_addr = NULL; 3621 const char *errname, *errmsg, *sock_addr = NULL;
3575 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(data, ELM_ATSPI_BRIDGE_CLASS); 3622 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd);
3576 3623
3577 pd->pending_requests = eina_list_remove(pd->pending_requests, pending); 3624 pd->pending_requests = eina_list_remove(pd->pending_requests, pending);
3578 3625
@@ -3593,7 +3640,7 @@ _a11y_bus_address_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pen
3593 3640
3594static void _a11y_connection_init(Eo *bridge) 3641static void _a11y_connection_init(Eo *bridge)
3595{ 3642{
3596 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(bridge, ELM_ATSPI_BRIDGE_CLASS); 3643 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3597 Eina_Bool is_connected; 3644 Eina_Bool is_connected;
3598 3645
3599 eo_do(bridge, is_connected = elm_obj_atspi_bridge_connected_get()); 3646 eo_do(bridge, is_connected = elm_obj_atspi_bridge_connected_get());
@@ -3610,7 +3657,7 @@ static void _a11y_connection_init(Eo *bridge)
3610static void 3657static void
3611_screen_reader_enabled_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) 3658_screen_reader_enabled_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
3612{ 3659{
3613 Elm_Atspi_Bridge_Data *pd = eo_data_scope_get(data, ELM_ATSPI_BRIDGE_CLASS); 3660 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd);
3614 const char *errname, *errmsg; 3661 const char *errname, *errmsg;
3615 Eina_Bool is_enabled; 3662 Eina_Bool is_enabled;
3616 Eldbus_Message_Iter *variant; 3663 Eldbus_Message_Iter *variant;
@@ -3641,8 +3688,8 @@ _screen_reader_enabled_get(void *data, const Eldbus_Message *msg, Eldbus_Pending
3641 3688
3642static void _bridge_object_register(Eo *bridge, Eo *obj) 3689static void _bridge_object_register(Eo *bridge, Eo *obj)
3643{ 3690{
3644 struct cache_closure cc;
3645 Eldbus_Message *sig; 3691 Eldbus_Message *sig;
3692 Eldbus_Message_Iter *iter;
3646 3693
3647 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd); 3694 ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(bridge, pd);
3648 3695
@@ -3660,36 +3707,13 @@ static void _bridge_object_register(Eo *bridge, Eo *obj)
3660 3707
3661 eina_hash_add(pd->cache, &obj, obj); 3708 eina_hash_add(pd->cache, &obj, obj);
3662 3709
3663 eo_do(obj, eo_event_callback_array_add(_events_cb(), bridge));
3664
3665 if (eo_isa(obj, ELM_INTERFACE_ATSPI_SELECTION_INTERFACE))
3666 eo_do(obj, eo_event_callback_array_add(_selection_cb(), bridge));
3667
3668 if (eo_isa(obj, ELM_INTERFACE_ATSPI_TEXT_INTERFACE))
3669 eo_do(obj, eo_event_callback_array_add(_text_cb(), bridge));
3670
3671 if (eo_isa(obj, ELM_INTERFACE_ATSPI_WINDOW_INTERFACE))
3672 eo_do(obj, eo_event_callback_array_add(_window_cb(), bridge));
3673
3674 sig = eldbus_service_signal_new(pd->cache_interface, ATSPI_OBJECT_CHILD_ADDED); 3710 sig = eldbus_service_signal_new(pd->cache_interface, ATSPI_OBJECT_CHILD_ADDED);
3675 cc.iter = eldbus_message_iter_get(sig); 3711 iter = eldbus_message_iter_get(sig);
3676 cc.bridge = bridge; 3712 _cache_item_reference_append_cb(bridge, obj, iter);
3677 _cache_item_reference_append_cb(NULL, NULL, obj, &cc);
3678 3713
3679 eldbus_service_signal_send(pd->cache_interface, sig); 3714 eldbus_service_signal_send(pd->cache_interface, sig);
3680} 3715}
3681 3716
3682static void _object_unregister(Eo *obj, void *data)
3683{
3684 eo_do(obj, eo_event_callback_array_del(_events_cb(), data));
3685 if (eo_isa(obj, ELM_INTERFACE_ATSPI_WINDOW_INTERFACE))
3686 eo_do(obj, eo_event_callback_array_del(_window_cb(), data));
3687 if (eo_isa(obj, ELM_INTERFACE_ATSPI_SELECTION_INTERFACE))
3688 eo_do(obj, eo_event_callback_array_del(_selection_cb(), data));
3689 if (eo_isa(obj, ELM_INTERFACE_ATSPI_TEXT_INTERFACE))
3690 eo_do(obj, eo_event_callback_array_del(_text_cb(), data));
3691}
3692
3693void 3717void
3694_elm_atspi_bridge_init(void) 3718_elm_atspi_bridge_init(void)
3695{ 3719{
@@ -3853,7 +3877,10 @@ EOLIAN Eo*
3853_elm_atspi_bridge_root_get(Eo *obj EINA_UNUSED, Elm_Atspi_Bridge_Data *pd) 3877_elm_atspi_bridge_root_get(Eo *obj EINA_UNUSED, Elm_Atspi_Bridge_Data *pd)
3854{ 3878{
3855 if (!pd->root) 3879 if (!pd->root)
3856 pd->root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); 3880 {
3881 pd->root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);
3882 elm_interface_atspi_accessible_added(pd->root);
3883 }
3857 3884
3858 return pd->root; 3885 return pd->root;
3859} 3886}
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 6243501eb..3f0ab0f99 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -2019,14 +2019,14 @@ _entry_changed_user_signal_cb(void *data,
2019 atspi_info.content = edje_info->change.insert.content; 2019 atspi_info.content = edje_info->change.insert.content;
2020 atspi_info.pos = edje_info->change.insert.pos; 2020 atspi_info.pos = edje_info->change.insert.pos;
2021 atspi_info.len = edje_info->change.insert.plain_length; 2021 atspi_info.len = edje_info->change.insert.plain_length;
2022 eo_do(data, eo_event_callback_call(ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info)); 2022 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_INSERTED, &atspi_info));
2023 } 2023 }
2024 else if (edje_info && !edje_info->insert) 2024 else if (edje_info && !edje_info->insert)
2025 { 2025 {
2026 atspi_info.content = edje_info->change.del.content; 2026 atspi_info.content = edje_info->change.del.content;
2027 atspi_info.pos = MIN(edje_info->change.del.start, edje_info->change.del.end); 2027 atspi_info.pos = MIN(edje_info->change.del.start, edje_info->change.del.end);
2028 atspi_info.len = MAX(edje_info->change.del.start, edje_info->change.del.end) - atspi_info.pos; 2028 atspi_info.len = MAX(edje_info->change.del.start, edje_info->change.del.end) - atspi_info.pos;
2029 eo_do(data, eo_event_callback_call(ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info)); 2029 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_REMOVED, &atspi_info));
2030 } 2030 }
2031 } 2031 }
2032} 2032}
@@ -2118,7 +2118,7 @@ _entry_selection_changed_signal_cb(void *data,
2118 _selection_store(ELM_SEL_TYPE_PRIMARY, data); 2118 _selection_store(ELM_SEL_TYPE_PRIMARY, data);
2119 _update_selection_handler(data); 2119 _update_selection_handler(data);
2120 if (_elm_config->atspi_mode) 2120 if (_elm_config->atspi_mode)
2121 eo_do(data, eo_event_callback_call(ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL)); 2121 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL));
2122} 2122}
2123 2123
2124static void 2124static void
@@ -2215,7 +2215,7 @@ _entry_cursor_changed_signal_cb(void *data,
2215 edje_object_signal_emit(sd->entry_edje, "elm,action,show,cursor", "elm"); 2215 edje_object_signal_emit(sd->entry_edje, "elm,action,show,cursor", "elm");
2216 _cursor_geometry_recalc(data); 2216 _cursor_geometry_recalc(data);
2217 if (_elm_config->atspi_mode) 2217 if (_elm_config->atspi_mode)
2218 eo_do(data, eo_event_callback_call(ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL)); 2218 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL));
2219} 2219}
2220 2220
2221static void 2221static void
@@ -2227,7 +2227,7 @@ _entry_cursor_changed_manual_signal_cb(void *data,
2227 eo_do(data, eo_event_callback_call 2227 eo_do(data, eo_event_callback_call
2228 (ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL, NULL)); 2228 (ELM_ENTRY_EVENT_CURSOR_CHANGED_MANUAL, NULL));
2229 if (_elm_config->atspi_mode) 2229 if (_elm_config->atspi_mode)
2230 eo_do(data, eo_event_callback_call(ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL)); 2230 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL));
2231} 2231}
2232 2232
2233static void 2233static void
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index a0d5cd7b2..d76352f66 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -4633,6 +4633,12 @@ _item_queue(Elm_Genlist_Data *sd,
4633// evas_event_thaw_eval(evas_object_evas_get(sd->obj)); 4633// evas_event_thaw_eval(evas_object_evas_get(sd->obj));
4634 evas_object_geometry_get(sd->obj, NULL, NULL, &w, NULL); 4634 evas_object_geometry_get(sd->obj, NULL, NULL, &w, NULL);
4635 if (w > 0) _requeue_idle_enterer(sd); 4635 if (w > 0) _requeue_idle_enterer(sd);
4636
4637 if (_elm_config->atspi_mode)
4638 {
4639 elm_interface_atspi_accessible_added(EO_OBJ(it));
4640 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
4641 }
4636} 4642}
4637 4643
4638/* If the application wants to know the relative item, use 4644/* If the application wants to know the relative item, use
@@ -6117,9 +6123,6 @@ _elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Ge
6117 it->item->before = EINA_FALSE; 6123 it->item->before = EINA_FALSE;
6118 _item_queue(sd, it, NULL); 6124 _item_queue(sd, it, NULL);
6119 6125
6120 if (_elm_config->atspi_mode)
6121 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
6122
6123 return EO_OBJ(it); 6126 return EO_OBJ(it);
6124} 6127}
6125 6128
@@ -6167,9 +6170,6 @@ _elm_genlist_item_prepend(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_G
6167 it->item->before = EINA_TRUE; 6170 it->item->before = EINA_TRUE;
6168 _item_queue(sd, it, NULL); 6171 _item_queue(sd, it, NULL);
6169 6172
6170 if (_elm_config->atspi_mode)
6171 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
6172
6173 return EO_OBJ(it); 6173 return EO_OBJ(it);
6174} 6174}
6175 6175
@@ -6217,9 +6217,6 @@ _elm_genlist_item_insert_after(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const
6217 it->item->before = EINA_FALSE; 6217 it->item->before = EINA_FALSE;
6218 _item_queue(sd, it, NULL); 6218 _item_queue(sd, it, NULL);
6219 6219
6220 if (_elm_config->atspi_mode)
6221 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
6222
6223 return EO_OBJ(it); 6220 return EO_OBJ(it);
6224} 6221}
6225 6222
@@ -6267,9 +6264,6 @@ _elm_genlist_item_insert_before(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist
6267 it->item->before = EINA_TRUE; 6264 it->item->before = EINA_TRUE;
6268 _item_queue(sd, it, NULL); 6265 _item_queue(sd, it, NULL);
6269 6266
6270 if (_elm_config->atspi_mode)
6271 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
6272
6273 return EO_OBJ(it); 6267 return EO_OBJ(it);
6274} 6268}
6275 6269
@@ -6373,9 +6367,6 @@ _elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist
6373 6367
6374 _item_queue(sd, it, _elm_genlist_item_list_compare); 6368 _item_queue(sd, it, _elm_genlist_item_list_compare);
6375 6369
6376 if (_elm_config->atspi_mode)
6377 elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, eo_it);
6378
6379 return eo_it; 6370 return eo_it;
6380} 6371}
6381 6372
diff --git a/src/lib/elm_interface_atspi_accessible.c b/src/lib/elm_interface_atspi_accessible.c
index 36e0cc042..352400895 100644
--- a/src/lib/elm_interface_atspi_accessible.c
+++ b/src/lib/elm_interface_atspi_accessible.c
@@ -115,6 +115,13 @@ const char* Atspi_Name[] = {
115 "last defined" 115 "last defined"
116}; 116};
117 117
118struct _Elm_Atspi_Event_Handler
119{
120 Eo_Event_Cb cb;
121 void *data;
122};
123
124static Eina_List *global_callbacks;
118 125
119EOLIAN static int 126EOLIAN static int
120_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, void *pd EINA_UNUSED) 127_elm_interface_atspi_accessible_index_in_parent_get(Eo *obj, void *pd EINA_UNUSED)
@@ -281,4 +288,52 @@ EAPI void elm_atspi_attributes_list_free(Eina_List *list)
281 } 288 }
282} 289}
283 290
291EOLIAN void
292_elm_interface_atspi_accessible_event_emit(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo *accessible, const Eo_Event_Description *event, void *event_info)
293{
294 Eina_List *l;
295 Elm_Atspi_Event_Handler *hdl;
296
297 if (!accessible || !event || !eo_isa(accessible, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
298 {
299 CRI("Invalid accessibility event emit parameters");
300 return;
301 }
302
303 EINA_LIST_FOREACH(global_callbacks, l, hdl)
304 {
305 if (hdl->cb)
306 hdl->cb(hdl->data, accessible, event, event_info);
307 }
308}
309
310EOLIAN Elm_Atspi_Event_Handler *
311_elm_interface_atspi_accessible_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Eo_Event_Cb cb, void *data)
312{
313 Elm_Atspi_Event_Handler *ret = calloc(sizeof(Elm_Atspi_Event_Handler), 1);
314
315 ret->cb = cb;
316 ret->data = data;
317
318 global_callbacks = eina_list_append(global_callbacks, ret);
319
320 return ret;
321}
322
323EOLIAN void
324_elm_interface_atspi_accessible_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Elm_Atspi_Event_Handler *handler)
325{
326 Eina_List *l, *l2;
327 Elm_Atspi_Event_Handler *hdl;
328 EINA_LIST_FOREACH_SAFE(global_callbacks, l, l2, hdl)
329 {
330 if (hdl == handler)
331 {
332 global_callbacks = eina_list_remove_list(global_callbacks, l);
333 free(hdl);
334 break;
335 }
336 }
337}
338
284#include "elm_interface_atspi_accessible.eo.c" 339#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 0110e506b..3672b02b7 100644
--- a/src/lib/elm_interface_atspi_accessible.eo
+++ b/src/lib/elm_interface_atspi_accessible.eo
@@ -102,6 +102,27 @@ mixin Elm_Interface_Atspi_Accessible ()
102 states: Elm_Atspi_State_Set; 102 states: Elm_Atspi_State_Set;
103 } 103 }
104 } 104 }
105 event_handler_add @class @protected {
106 [[Register accessibility event listener]]
107 params {
108 @in cb: Eo_Event_Cb; [[callback]]
109 @in data: void*; [[data]]
110 }
111 return: Elm_Atspi_Event_Handler*; [[Event handler]]
112 }
113 event_handler_del @class @protected {
114 [[Deregister accessibility event listener]]
115 params {
116 @in handler: Elm_Atspi_Event_Handler *; [[Event handler]]
117 }
118 }
119 event_emit @class @protected {
120 params {
121 @in accessible: Eo*; [[Accessibility object.]]
122 @in event: const(Eo_Event_Description)*; [[Accessibility event type.]]
123 @in event_info: void*; [[Accessibility event details.]]
124 }
125 }
105 } 126 }
106 events { 127 events {
107 property,changed: const(char)*; 128 property,changed: const(char)*;
@@ -109,5 +130,7 @@ mixin Elm_Interface_Atspi_Accessible ()
109 state,changed: Elm_Atspi_Event_State_Changed_Data; 130 state,changed: Elm_Atspi_Event_State_Changed_Data;
110 visible,data,changed; 131 visible,data,changed;
111 active,descendants,changed; 132 active,descendants,changed;
133 added;
134 removed;
112 } 135 }
113} 136}
diff --git a/src/lib/elm_interface_atspi_accessible.h b/src/lib/elm_interface_atspi_accessible.h
index 7ce9d80bd..9b147c978 100644
--- a/src/lib/elm_interface_atspi_accessible.h
+++ b/src/lib/elm_interface_atspi_accessible.h
@@ -3,6 +3,12 @@
3 3
4#ifdef EFL_BETA_API_SUPPORT 4#ifdef EFL_BETA_API_SUPPORT
5 5
6
7/**
8 * ATSPI event listener
9 */
10typedef struct _Elm_Atspi_Event_Handler Elm_Atspi_Event_Handler;
11
6/** 12/**
7 * ATSPI object state set. 13 * ATSPI object state set.
8 */ 14 */
@@ -266,38 +272,38 @@ EAPI void elm_atspi_attributes_list_free(Eina_List *list);
266 Elm_Atspi_Event_State_Changed_Data evinfo; \ 272 Elm_Atspi_Event_State_Changed_Data evinfo; \
267 evinfo.type = (tp); \ 273 evinfo.type = (tp); \
268 evinfo.new_value = (nvl); \ 274 evinfo.new_value = (nvl); \
269 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, (void*)&evinfo)); \ 275 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_STATE_CHANGED, (void*)&evinfo)); \
270 } while(0); } 276 } while(0); }
271 277
272/** 278/**
273 * Emits ATSPI 'PropertyChanged' dbus signal for 'Name' property. 279 * Emits ATSPI 'PropertyChanged' dbus signal for 'Name' property.
274 */ 280 */
275#define elm_interface_atspi_accessible_name_changed_signal_emit(obj) \ 281#define elm_interface_atspi_accessible_name_changed_signal_emit(obj) \
276 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "name")); 282 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "name"));
277 283
278/** 284/**
279 * Emits ATSPI 'PropertyChanged' dbus signal for 'Description' property. 285 * Emits ATSPI 'PropertyChanged' dbus signal for 'Description' property.
280 */ 286 */
281#define elm_interface_atspi_accessible_description_changed_signal_emit(obj) \ 287#define elm_interface_atspi_accessible_description_changed_signal_emit(obj) \
282 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "description")); 288 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "description"));
283 289
284/** 290/**
285 * Emits ATSPI 'PropertyChanged' dbus signal for 'Parent' property. 291 * Emits ATSPI 'PropertyChanged' dbus signal for 'Parent' property.
286 */ 292 */
287#define elm_interface_atspi_accessible_parent_changed_signal_emit(obj) \ 293#define elm_interface_atspi_accessible_parent_changed_signal_emit(obj) \
288 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "parent")); 294 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "parent"));
289 295
290/** 296/**
291 * Emits ATSPI 'PropertyChanged' dbus signal for 'Role' property. 297 * Emits ATSPI 'PropertyChanged' dbus signal for 'Role' property.
292 */ 298 */
293#define elm_interface_atspi_accessible_role_changed_signal_emit(obj) \ 299#define elm_interface_atspi_accessible_role_changed_signal_emit(obj) \
294 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "role")); 300 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "role"));
295 301
296/** 302/**
297 * Emits ATSPI 'PropertyChanged' dbus signal for 'Value' property. 303 * Emits ATSPI 'PropertyChanged' dbus signal for 'Value' property.
298 */ 304 */
299#define elm_interface_atspi_accessible_value_changed_signal_emit(obj) \ 305#define elm_interface_atspi_accessible_value_changed_signal_emit(obj) \
300 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "value")); 306 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_PROPERTY_CHANGED, "value"));
301 307
302/** 308/**
303 * Emits ATSPI 'ChildrenChanged' dbus signal with added child as argument. 309 * Emits ATSPI 'ChildrenChanged' dbus signal with added child as argument.
@@ -305,7 +311,7 @@ EAPI void elm_atspi_attributes_list_free(Eina_List *list);
305#define elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, child) \ 311#define elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, child) \
306 do { \ 312 do { \
307 Elm_Atspi_Event_Children_Changed_Data atspi_data = { EINA_TRUE, child }; \ 313 Elm_Atspi_Event_Children_Changed_Data atspi_data = { EINA_TRUE, child }; \
308 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &atspi_data)); \ 314 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &atspi_data)); \
309 } while(0); 315 } while(0);
310 316
311/** 317/**
@@ -314,14 +320,32 @@ EAPI void elm_atspi_attributes_list_free(Eina_List *list);
314#define elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, child) \ 320#define elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, child) \
315 do { \ 321 do { \
316 Elm_Atspi_Event_Children_Changed_Data atspi_data = { EINA_FALSE, child }; \ 322 Elm_Atspi_Event_Children_Changed_Data atspi_data = { EINA_FALSE, child }; \
317 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &atspi_data)); \ 323 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, &atspi_data)); \
318 } while(0); 324 } while(0);
319 325
320/** 326/**
321 * Emits ATSPI 'ActiveDescendantsChanged' dbus signal with deleted child as argument. 327 * Emits ATSPI 'ActiveDescendantsChanged' dbus signal.
328 */
329#define elm_interface_atspi_accessible_active_descendants_changed_signal_emit(obj, child) \
330 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ACTIVE_DESCENDANT_CHANGED, child));
331
332/**
333 * Emits ATSPI 'VisibleDataChanged' dbus signal.
334 */
335#define elm_interface_atspi_accessible_visible_data_changed_signal_emit(obj) \
336 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_VISIBLE_DATA_CHANGED, NULL));
337
338/**
339 * Emits ATSPI 'AddAccessible' dbus signal.
340 */
341#define elm_interface_atspi_accessible_added(obj) \
342 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ADDED, NULL));
343
344/**
345 * Emits ATSPI 'RemoveAccessible' dbus signal.
322 */ 346 */
323#define elm_interface_atspi_accessible_active_descendants_changed_signal_emit(obj, desc) \ 347#define elm_interface_atspi_accessible_removed(obj) \
324 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_ACTIVE_DESCENDANT_CHANGED, desc)); 348 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_REMOVED, NULL));
325 349
326#include "elm_interface_atspi_accessible.eo.h" 350#include "elm_interface_atspi_accessible.eo.h"
327#endif 351#endif
diff --git a/src/lib/elm_interface_atspi_window.h b/src/lib/elm_interface_atspi_window.h
new file mode 100644
index 000000000..0b148b382
--- /dev/null
+++ b/src/lib/elm_interface_atspi_window.h
@@ -0,0 +1,56 @@
1#ifndef ELM_INTERFACE_ATSPI_WINDOW_H
2#define ELM_INTERFACE_ATSPI_WINDOW_H
3
4#ifdef EFL_BETA_API_SUPPORT
5#ifdef EFL_EO_API_SUPPORT
6
7/**
8 * Emits ATSPI 'Window:Activated' dbus signal.
9 */
10#define elm_interface_atspi_window_activated_signal_emit(obj) \
11 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL));
12
13/**
14 * Emits ATSPI 'Window:Deactivated' dbus signal.
15 */
16#define elm_interface_atspi_window_deactivated_signal_emit(obj) \
17 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL));
18
19/**
20 * Emits ATSPI 'Window:Created' dbus signal.
21 */
22#define elm_interface_atspi_window_created_signal_emit(obj) \
23 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL));
24
25/**
26 * Emits ATSPI 'Window:Destroyed' dbus signal.
27 */
28#define elm_interface_atspi_window_destroyed_signal_emit(obj) \
29 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL));
30
31/**
32 * Emits ATSPI 'Window:Maximized' dbus signal.
33 */
34#define elm_interface_atspi_window_maximized_signal_emit(obj) \
35 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL));
36
37/**
38 * Emits ATSPI 'Window:Minimized' dbus signal.
39 */
40#define elm_interface_atspi_window_minimized_signal_emit(obj) \
41 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, NULL));
42
43/**
44 * Emits ATSPI 'Window:Restored' dbus signal.
45 */
46#define elm_interface_atspi_window_restored_signal_emit(obj) \
47 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_emit(obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, NULL));
48
49#include "elm_interface_atspi_window.eo.h"
50#endif
51#ifndef EFL_NOLEGACY_API_SUPPORT
52#include "elm_interface_atspi_window.eo.legacy.h"
53#endif
54
55#endif
56#endif
diff --git a/src/lib/elm_interfaces.h b/src/lib/elm_interfaces.h
index 61a359ef9..78e262f09 100644
--- a/src/lib/elm_interfaces.h
+++ b/src/lib/elm_interfaces.h
@@ -1,6 +1,7 @@
1#include "elm_interface_atspi_accessible.h" 1#include "elm_interface_atspi_accessible.h"
2#include "elm_interface_atspi_text.h" 2#include "elm_interface_atspi_text.h"
3#include "elm_interface_atspi_widget_action.h" 3#include "elm_interface_atspi_widget_action.h"
4#include "elm_interface_atspi_window.h"
4 5
5#ifdef EFL_EO_API_SUPPORT 6#ifdef EFL_EO_API_SUPPORT
6#include "elm_interface_scrollable.h" 7#include "elm_interface_scrollable.h"
@@ -11,7 +12,6 @@
11#include "elm_interface_atspi_image.eo.h" 12#include "elm_interface_atspi_image.eo.h"
12#include "elm_interface_atspi_selection.eo.h" 13#include "elm_interface_atspi_selection.eo.h"
13#include "elm_interface_atspi_value.eo.h" 14#include "elm_interface_atspi_value.eo.h"
14#include "elm_interface_atspi_window.eo.h"
15#endif 15#endif
16#endif 16#endif
17#ifndef EFL_NOLEGACY_API_SUPPORT 17#ifndef EFL_NOLEGACY_API_SUPPORT
@@ -22,6 +22,5 @@
22#include "elm_interface_atspi_image.eo.legacy.h" 22#include "elm_interface_atspi_image.eo.legacy.h"
23#include "elm_interface_atspi_selection.eo.legacy.h" 23#include "elm_interface_atspi_selection.eo.legacy.h"
24#include "elm_interface_atspi_value.eo.legacy.h" 24#include "elm_interface_atspi_value.eo.legacy.h"
25#include "elm_interface_atspi_window.eo.legacy.h"
26#endif 25#endif
27#endif 26#endif
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 5a1f6fa07..6bc1ccbe3 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -529,15 +529,6 @@ _elm_widget_evas_object_smart_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUS
529 Eina_Iterator *it; 529 Eina_Iterator *it;
530 Evas_Object *o; 530 Evas_Object *o;
531 531
532 if (_elm_config->atspi_mode)
533 {
534 Eo *parent;
535 eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
536 elm_interface_atspi_accessible_children_changed_added_signal_emit(parent, obj);
537 if (_elm_widget_onscreen_is(obj))
538 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_TRUE);
539 }
540
541 it = evas_object_smart_iterator_new(obj); 532 it = evas_object_smart_iterator_new(obj);
542 EINA_ITERATOR_FOREACH(it, o) 533 EINA_ITERATOR_FOREACH(it, o)
543 { 534 {
@@ -545,6 +536,16 @@ _elm_widget_evas_object_smart_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUS
545 evas_object_show(o); 536 evas_object_show(o);
546 } 537 }
547 eina_iterator_free(it); 538 eina_iterator_free(it);
539
540 if (_elm_config->atspi_mode)
541 {
542 elm_interface_atspi_accessible_added(obj);
543 Eo *parent;
544 eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
545 if (parent) elm_interface_atspi_accessible_children_changed_added_signal_emit(parent, obj);
546 if (_elm_widget_onscreen_is(obj))
547 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_TRUE);
548 }
548} 549}
549 550
550EOLIAN static void 551EOLIAN static void
@@ -562,7 +563,12 @@ _elm_widget_evas_object_smart_hide(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUS
562 eina_iterator_free(it); 563 eina_iterator_free(it);
563 564
564 if (_elm_config->atspi_mode) 565 if (_elm_config->atspi_mode)
565 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_FALSE); 566 {
567 Eo *parent;
568 eo_do(obj, parent = elm_interface_atspi_accessible_parent_get());
569 if (parent) elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, obj);
570 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_FALSE);
571 }
566} 572}
567 573
568EOLIAN static void 574EOLIAN static void
@@ -1282,8 +1288,6 @@ _elm_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
1282 1288
1283 sd->subobjs = eina_list_remove(sd->subobjs, sobj); 1289 sd->subobjs = eina_list_remove(sd->subobjs, sobj);
1284 1290
1285 if (_elm_config->atspi_mode)
1286 elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, sobj);
1287 _callbacks_del(sobj, obj); 1291 _callbacks_del(sobj, obj);
1288 1292
1289 return EINA_TRUE; 1293 return EINA_TRUE;
@@ -4431,7 +4435,9 @@ _elm_widget_item_eo_base_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
4431 eina_stringshare_del(item->description); 4435 eina_stringshare_del(item->description);
4432 4436
4433 if (_elm_config->atspi_mode) 4437 if (_elm_config->atspi_mode)
4434 elm_interface_atspi_accessible_children_changed_del_signal_emit(item->widget, eo_item); 4438 elm_interface_atspi_accessible_children_changed_del_signal_emit(item->widget, eo_item);
4439
4440 elm_interface_atspi_accessible_removed(eo_item);
4435 4441
4436 EINA_MAGIC_SET(item, EINA_MAGIC_NONE); 4442 EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
4437 4443
@@ -5721,19 +5727,15 @@ _elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd)
5721 sd->on_create = EINA_FALSE; 5727 sd->on_create = EINA_FALSE;
5722 5728
5723 sd->role = ELM_ATSPI_ROLE_UNKNOWN; 5729 sd->role = ELM_ATSPI_ROLE_UNKNOWN;
5724
5725 return obj; 5730 return obj;
5726} 5731}
5727 5732
5728EOLIAN static void 5733EOLIAN static void
5729_elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd) 5734_elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
5730{ 5735{
5731 Eo *parent;
5732 if (sd->description) eina_stringshare_del(sd->description); 5736 if (sd->description) eina_stringshare_del(sd->description);
5733 5737
5734 eo_do(obj, parent = elm_interface_atspi_accessible_parent_get()); 5738 elm_interface_atspi_accessible_removed(obj);
5735 if (parent && !eo_destructed_is(parent))
5736 elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, obj);
5737 5739
5738 eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor()); 5740 eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor());
5739} 5741}
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index d0bfb9a2c..65388e3f9 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -1113,7 +1113,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
1113 1113
1114 if (_elm_config->atspi_mode) 1114 if (_elm_config->atspi_mode)
1115 { 1115 {
1116 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL)); 1116 elm_interface_atspi_window_activated_signal_emit(obj);
1117 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE); 1117 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
1118 } 1118 }
1119 1119
@@ -1151,7 +1151,7 @@ _elm_win_focus_out(Ecore_Evas *ee)
1151 1151
1152 if (_elm_config->atspi_mode) 1152 if (_elm_config->atspi_mode)
1153 { 1153 {
1154 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL)); 1154 elm_interface_atspi_window_deactivated_signal_emit(obj);
1155 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_FALSE); 1155 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_FALSE);
1156 } 1156 }
1157 1157
@@ -1358,15 +1358,13 @@ _elm_win_state_change(Ecore_Evas *ee)
1358 { 1358 {
1359 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_ICONIFIED, NULL)); 1359 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_ICONIFIED, NULL));
1360 if (_elm_config->atspi_mode) 1360 if (_elm_config->atspi_mode)
1361 eo_do(obj, eo_event_callback_call 1361 elm_interface_atspi_window_minimized_signal_emit(obj);
1362 (ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MINIMIZED, NULL));
1363 } 1362 }
1364 else 1363 else
1365 { 1364 {
1366 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_NORMAL, NULL)); 1365 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_NORMAL, NULL));
1367 if (_elm_config->atspi_mode) 1366 if (_elm_config->atspi_mode)
1368 eo_do(obj, eo_event_callback_call 1367 elm_interface_atspi_window_restored_signal_emit(obj);
1369 (ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, NULL));
1370 } 1368 }
1371 } 1369 }
1372 if (ch_sticky) 1370 if (ch_sticky)
@@ -1404,15 +1402,13 @@ _elm_win_state_change(Ecore_Evas *ee)
1404 { 1402 {
1405 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_MAXIMIZED, NULL)); 1403 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_MAXIMIZED, NULL));
1406 if (_elm_config->atspi_mode) 1404 if (_elm_config->atspi_mode)
1407 eo_do(obj, eo_event_callback_call 1405 elm_interface_atspi_window_maximized_signal_emit(obj);
1408 (ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_MAXIMIZED, NULL));
1409 } 1406 }
1410 else 1407 else
1411 { 1408 {
1412 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_UNMAXIMIZED, NULL)); 1409 eo_do(obj, eo_event_callback_call(ELM_WIN_EVENT_UNMAXIMIZED, NULL));
1413 if (_elm_config->atspi_mode) 1410 if (_elm_config->atspi_mode)
1414 eo_do(obj, eo_event_callback_call 1411 elm_interface_atspi_window_restored_signal_emit(obj);
1415 (ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_RESTORED, NULL));
1416 } 1412 }
1417 } 1413 }
1418 if (ch_profile) 1414 if (ch_profile)
@@ -1620,7 +1616,7 @@ _elm_win_evas_object_smart_hide(Eo *obj, Elm_Win_Data *sd)
1620#endif 1616#endif
1621 } 1617 }
1622 if (_elm_config->atspi_mode) 1618 if (_elm_config->atspi_mode)
1623 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL)); 1619 elm_interface_atspi_window_deactivated_signal_emit(obj);
1624 1620
1625 if (_elm_win_policy_quit_triggered(obj)) 1621 if (_elm_win_policy_quit_triggered(obj))
1626 _elm_win_flush_cache_and_exit(obj); 1622 _elm_win_flush_cache_and_exit(obj);
@@ -1894,6 +1890,9 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1894 1890
1895 if (sd->autodel_clear) *(sd->autodel_clear) = -1; 1891 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1896 1892
1893 if (_elm_config->atspi_mode)
1894 elm_interface_atspi_window_destroyed_signal_emit(obj);
1895
1897 _elm_win_list = eina_list_remove(_elm_win_list, obj); 1896 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1898 _elm_win_count--; 1897 _elm_win_count--;
1899 _elm_win_state_eval_queue(); 1898 _elm_win_state_eval_queue();
@@ -1958,9 +1957,6 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1958 { 1957 {
1959 _elm_win_flush_cache_and_exit(obj); 1958 _elm_win_flush_cache_and_exit(obj);
1960 } 1959 }
1961
1962 if (_elm_config->atspi_mode)
1963 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL));
1964} 1960}
1965 1961
1966static void 1962static void
@@ -2079,7 +2075,7 @@ _elm_win_delete_request(Ecore_Evas *ee)
2079 evas_object_hide(obj); 2075 evas_object_hide(obj);
2080 // FIXME: if above callback deletes - then the below will be invalid 2076 // FIXME: if above callback deletes - then the below will be invalid
2081 if (_elm_config->atspi_mode) 2077 if (_elm_config->atspi_mode)
2082 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DESTROYED, NULL)); 2078 elm_interface_atspi_window_destroyed_signal_emit(obj);
2083 if (autodel) evas_object_del(obj); 2079 if (autodel) evas_object_del(obj);
2084 else sd->autodel_clear = NULL; 2080 else sd->autodel_clear = NULL;
2085 evas_object_unref(obj); 2081 evas_object_unref(obj);
@@ -3869,7 +3865,7 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3869 3865
3870 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3866 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3871 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3867 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
3872 eo_do(obj, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL)); 3868 elm_interface_atspi_window_created_signal_emit(obj);
3873 3869
3874 evas_object_show(sd->edje); 3870 evas_object_show(sd->edje);
3875 3871
@@ -5553,11 +5549,13 @@ _on_atspi_bus_connected(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Ev
5553 * recieve all org.a11y.window events and could keep track of active 5549 * recieve all org.a11y.window events and could keep track of active
5554 * windows whithin system. 5550 * windows whithin system.
5555 */ 5551 */
5556 eo_do(win, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_CREATED, NULL)); 5552 elm_interface_atspi_window_created_signal_emit(win);
5557 if (elm_win_focus_get(win)) 5553 if (elm_win_focus_get(win))
5558 eo_do(win, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL)); 5554 {
5555 elm_interface_atspi_window_activated_signal_emit(win);
5556 }
5559 else 5557 else
5560 eo_do(win, eo_event_callback_call(ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL)); 5558 elm_interface_atspi_window_deactivated_signal_emit(win);
5561 } 5559 }
5562 return EINA_TRUE; 5560 return EINA_TRUE;
5563} 5561}
diff --git a/src/tests/elm_test_genlist.c b/src/tests/elm_test_genlist.c
index ade75c880..1dc64a256 100644
--- a/src/tests/elm_test_genlist.c
+++ b/src/tests/elm_test_genlist.c
@@ -80,8 +80,11 @@ END_TEST
80 80
81static Eina_Bool 81static Eina_Bool
82_children_changed_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, 82_children_changed_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED,
83 const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 83 const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
84{ 84{
85 if (desc != ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED)
86 return EINA_TRUE;
87
85 ev_data = *(Elm_Atspi_Event_Children_Changed_Data*)event_info; 88 ev_data = *(Elm_Atspi_Event_Children_Changed_Data*)event_info;
86 current = obj; 89 current = obj;
87 counter++; 90 counter++;
@@ -98,7 +101,7 @@ START_TEST(elm_atspi_children_events_add)
98 101
99 Elm_Object_Item *it[3]; 102 Elm_Object_Item *it[3];
100 103
101 eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL)); 104 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_add(_children_changed_cb, NULL));
102 105
103 it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); 106 it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
104 ck_assert(genlist == current); 107 ck_assert(genlist == current);
@@ -135,7 +138,7 @@ START_TEST(elm_atspi_children_events_del1)
135 it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); 138 it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
136 it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL); 139 it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
137 140
138 eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL)); 141 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_add(_children_changed_cb, NULL));
139 142
140 elm_object_item_del(it[0]); 143 elm_object_item_del(it[0]);
141 ck_assert(genlist == current); 144 ck_assert(genlist == current);
@@ -163,7 +166,7 @@ START_TEST(elm_atspi_children_events_del2)
163 166
164 it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); 167 it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
165 168
166 eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL)); 169 eo_do(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, elm_interface_atspi_accessible_event_handler_add(_children_changed_cb, NULL));
167 elm_genlist_clear(genlist); 170 elm_genlist_clear(genlist);
168 171
169 ck_assert(genlist == current); 172 ck_assert(genlist == current);