atspi: improva child add/del broadcasting.
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 9 Oct 2014 09:17:20 +0000 (11:17 +0200)
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Mon, 6 Apr 2015 08:24:59 +0000 (10:24 +0200)
This commit enables generic broadcasting of changes in widget hierarcies.
Previously this kind of broadcasting had to be implemented inside widget.
This solution is using elm_widget sub_obj_add/sub_obj_del functions.

legacy/elementary/src/lib/elm_widget.c
legacy/elementary/src/lib/elm_widget.eo

index 6acd1aa..0c50810 100644 (file)
@@ -1180,6 +1180,9 @@ _elm_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
    sd->subobjs = eina_list_append(sd->subobjs, sobj);
    evas_object_data_set(sobj, "elm-parent", obj);
 
+   if (_elm_config->atspi_mode)
+     elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, sobj);
+
    _callbacks_add(sobj, obj);
    if (_elm_widget_is(sobj))
      {
@@ -1291,6 +1294,8 @@ _elm_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
 
    sd->subobjs = eina_list_remove(sd->subobjs, sobj);
 
+   if (_elm_config->atspi_mode)
+     elm_interface_atspi_accessible_children_changed_del_signal_emit(obj, sobj);
    _callbacks_del(sobj, obj);
 
    return EINA_TRUE;
@@ -5599,6 +5604,12 @@ _elm_widget_elm_interface_atspi_accessible_children_get(Eo *obj EINA_UNUSED, Elm
    return accs;
 }
 
+EOLIAN static Eo*
+_elm_widget_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd)
+{
+   return pd->parent_obj;
+}
+
 EOLIAN static Elm_Atspi_State_Set
 _elm_widget_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
 {
index 264842f..87722ea 100644 (file)
@@ -820,6 +820,7 @@ abstract Elm_Widget (Evas.Object_Smart, Elm_Interface_Atspi_Accessible, Elm_Inte
       Elm_Interface_Atspi_Accessible.role.set;
       Elm_Interface_Atspi_Accessible.state_set.get;
       Elm_Interface_Atspi_Accessible.children.get;
+      Elm_Interface_Atspi_Accessible.parent.get;
       Elm_Interface_Atspi_Accessible.attributes.get;
       Elm_Interface_Atspi_Accessible.relation_set.get;
       Elm_Interface_Atspi_Component.focus_grab;