From 130eedf946ba02fd64800e923157fd415e30031c Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 3 Oct 2013 02:15:40 +0900 Subject: [PATCH] Check the highlighted object after hight action Change-Id: Ia110629ec59fed2494c2d72e07d56eb4822b6ecc --- packaging/liblivebox-edje.spec | 2 +- src/script_port.c | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packaging/liblivebox-edje.spec b/packaging/liblivebox-edje.spec index 6889b38..37c1d1a 100644 --- a/packaging/liblivebox-edje.spec +++ b/packaging/liblivebox-edje.spec @@ -1,6 +1,6 @@ Name: liblivebox-edje Summary: EDJE Script loader for the data provider master -Version: 0.5.17 +Version: 0.5.18 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/script_port.c b/src/script_port.c index 5fbe710..db2211c 100644 --- a/src/script_port.c +++ b/src/script_port.c @@ -974,6 +974,17 @@ static void edje_del_cb(void *_info, Evas *e, Evas_Object *obj, void *event_info free(obj_info); } +static inline Evas_Object *get_highlighted_object(Evas_Object *obj) +{ + Evas_Object *o, *ho; + + o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp"); + if (!o) return NULL; + + ho = evas_object_data_get(o, "_elm_access_target"); + return ho; +} + /*! LB_ACCESS_HIGHLIGHT 0 LB_ACCESS_HIGHLIGHT_NEXT 1 @@ -1013,7 +1024,18 @@ PUBLIC int script_feed_event(void *h, Evas *e, int event_type, int x, int y, int info.y = y; ret = elm_access_action(edje, action, &info); DbgPrint("ACCESS_HIGHLIGHT: %dx%d returns %d\n", x, y, ret); - ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE; + if (ret == EINA_TRUE) { + if (!get_highlighted_object(edje)) { + ErrPrint("Highlighted object is not found\n"); + ret = LB_ACCESS_STATUS_ERROR; + } else { + DbgPrint("Highlighted object is found\n"); + ret = LB_ACCESS_STATUS_DONE; + } + } else { + ErrPrint("Action error\n"); + ret = LB_ACCESS_STATUS_ERROR; + } } else if ((event_type & LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT) == LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT) { action = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT; info.highlight_cycle = EINA_FALSE; -- 2.7.4