atspi: Improves how to find the can_highlight of the widget. 80/153780/3
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 29 Sep 2017 11:55:32 +0000 (20:55 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 29 Sep 2017 12:17:32 +0000 (21:17 +0900)
   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: I3c7102ad12fe04488a1604e306f0699f1cb14691

src/lib/elm_widget.c

index c815a01b513679343b3233689c55132020efc62f..8c391671009fd78246cd9b4bd497a211b44f1bbb 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;