atspi : Add check for chain end object with attribute 69/154969/2
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 13 Sep 2017 03:04:42 +0000 (12:04 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 13 Oct 2017 05:02:57 +0000 (05:02 +0000)
   When searching for a neighbor object,
   check whether there is an "relation_chain_end" attribute.
   If it does, it returns the current object.

Change-Id: If84cd1fd0176e16b7a5ac79f60411491cc15c952

src/lib/elm_atspi_bridge.c

index 821a50c90d6b8af6ddfe721c2a9906db34b8d221..00ab38e7f142aca3715e12e5e09628facf2af05e 100644 (file)
@@ -4652,8 +4652,32 @@ _deputy_of_proxy_in_parent_get(Eo *obj)
    return deputy;
 }
 
+static Eina_Bool
+_check_chain_end_with_attribute(Eo *obj, unsigned char forward)
+{
+   Eina_List *attrs, *l;
+   Elm_Atspi_Attribute *attr;
+   eo_do(obj, attrs = elm_interface_atspi_accessible_attributes_get());
+   if (!attrs)
+     return EINA_FALSE;
+   EINA_LIST_FOREACH(attrs, l, attr)
+     {
+        if (!strcmp(attr->key, "relation_chain_end"))
+          {
+             if (((!strcmp(attr->value, "prev,end")) && forward == 0) || ((!strcmp(attr->value, "next,end")) && forward == 1) || (!strcmp(attr->value, "prev,next,end")))
+               {
+                  elm_atspi_attributes_list_free(attrs);
+                  return EINA_TRUE;
+               }
+          }
+     }
+   elm_atspi_attributes_list_free(attrs);
+   return EINA_FALSE;
+}
+
 static void *_calculate_neighbor_impl(accessibility_navigation_pointer_table *table, void *root, void *start, unsigned char forward, GetNeighborSearchMode search_mode)
 {
+   if (start && _check_chain_end_with_attribute(start, forward)) return start;
    if (root && _object_is_defunct(table, root)) return NULL;
    if (start && _object_is_defunct(table, start))
      {