Try to update focus chain.
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 10 Dec 2013 04:53:13 +0000 (13:53 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 10 Dec 2013 04:53:13 +0000 (13:53 +0900)
Even if the AO is exists, the focus chain misses it.
So I checked the focus chain and if it doesn't has AO, add it.

Change-Id: I052400d1b7eed58fd958d735695e0d0408e98abe

src/script_port.c

index 335b8af..97b8be9 100644 (file)
@@ -239,6 +239,17 @@ static void access_del_cb(void *_info, Evas *e, Evas_Object *ao, void *event_inf
        DbgPrint("AO(%p) is removed from local access chain\n", ao);
 }
 
+static void update_focus_chain(struct info *handle, Evas_Object *ao)
+{
+       const Eina_List *list;
+
+       list = elm_object_focus_custom_chain_get(handle->parent);
+       if (!eina_list_data_find(list, ao)) {
+               DbgPrint("Append again to the focus chain\n");
+               elm_object_focus_custom_chain_append(handle->parent, ao, NULL);
+       }
+}
+
 PUBLIC int script_update_text(void *h, Evas *e, const char *id, const char *part, const char *text)
 {
        struct obj_info *obj_info;
@@ -314,6 +325,8 @@ PUBLIC int script_update_text(void *h, Evas *e, const char *id, const char *part
 
                elm_access_info_set(ao, ELM_ACCESS_INFO, utf8);
                free(utf8);
+
+               update_focus_chain(handle, ao);
        } else {
                ErrPrint("Unable to get text part[%s]\n", part);
        }
@@ -573,6 +586,7 @@ PUBLIC int script_update_access(void *_h, Evas *e, const char *id, const char *p
                        if (text && strlen(text)) {
                                elm_access_info_set(ao, ELM_ACCESS_INFO, text);
                                DbgPrint("Access info is updated: %s [%s], %p\n", part, text, ao);
+                               update_focus_chain(handle, ao);
                        } else {
                                /*!
                                 * \note
@@ -684,6 +698,7 @@ PUBLIC int script_operate_access(void *_h, Evas *e, const char *id, const char *
                        ErrPrint("Action error\n");
                }
        } else if (!strcasecmp(operation, "reset,focus")) {
+               DbgPrint("Reset Focus\n");
                elm_object_focus_custom_chain_set(edje, NULL);
        }