Update event type (use the integer value instead of double)
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 9 Dec 2013 12:01:04 +0000 (21:01 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 9 Dec 2013 12:01:04 +0000 (21:01 +0900)
Change-Id: I5d6fd49254520c8b6b5bbf4032e1e0bd284f11f1

include/livebox.h
src/virtual_window.c

index c1bb17c..91ef157 100644 (file)
@@ -416,8 +416,8 @@ struct buffer_event_data {
 
        union input_data {
                struct mouse {
-                       double x;
-                       double y;
+                       int x;
+                       int y;
                } pointer;
 
                unsigned int keycode;
index d069963..ea9062d 100644 (file)
@@ -50,8 +50,6 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
        Elm_Access_Action_Info action_info;
        Elm_Access_Action_Type action_type;
        int ret = 0;
-       int width;
-       int height;
        Evas_Object *parent_elm;
        const char *key_name;
        const char *key_string;
@@ -76,22 +74,20 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
                break;
        case BUFFER_EVENT_DOWN:
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                /*!
                 * \note
                 * Calculate the event occurred X & Y on the buffer
                 */
                evas_event_feed_mouse_in(info->e, (event_info->timestamp - 0.002f) * 1000, NULL);
-               evas_event_feed_mouse_move(info->e, width * event_info->info.pointer.x, height * event_info->info.pointer.y, (event_info->timestamp - 0.001f) * 1000, NULL); /* + 0.1f just for fake event */
+               evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, (event_info->timestamp - 0.001f) * 1000, NULL); /* + 0.1f just for fake event */
                evas_event_feed_mouse_down(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL); /* + 0.2f just for fake event */
                break;
        case BUFFER_EVENT_MOVE:
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                /*!
                 * \note
                 * Calculate the event occurred X & Y on the buffer
                 */
-               evas_event_feed_mouse_move(info->e, width * event_info->info.pointer.x, height * event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+               evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
                break;
        case BUFFER_EVENT_UP:
                evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL);
@@ -103,15 +99,14 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        ret = LB_ACCESS_STATUS_ERROR;
                        break;
                }
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                memset(&action_info, 0, sizeof(action_info));
                action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
                /*!
                 * \note
                 * Calculate the event occurred X & Y on the buffer
                 */
-               action_info.x = width * event_info->info.pointer.x;
-               action_info.y = height * event_info->info.pointer.y;
+               action_info.x = event_info->info.pointer.x;
+               action_info.y = event_info->info.pointer.y;
                ret = elm_access_action(parent_elm, action_type, &action_info);
                if (ret == EINA_TRUE) {
                        if (!get_highlighted_object(parent_elm)) {
@@ -189,11 +184,10 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        ret = LB_ACCESS_STATUS_ERROR;
                        break;
                }
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                memset(&action_info, 0, sizeof(action_info));
                action_type = ELM_ACCESS_ACTION_SCROLL;
-               action_info.x = width * event_info->info.pointer.x;
-               action_info.y = height * event_info->info.pointer.y;
+               action_info.x = event_info->info.pointer.x;
+               action_info.y = event_info->info.pointer.y;
                action_info.mouse_type = 2;
                ret = elm_access_action(parent_elm, action_type, &action_info);
                ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
@@ -204,11 +198,10 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        ret = LB_ACCESS_STATUS_ERROR;
                        break;
                }
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                memset(&action_info, 0, sizeof(action_info));
                action_type = ELM_ACCESS_ACTION_SCROLL;
-               action_info.x = width * event_info->info.pointer.x;
-               action_info.y = height * event_info->info.pointer.y;
+               action_info.x = event_info->info.pointer.x;
+               action_info.y = event_info->info.pointer.y;
                action_info.mouse_type = 1;
                ret = elm_access_action(parent_elm, action_type, &action_info);
                ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
@@ -219,11 +212,10 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        ret = LB_ACCESS_STATUS_ERROR;
                        break;
                }
-               ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
                memset(&action_info, 0, sizeof(action_info));
                action_type = ELM_ACCESS_ACTION_SCROLL;
-               action_info.x = width * event_info->info.pointer.x;
-               action_info.y = height * event_info->info.pointer.y;
+               action_info.x = event_info->info.pointer.x;
+               action_info.y = event_info->info.pointer.y;
                action_info.mouse_type = 0;
                ret = elm_access_action(parent_elm, action_type, &action_info);
                ret = (ret == EINA_FALSE) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;