From 7c5615e4b2890665ca632e24e493493dc807a602 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 3 Oct 2013 02:14:54 +0900 Subject: [PATCH] Check the highlighted object. Change-Id: I5bab9e1d6a7afc9dbdd53a3f9a6b864640ff46f5 --- 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 a6a9f60..d346ece 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