From 10d855c60e32f65a28e0fedfc3217c6fef1d4613 Mon Sep 17 00:00:00 2001 From: Shilpa Singh Date: Thu, 30 Nov 2017 15:28:44 +0530 Subject: [PATCH] elm: access: widget_atspi function added to genlist, gengrid. when item realized register object, on unrealize de-register object. Change-Id: Ib56e5d8248e9468fdb281aa6734106780f984a4d Signed-off-by: Shilpa Singh --- src/lib/elementary/elm_gengrid.c | 56 ++++++++++++++++++++++++++------- src/lib/elementary/elm_gengrid.eo | 4 +++ src/lib/elementary/elm_genlist.c | 66 ++++++++++++++++++++++++++++++++++----- src/lib/elementary/elm_genlist.eo | 4 +++ 4 files changed, 111 insertions(+), 19 deletions(-) diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index 48a46df..6a8a118 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1231,6 +1231,12 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it, evas_event_thaw(evas_object_evas_get(WIDGET(it))); evas_event_thaw_eval(evas_object_evas_get(WIDGET(it))); + + if (_elm_config->atspi_mode) + { + efl_access_removed(EO_OBJ(it)); + efl_access_children_changed_del_signal_emit(WIDGET(it), EO_OBJ(it)); + } } static void @@ -1581,6 +1587,12 @@ _item_realize(Elm_Gen_Item *it) /* access */ if (_elm_config->access_mode) _access_widget_item_register(it); + if (_elm_config->atspi_mode) + { + efl_access_added(EO_OBJ(it)); + efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); + } + /* infate texts, contents and states of view object */ _view_inflate(VIEW(it), it, &it->texts, &it->contents); @@ -4194,6 +4206,38 @@ _elm_gengrid_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Gengrid_Data * _access_obj_process(sd, _elm_gengrid_smart_focus_next_enable); } +//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, +//register/unregister access objects accordingly. +EOLIAN static void +_elm_gengrid_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Eina_Bool is_atspi) +{ + Elm_Gen_Item *it; + Evas_Object *content = NULL; + Eina_List *l; + + EINA_INLIST_FOREACH(sd->items, it) + { + if (!it->realized) continue; + if (is_atspi) + { + efl_access_added(EO_OBJ(it)); + efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); + efl_access_name_changed_signal_emit(EO_OBJ(it)); + EINA_LIST_FOREACH(it->contents, l, content) + { + if (efl_isa(content, EFL_ACCESS_MIXIN)) + efl_access_parent_set(content, EO_OBJ(it)); + } + } + else + { + efl_access_removed(EO_OBJ(it)); + efl_access_children_changed_del_signal_emit(sd->obj, EO_OBJ(it)); + } + } +} +// + EAPI Evas_Object * elm_gengrid_add(Evas_Object *parent) { @@ -4368,12 +4412,6 @@ _elm_gengrid_item_append(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_C ecore_job_del(sd->calc_job); sd->calc_job = ecore_job_add(_calc_job, obj); - if (_elm_config->atspi_mode) - { - efl_access_added(EO_OBJ(it)); - efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); - } - return EO_OBJ(it); } @@ -4394,12 +4432,6 @@ _elm_gengrid_item_prepend(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_ ecore_job_del(sd->calc_job); sd->calc_job = ecore_job_add(_calc_job, obj); - if (_elm_config->atspi_mode) - { - efl_access_added(EO_OBJ(it)); - efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); - } - return EO_OBJ(it); } diff --git a/src/lib/elementary/elm_gengrid.eo b/src/lib/elementary/elm_gengrid.eo index 0cd4174..b3deb3d 100644 --- a/src/lib/elementary/elm_gengrid.eo +++ b/src/lib/elementary/elm_gengrid.eo @@ -554,6 +554,10 @@ class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll Elm.Widget.widget_event; Elm.Widget.focus_highlight_geometry { get; } Elm.Widget.focused_item { get; } + //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, + //register/unregister access objects accordingly. + Elm.Widget.atspi; + // Elm.Interface_Scrollable.item_loop_enabled { get; set; } Elm.Interface_Scrollable.bounce_allow { set; } Elm.Interface_Scrollable.policy { get; set; } diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index e429675..85c40da 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -1863,7 +1863,10 @@ _item_realize(Elm_Gen_Item *it, const int index, Eina_Bool calc) //TIZEN_ONLY(20150709) Do not register children of MANAGES_DESCENDATS objects if (_elm_config->atspi_mode) - efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); + { + efl_access_added(EO_OBJ(it)); + efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); + } // /* access */ @@ -4827,12 +4830,6 @@ _item_queue(Elm_Genlist_Data *sd, // evas_event_thaw_eval(evas_object_evas_get(sd->obj)); evas_object_geometry_get(sd->obj, NULL, NULL, &w, NULL); if (w > 0) _requeue_idle_enterer(sd); - - if (_elm_config->atspi_mode) - { - efl_access_added(EO_OBJ(it)); - efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); - } } /* If the application wants to know the relative item, use @@ -5227,6 +5224,7 @@ _item_unrealize(Elm_Gen_Item *it) { Evas_Object *c; Eina_List *cache = NULL; + ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); EINA_LIST_FREE(it->item->flip_contents, c) evas_object_del(c); @@ -5235,6 +5233,14 @@ _item_unrealize(Elm_Gen_Item *it) if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) _elm_access_widget_item_unregister(it->base); + //TIZEN_ONLY(20150709) Do not register children of MANAGES_DESCENDATS objects + if (_elm_config->atspi_mode) + { + efl_access_removed(EO_OBJ(it)); + efl_access_children_changed_del_signal_emit(sd->obj, EO_OBJ(it)); + } + // + // unswallow VIEW(it) first then manipulate VIEW(it) _decorate_item_unrealize(it, EINA_FALSE); if (it->item->wsd->decorate_all_mode) _decorate_all_item_unrealize(it); @@ -5835,6 +5841,52 @@ _elm_genlist_elm_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Genlist_Data * _access_obj_process(sd, _elm_genlist_smart_focus_next_enable); } +//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, +//register/unregister access objects accordingly. +EOLIAN static void +_elm_genlist_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bool is_atspi) +{ + Item_Block *itb; + Eina_Bool done = EINA_FALSE; + Evas_Object *content = NULL; + + EINA_INLIST_FOREACH(sd->blocks, itb) + { + if (itb->realized) + { + Eina_List *l; + Elm_Gen_Item *it; + + done = EINA_TRUE; + EINA_LIST_FOREACH(itb->items, l, it) + { + if (!it->realized || it->hide) continue; + if (is_atspi) + { + efl_access_added(EO_OBJ(it)); + efl_access_children_changed_added_signal_emit(sd->obj, EO_OBJ(it)); + EINA_LIST_FOREACH(it->contents, l, content) + { + if (efl_isa(content, EFL_ACCESS_MIXIN)) + { + efl_access_parent_set(content, EO_OBJ(it)); + efl_access_children_changed_added_signal_emit(EO_OBJ(it), content); + } + } + efl_access_name_changed_signal_emit(EO_OBJ(it)); + } + else + { + efl_access_removed(EO_OBJ(it)); + efl_access_children_changed_del_signal_emit(sd->obj, EO_OBJ(it)); + } + } + } + else if (done) break; + } +} +// + EAPI Evas_Object * elm_genlist_add(Evas_Object *parent) { diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo index a06e588..91a49ee 100644 --- a/src/lib/elementary/elm_genlist.eo +++ b/src/lib/elementary/elm_genlist.eo @@ -541,6 +541,10 @@ class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scroll Elm.Widget.widget_sub_object_del; Elm.Widget.widget_event; Elm.Widget.focused_item { get; } + //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, + //register/unregister access objects accordingly. + Elm.Widget.atspi; + // Elm.Interface_Scrollable.item_loop_enabled { get; set; } Elm.Interface_Scrollable.bounce_allow { get; set; } Elm.Interface_Scrollable.policy { get; set; } -- 2.7.4