summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-10-08 12:23:15 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit69c40904fc855cbd318677c30d4e69a67cd943a9 (patch)
tree7f3732fd6ef632c27bc6273762ae2684443c0258
parent93e3ced154ba22bcb28ede0183c5ef418efd78fb (diff)
atspi: clean-up children-changed event emission.
Patch fixes bugs caused by difference between elm widget and atspi objects hierarchy.
-rw-r--r--src/lib/elm_genlist.c7
-rw-r--r--src/lib/elm_list.c4
-rw-r--r--src/lib/elm_toolbar.c7
-rw-r--r--src/lib/elm_widget.c30
-rw-r--r--src/lib/elm_widget.h1
-rw-r--r--src/lib/elm_win.c17
6 files changed, 45 insertions, 21 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index cb71fb95d..2e4bd8bf7 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -397,8 +397,11 @@ _item_content_realize(Elm_Gen_Item *it,
397 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key); 397 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
398 edje_object_signal_emit(target, buf, "elm"); 398 edje_object_signal_emit(target, buf, "elm");
399 399
400 if (_elm_config->atspi_mode) 400 if (_elm_config->atspi_mode && eo_isa(content, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
401 eo_do(content, elm_interface_atspi_accessible_parent_set(EO_OBJ(it))); 401 {
402 eo_do(content, elm_interface_atspi_accessible_parent_set(EO_OBJ(it)));
403 elm_interface_atspi_accessible_children_changed_added_signal_emit(EO_OBJ(it), content);
404 }
402 } 405 }
403 } 406 }
404} 407}
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index c4b81a0b4..065caa4e4 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -2333,19 +2333,19 @@ _item_new(Evas_Object *obj,
2333 2333
2334 if (it->icon) 2334 if (it->icon)
2335 { 2335 {
2336 eo_do(it->icon, elm_interface_atspi_accessible_parent_set(eo_it));
2336 elm_widget_sub_object_add(obj, it->icon); 2337 elm_widget_sub_object_add(obj, it->icon);
2337 evas_object_event_callback_add 2338 evas_object_event_callback_add
2338 (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, 2339 (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
2339 obj); 2340 obj);
2340 eo_do(it->icon, elm_interface_atspi_accessible_parent_set(eo_it));
2341 } 2341 }
2342 if (it->end) 2342 if (it->end)
2343 { 2343 {
2344 eo_do(it->end, elm_interface_atspi_accessible_parent_set(eo_it));
2344 elm_widget_sub_object_add(obj, it->end); 2345 elm_widget_sub_object_add(obj, it->end);
2345 evas_object_event_callback_add 2346 evas_object_event_callback_add
2346 (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, 2347 (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
2347 obj); 2348 obj);
2348 eo_do(it->end, elm_interface_atspi_accessible_parent_set(eo_it));
2349 } 2349 }
2350 2350
2351 if (_elm_config->atspi_mode) 2351 if (_elm_config->atspi_mode)
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index 58914b28c..b5096b490 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -2367,6 +2367,9 @@ _item_new(Evas_Object *obj,
2367 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 2367 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
2368 _access_widget_item_register(it); 2368 _access_widget_item_register(it);
2369 2369
2370 eo_do(icon_obj, elm_interface_atspi_accessible_parent_set(VIEW(it)));
2371 eo_do(VIEW(it), elm_interface_atspi_accessible_parent_set(eo_it));
2372
2370 if (_item_icon_set(icon_obj, "toolbar/", icon)) 2373 if (_item_icon_set(icon_obj, "toolbar/", icon))
2371 { 2374 {
2372 it->icon = icon_obj; 2375 it->icon = icon_obj;
@@ -2434,11 +2437,7 @@ _item_new(Evas_Object *obj,
2434 _item_select(it); 2437 _item_select(it);
2435 2438
2436 if (_elm_config->atspi_mode) 2439 if (_elm_config->atspi_mode)
2437 {
2438 eo_do(icon_obj, elm_interface_atspi_accessible_parent_set(eo_it));
2439 eo_do(VIEW(it), elm_interface_atspi_accessible_parent_set(eo_it));
2440 elm_interface_atspi_accessible_added(eo_it); 2440 elm_interface_atspi_accessible_added(eo_it);
2441 }
2442 2441
2443 return it; 2442 return it;
2444} 2443}
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 4996141ee..65d049a09 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -540,9 +540,6 @@ _elm_widget_evas_object_smart_show(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUS
540 if (_elm_config->atspi_mode) 540 if (_elm_config->atspi_mode)
541 { 541 {
542 elm_interface_atspi_accessible_added(obj); 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)) 543 if (_elm_widget_onscreen_is(obj))
547 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_TRUE); 544 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_TRUE);
548 } 545 }
@@ -563,12 +560,7 @@ _elm_widget_evas_object_smart_hide(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUS
563 eina_iterator_free(it); 560 eina_iterator_free(it);
564 561
565 if (_elm_config->atspi_mode) 562 if (_elm_config->atspi_mode)
566 { 563 elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_FALSE);
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 }
572} 564}
573 565
574EOLIAN static void 566EOLIAN static void
@@ -1208,6 +1200,13 @@ _elm_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
1208 1200
1209 elm_widget_display_mode_set(sobj, 1201 elm_widget_display_mode_set(sobj,
1210 evas_object_size_hint_display_mode_get(obj)); 1202 evas_object_size_hint_display_mode_get(obj));
1203 if (_elm_config->atspi_mode && !sdc->on_create)
1204 {
1205 Elm_Interface_Atspi_Accessible *aparent;
1206 eo_do(sobj, aparent = elm_interface_atspi_accessible_parent_get());
1207 if (obj == aparent)
1208 elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, sobj);
1209 }
1211 } 1210 }
1212 1211
1213end: 1212end:
@@ -1279,6 +1278,13 @@ _elm_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
1279 parent = sdp->parent_obj; 1278 parent = sdp->parent_obj;
1280 } 1279 }
1281 } 1280 }
1281 if (_elm_config->atspi_mode && !sd->on_destroy)
1282 {
1283 Elm_Interface_Atspi_Accessible *aparent;
1284 eo_do(sobj, aparent = elm_interface_atspi_accessible_parent_get());
1285 if (obj == aparent)
1286 elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, sobj);
1287 }
1282 1288
1283 ELM_WIDGET_DATA_GET(sobj, sdc); 1289 ELM_WIDGET_DATA_GET(sobj, sdc);
1284 sdc->parent_obj = NULL; 1290 sdc->parent_obj = NULL;
@@ -5709,15 +5715,17 @@ _elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
5709EOLIAN static void 5715EOLIAN static void
5710_elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) 5716_elm_widget_eo_base_destructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
5711{ 5717{
5718 sd->on_destroy = EINA_TRUE;
5712 eo_do(obj, 5719 eo_do(obj,
5713 elm_interface_atspi_accessible_description_set(NULL), 5720 elm_interface_atspi_accessible_description_set(NULL),
5714 elm_interface_atspi_accessible_name_set(NULL), 5721 elm_interface_atspi_accessible_name_set(NULL),
5715 elm_interface_atspi_accessible_translation_domain_set(NULL), 5722 elm_interface_atspi_accessible_translation_domain_set(NULL),
5716 elm_interface_atspi_accessible_relationships_clear() 5723 elm_interface_atspi_accessible_relationships_clear()
5717 ); 5724 );
5718 elm_interface_atspi_accessible_removed(obj);
5719
5720 eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor()); 5725 eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor());
5726 sd->on_destroy = EINA_FALSE;
5727
5728 elm_interface_atspi_accessible_removed(obj);
5721} 5729}
5722 5730
5723EOLIAN static Eina_Bool 5731EOLIAN static Eina_Bool
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index 9f570a92d..e553ec5f5 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -443,6 +443,7 @@ typedef struct _Elm_Widget_Smart_Data
443 Eina_Bool highlight_root : 1; 443 Eina_Bool highlight_root : 1;
444 Eina_Bool on_translate : 1; /**< This is true when any types of elm translate function is being called. */ 444 Eina_Bool on_translate : 1; /**< This is true when any types of elm translate function is being called. */
445 Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */ 445 Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */
446 Eina_Bool on_destroy: 1; /**< This is true when the widget is on destruction(general widget destructor). */
446} Elm_Widget_Smart_Data; 447} Elm_Widget_Smart_Data;
447 448
448/** 449/**
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index c07b7fbd9..ff52d3b6e 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -1578,6 +1578,14 @@ _elm_win_evas_object_smart_show(Eo *obj, Elm_Win_Data *sd)
1578 1578
1579 TRAP(sd, show); 1579 TRAP(sd, show);
1580 1580
1581 if (_elm_config->atspi_mode)
1582 {
1583 Eo *bridge = _elm_atspi_bridge_get();
1584 elm_interface_atspi_window_created_signal_emit(obj);
1585 if (bridge)
1586 elm_interface_atspi_accessible_children_changed_added_signal_emit(elm_atspi_bridge_root_get(bridge), obj);
1587 }
1588
1581 if (sd->shot.info) _shot_handle(sd); 1589 if (sd->shot.info) _shot_handle(sd);
1582} 1590}
1583 1591
@@ -1615,7 +1623,12 @@ _elm_win_evas_object_smart_hide(Eo *obj, Elm_Win_Data *sd)
1615#endif 1623#endif
1616 } 1624 }
1617 if (_elm_config->atspi_mode) 1625 if (_elm_config->atspi_mode)
1618 elm_interface_atspi_window_deactivated_signal_emit(obj); 1626 {
1627 Eo *bridge = _elm_atspi_bridge_get();
1628 elm_interface_atspi_window_destroyed_signal_emit(obj);
1629 if (bridge)
1630 elm_interface_atspi_accessible_children_changed_del_signal_emit(elm_atspi_bridge_root_get(bridge), obj);
1631 }
1619 1632
1620 if (_elm_win_policy_quit_triggered(obj)) 1633 if (_elm_win_policy_quit_triggered(obj))
1621 _elm_win_flush_cache_and_exit(obj); 1634 _elm_win_flush_cache_and_exit(obj);
@@ -3867,7 +3880,7 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3867 } 3880 }
3868 3881
3869 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW)); 3882 eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
3870 if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON) 3883 if (_elm_config->atspi_mode)
3871 elm_interface_atspi_window_created_signal_emit(obj); 3884 elm_interface_atspi_window_created_signal_emit(obj);
3872 3885
3873 evas_object_show(sd->edje); 3886 evas_object_show(sd->edje);