atspi: Improves how to find the can_highlight of the widget. 73/154973/2
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 29 Sep 2017 11:55:32 +0000 (20:55 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 13 Oct 2017 05:02:31 +0000 (05:02 +0000)
   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: I0b6d2907aaf4c4778519dd56232d126249fe636f

src/lib/elm_widget.c

index 0a13312..4a1f669 100644 (file)
@@ -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;