atspi : Add check for chain end object with attribute 21/149721/1
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 13 Sep 2017 03:04:42 +0000 (12:04 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Wed, 13 Sep 2017 03:04:42 +0000 (12:04 +0900)
   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: Ib6b21e833f35070ca10f7c863eff66482cbe4af0

src/lib/elm_atspi_bridge.c

index 4183fc8800075eae1c9a99f36d79a3debdb25172..762fa8f36e7cf8751e727761737611169f18848a 100644 (file)
@@ -4588,8 +4588,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))
      {