From: JunsuChoi Date: Fri, 29 Sep 2017 11:55:32 +0000 (+0900) Subject: atspi: Improves how to find the can_highlight of the widget. X-Git-Tag: submit/tizen_4.0/20171020.125844~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2212fffb35af18498d53f0da894218ba59f8c8ca;p=platform%2Fupstream%2Felementary.git atspi: Improves how to find the can_highlight of the widget. Returns EINA_FALSE if any of parents is EINA_FALSE when determining can_highlight. To determine can_highlight for the parent of an object, we try to find the parent of the parent again. As it repeats, it traverses as much as depth size factorial (d!) However, if any of the parent of the object has can_highlight of the widget data is EINA_FALSE, it is eventually EINA_FALSE Change-Id: I8ad128bba766c97ddf3dd28ad788c0e2dd1d3554 --- diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 0a1331203..4a1f669af 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -5052,6 +5052,26 @@ _elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* na return id->accessible_name; } +//TIZEN_ONLY(20160929) : atspi: Improves how to find the can_highlight of the widget +static Eina_Bool +_elm_widget_can_highlight_get_by_class(Eo *obj) +{ + if (eo_isa(obj, ELM_WIDGET_ITEM_CLASS)) + { + Elm_Widget_Item_Data *id = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS); + if (!id) return EINA_FALSE; + if (!id->can_highlight) return EINA_FALSE; + } + else + { + Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_WIDGET_CLASS); + if (!wd) return EINA_FALSE; + if (!wd->can_highlight) return EINA_FALSE; + } + return EINA_TRUE; +} +// + //TIZEN_ONLY(20161107): enhance elm_atspi_accessible_can_highlight_set to set can_hihglight property to its children EAPI Eina_Bool _elm_widget_item_highlightable(Elm_Object_Item *item) @@ -5066,8 +5086,9 @@ _elm_widget_item_highlightable(Elm_Object_Item *item) eo_do(item, parent = elm_interface_atspi_accessible_parent_get()); while (parent && !eo_isa(parent, ELM_ATSPI_APP_OBJECT_CLASS)) { - eo_do(parent, can_highlight = elm_interface_atspi_accessible_can_highlight_get()); - if (!can_highlight) return EINA_FALSE; + //TIZEN_ONLY(20160929) : atspi: Improves how to find the can_highlight of the widget + if (!_elm_widget_can_highlight_get_by_class(parent)) return EINA_FALSE; + // eo_do(parent, parent = elm_interface_atspi_accessible_parent_get()); } return EINA_TRUE; @@ -6957,8 +6978,9 @@ _elm_widget_highlightable(Evas_Object *obj) eo_do(obj, parent = elm_interface_atspi_accessible_parent_get()); while (parent && !eo_isa(parent, ELM_ATSPI_APP_OBJECT_CLASS)) { - eo_do(parent, can_highlight = elm_interface_atspi_accessible_can_highlight_get()); - if (!can_highlight) return EINA_FALSE; + //TIZEN_ONLY(20160929) : atspi: Improves how to find the can_highlight of the widget + if (!_elm_widget_can_highlight_get_by_class(parent)) return EINA_FALSE; + // eo_do(parent, parent = elm_interface_atspi_accessible_parent_get()); } return EINA_TRUE;