Update highlight event handler.
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 2 Oct 2013 17:10:04 +0000 (02:10 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 2 Oct 2013 17:10:04 +0000 (02:10 +0900)
Change-Id: Id680aa06d3126d21e244131f4b2f473586966a0f

src/virtual_window.c

index 898c80d..aad25e1 100644 (file)
@@ -25,6 +25,17 @@ struct info {
        int is_hw; /*!< 1 if a buffer is created on the H/W accelerated place or 0 */
 };
 
+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;
+}
+
 /*!
  * \note
  * Every user event (mouse) on the buffer will be passed via this event callback
@@ -91,7 +102,18 @@ static int event_handler_cb(struct livebox_buffer *handler, enum buffer_event ev
                action_info.x = ix;
                action_info.y = iy;
                ret = elm_access_action(parent_elm, action_type, &action_info);
-               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;
+               }
                break;
        case BUFFER_EVENT_HIGHLIGHT_NEXT:
                if (!parent_elm) {