From f77bc6957c1a43af22ae269c57ea0b6914e222b8 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 20 Jun 2019 12:13:37 +0200 Subject: [PATCH] efl_input_pointer: rename tool to touch_id tool was not very helpfull, and additionally, the docuemtnation of it was completly wrong. After searching through the code where tool was actaully set (efl_ui_win.c) it turned out that it is actaully the "id" of the pointer when there are multiple touch events. ref T7963 Reviewed-by: Mike Blumenkrantz Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D9135 --- src/lib/ecore_evas/ecore_evas.c | 6 +- src/lib/efl/interfaces/efl_common_internal.h | 2 +- src/lib/efl/interfaces/efl_input_types.eot | 4 +- src/lib/elementary/efl_ui_win.c | 4 +- src/lib/elementary/efl_ui_win.eo | 2 +- src/lib/evas/canvas/efl_input_pointer.c | 18 +++--- src/lib/evas/canvas/efl_input_pointer.eo | 9 ++- src/lib/evas/canvas/evas_events.c | 62 +++++++++---------- src/lib/evas/canvas/evas_events_legacy.c | 14 ++--- .../evas/gesture/efl_canvas_gesture_manager.c | 2 +- src/tests/elementary/elm_test_win.c | 12 ++-- 11 files changed, 69 insertions(+), 66 deletions(-) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 599d7ec9e8..3e12ab5218 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -4819,7 +4819,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P if (info->double_click) ev->button_flags |= EFL_POINTER_FLAGS_DOUBLE_CLICK; if (info->triple_click) ev->button_flags |= EFL_POINTER_FLAGS_TRIPLE_CLICK; ev->timestamp = info->timestamp; - ev->tool = info->multi.device; + ev->touch_id = info->multi.device; _pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y); ev->radius = info->multi.radius; ev->radius_x = info->multi.radius_x; @@ -4880,7 +4880,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) ev->action = EFL_POINTER_ACTION_MOVE; ev->timestamp = info->timestamp; - ev->tool = info->multi.device; + ev->touch_id = info->multi.device; _pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y); ev->radius = info->multi.radius; @@ -4996,7 +4996,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) ev->action = EFL_POINTER_ACTION_AXIS; ev->timestamp = info->timestamp; - ev->tool = info->toolid; + ev->touch_id = info->toolid; // see also evas_events.c for (n = 0; n < info->naxis; n++) diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h index 11ca0cea07..f465c08f80 100644 --- a/src/lib/efl/interfaces/efl_common_internal.h +++ b/src/lib/efl/interfaces/efl_common_internal.h @@ -30,7 +30,7 @@ struct _Efl_Input_Pointer_Data unsigned int timestamp; /* FIXME: store as double? */ int button; unsigned int pressed_buttons; - int tool; /* finger or tool ID */ + int touch_id; /* finger or tool ID */ double radius, radius_x, radius_y; double pressure, distance, azimuth, tilt, twist; double angle; diff --git a/src/lib/efl/interfaces/efl_input_types.eot b/src/lib/efl/interfaces/efl_input_types.eot index eb5f8edeb7..61f3ee922d 100644 --- a/src/lib/efl/interfaces/efl_input_types.eot +++ b/src/lib/efl/interfaces/efl_input_types.eot @@ -85,8 +85,8 @@ enum @beta Efl.Input.Value { Prefer the method $button to read this value. Default: 0.]] buttons_pressed, [[32-bit bit mask (unsigned int). Prefer the method $buttons_pressed to read this value. Default: 0.]] - tool, [[ID of the finger or tool (eg. pen) that triggered this event. - Prefer the property $tool to read this value. Default: 0.]] + touch_id, [[ID of the finger or tool (eg. pen) that triggered this event. + Prefer the property $touch_id to read this value. Default: 0.]] x, [[Absolute X position where this event occurred, in pixels. Relative to the window. Default: last known position. This value may be smoothed out or even extrapolated by EFL.]] diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 2e24a00b99..508083098b 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -2658,8 +2658,8 @@ _efl_ui_win_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd, ptr = efl_input_pointer_instance_get( (Eo *) obj, (void **) &ptrdata); if (!ptrdata) break; - ptrdata->tool = evas_touch_point_list_nth_id_get(sd->evas, i); - _efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOOL); + ptrdata->touch_id = evas_touch_point_list_nth_id_get(sd->evas, i); + _efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOUCH_ID); // Note that "still" maps to "down" here. state = evas_touch_point_list_nth_state_get(sd->evas, i); diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 1a3e3a4db3..315770daf1 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -734,7 +734,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W an object of type @Efl.Input.Pointer. Each finger in a multi touch environment can then be identified - by the @Efl.Input.Pointer.tool property. The order of the pointers + by the @Efl.Input.Pointer.touch_id property. The order of the pointers in this iterator is not defined. Note: If the input surface supports hovering input, some pointers diff --git a/src/lib/evas/canvas/efl_input_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c index 6c24f88c2c..8b16c5767a 100644 --- a/src/lib/evas/canvas/efl_input_pointer.c +++ b/src/lib/evas/canvas/efl_input_pointer.c @@ -316,16 +316,16 @@ _efl_input_pointer_wheel_delta_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_ } EOLIAN static int -_efl_input_pointer_tool_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) +_efl_input_pointer_touch_id_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { - return pd->tool; + return pd->touch_id; } EOLIAN static void -_efl_input_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int id) +_efl_input_pointer_touch_id_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int id) { - _efl_input_value_mark(pd, EFL_INPUT_VALUE_TOOL); - pd->tool = id; + _efl_input_value_mark(pd, EFL_INPUT_VALUE_TOUCH_ID); + pd->touch_id = id; } EOLIAN static Eina_Bool @@ -438,8 +438,8 @@ _efl_input_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Ef pd->pressed_buttons = (int) val; break; - case EFL_INPUT_VALUE_TOOL: - pd->tool = (int) val; + case EFL_INPUT_VALUE_TOUCH_ID: + pd->touch_id = (int) val; break; case EFL_INPUT_VALUE_X: @@ -531,8 +531,8 @@ _efl_input_pointer_value_get(const Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data * case EFL_INPUT_VALUE_BUTTONS_PRESSED: return (double) pd->pressed_buttons; - case EFL_INPUT_VALUE_TOOL: - return (double) pd->tool; + case EFL_INPUT_VALUE_TOUCH_ID: + return (double) pd->touch_id; case EFL_INPUT_VALUE_X: return pd->cur.x; diff --git a/src/lib/evas/canvas/efl_input_pointer.eo b/src/lib/evas/canvas/efl_input_pointer.eo index 852c3b143c..f50b511d20 100644 --- a/src/lib/evas/canvas/efl_input_pointer.eo +++ b/src/lib/evas/canvas/efl_input_pointer.eo @@ -102,10 +102,13 @@ class @beta Efl.Input.Pointer extends Efl.Object implements Efl.Input.Event, Efl pos: Eina.Position2D; [[The position of the event, in pixels.]] } } - @property tool { - [[ID of the tool (eg. pen) that triggered this event.]] + @property touch_id { + [[TThe ID associated with this pointer. + + In case there are multiple pointers (for example when multiple fingers are touching the screen) this number uniquely identifies each pointer, for as long as it is present. This is, when a finger is lifted its ID can be later reused by another finger touching the screen. + ]] values { - id: int; [[Tool ID]] + id: int; [[An ID uniquely identifying this pointer among the currently present pointers.]] } } @property source { diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 9dfa24ca39..8ab6bf4cd4 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -476,7 +476,7 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, _transform_to_src_space_f(obj, src, &ev->cur); point = ev->cur; ev->source = eo_obj; - ev->tool = 0; + ev->touch_id = 0; EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child) { @@ -626,7 +626,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, curpt = ev->cur; prevpt = ev->prev; ev->source = eo_obj; - ev->tool = 0; + ev->touch_id = 0; if (pdata->seat->mouse_grabbed) { @@ -663,7 +663,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, else outs = eina_list_append(outs, eo_child); if (e->delete_me || e->is_frozen) break; - //FIXME: take care nograb object + //FIXME: take care nograb object } eina_list_free(copy); @@ -836,7 +836,7 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, _transform_to_src_space_f(obj, src, &ev->cur); point = ev->cur; ev->source = eo_obj; - ev->tool = 0; + ev->touch_id = 0; copy = evas_event_list_copy(src->proxy->src_event_in); EINA_LIST_FOREACH(copy, l, eo_child) @@ -1400,7 +1400,7 @@ evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y) Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); if ((!e->layers) || (e->is_frozen)) return NULL; - D("------------------------------GET EVETNS AT ............... %i %i\n", x, y); + D("------------------------------GET EVETNS AT ............... %i %i\n", x, y); return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y); } @@ -1515,7 +1515,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL) | + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTON); if (!e || !ev) return; @@ -1544,7 +1544,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da ev->modifiers = &(e->modifiers); ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; - ev->tool = 0; + ev->touch_id = 0; ev->action = EFL_POINTER_ACTION_DOWN; ev->value_flags |= value_flags; if (ev->device) efl_ref(ev->device); @@ -1763,7 +1763,7 @@ _canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL) | + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTON); if (!e || !ev) return; @@ -1793,7 +1793,7 @@ _canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data ev->modifiers = &(e->modifiers); ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; - ev->tool = 0; + ev->touch_id = 0; ev->value_flags |= value_flags; if (ev->device) efl_ref(ev->device); @@ -1935,7 +1935,7 @@ _canvas_event_feed_mouse_cancel_internal(Evas_Public_Data *e, Efl_Input_Pointer_ _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; if (e->is_frozen) return; @@ -1966,7 +1966,7 @@ _canvas_event_feed_mouse_cancel_internal(Evas_Public_Data *e, Efl_Input_Pointer_ (point->state == EVAS_TOUCH_POINT_MOVE) || (point->state == EVAS_TOUCH_POINT_STILL)) { - ev->tool = point->id; + ev->touch_id = point->id; ev->cur.x = point->x; ev->cur.y = point->y; ev->prev = ev->cur; @@ -2117,7 +2117,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _efl_input_value_mask(EFL_INPUT_VALUE_DX) | _efl_input_value_mask(EFL_INPUT_VALUE_DY) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTONS_PRESSED) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; if (e->is_frozen) return; @@ -2165,7 +2165,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; ev->pressed_buttons = pdata->button; - ev->tool = 0; + ev->touch_id = 0; ev->value_flags |= value_flags; if (ev->device) efl_ref(ev->device); @@ -2565,7 +2565,7 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev) _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTONS_PRESSED) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -2668,7 +2668,7 @@ _canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev) _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTONS_PRESSED) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -2797,7 +2797,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL) | + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID) | _efl_input_value_mask(EFL_INPUT_VALUE_BUTTON); if (!e || !ev) return; @@ -2807,7 +2807,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da if (!pdata) return; eo_e = e->evas; DBG("ButtonEvent:multi down time=%u x=%.1f y=%.1f button=%d downs=%d", - ev->timestamp, ev->cur.x, ev->cur.y, ev->tool, pdata->seat->downs); + ev->timestamp, ev->cur.x, ev->cur.y, ev->touch_id, pdata->seat->downs); pdata->seat->downs++; if (e->is_frozen) return; e->last_timestamp = ev->timestamp; @@ -2825,7 +2825,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_walk(e); /* append new touch point to the touch point list */ - _evas_touch_point_append(eo_e, ev->tool, ev->cur.x, ev->cur.y); + _evas_touch_point_append(eo_e, ev->touch_id, ev->cur.x, ev->cur.y); if (pdata->seat->mouse_grabbed == 0) { if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1; @@ -2869,7 +2869,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_post_event_callback_call(eo_e, e, event_id); /* update touch point's state to EVAS_TOUCH_POINT_STILL */ - _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_STILL); + _evas_touch_point_update(eo_e, ev->touch_id, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_STILL); _evas_unwalk(e); if (ev->device) efl_unref(ev->device); @@ -2890,7 +2890,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -2899,7 +2899,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data if (!pdata) return; eo_e = e->evas; DBG("ButtonEvent:multi up time=%u x=%.1f y=%.1f device=%d downs=%d", - ev->timestamp, ev->cur.x, ev->cur.y, ev->tool, pdata->seat->downs); + ev->timestamp, ev->cur.x, ev->cur.y, ev->touch_id, pdata->seat->downs); if (pdata->seat->downs <= 0) return; pdata->seat->downs--; if (e->is_frozen) return; @@ -2918,7 +2918,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data _evas_walk(e); /* update released touch point */ - _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_UP); + _evas_touch_point_update(eo_e, ev->touch_id, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_UP); copy = evas_event_list_copy(pdata->seat->object.in); EINA_LIST_FOREACH(copy, l, eo_obj) { @@ -2954,7 +2954,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data } /* remove released touch point from the touch point list */ - _evas_touch_point_remove(eo_e, ev->tool); + _evas_touch_point_remove(eo_e, ev->touch_id); _evas_unwalk(e); if (ev->device) efl_unref(ev->device); @@ -2981,7 +2981,7 @@ _canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e, if (EINA_DBL_EQ(fy, 0.0)) fy = y; ev->action = action; - ev->tool = d; + ev->touch_id = d; ev->cur.x = fx; ev->cur.y = fy; ev->pressure = pres; @@ -3071,7 +3071,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _efl_input_value_mask(EFL_INPUT_VALUE_TIMESTAMP) | _efl_input_value_mask(EFL_INPUT_VALUE_X) | _efl_input_value_mask(EFL_INPUT_VALUE_Y) | - _efl_input_value_mask(EFL_INPUT_VALUE_TOOL); + _efl_input_value_mask(EFL_INPUT_VALUE_TOUCH_ID); if (!e || !ev) return; EVAS_EVENT_FEED_SAFETY_CHECK(e); @@ -3098,7 +3098,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_walk(e); /* update moved touch point */ - _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_MOVE); + _evas_touch_point_update(eo_e, ev->touch_id, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_MOVE); /* if our mouse button is grabbed to any objects */ if (pdata->seat->mouse_grabbed > 0) { @@ -3631,7 +3631,7 @@ evas_event_feed_axis_update(Evas *eo_e, unsigned int timestamp, int device, int ev->data = (void *) data; ev->timestamp = timestamp; ev->action = EFL_POINTER_ACTION_AXIS; - ev->tool = toolid; + ev->touch_id = toolid; // see also ecore_evas.c for (n = 0; n < naxis; n++) @@ -3978,7 +3978,7 @@ _efl_canvas_object_efl_canvas_pointer_pointer_inside_get(const Eo *eo_obj, if (!obj->is_smart) return obj_pdata->mouse_in; - /* This is to keep the legacy APIs evas_object_pointer_inside_by_device_get() & + /* This is to keep the legacy APIs evas_object_pointer_inside_by_device_get() & * evas_object_pointer_inside_get() old behaviour. */ if (obj->is_pointer_inside_legacy) return EINA_FALSE; @@ -4130,21 +4130,21 @@ _evas_canvas_event_pointer_cb(void *data, const Efl_Event *event) switch (ev->action) { case EFL_POINTER_ACTION_MOVE: - if (ev->tool == 0) + if (ev->touch_id == 0) _canvas_event_feed_mouse_move_internal(e, ev); else _canvas_event_feed_multi_move_internal(e, ev); break; case EFL_POINTER_ACTION_DOWN: - if (ev->tool == 0) + if (ev->touch_id == 0) _canvas_event_feed_mouse_down_internal(e, ev); else _canvas_event_feed_multi_down_internal(e, ev); break; case EFL_POINTER_ACTION_UP: - if (ev->tool == 0) + if (ev->touch_id == 0) _canvas_event_feed_mouse_up_internal(e, ev); else _canvas_event_feed_multi_up_internal(e, ev); diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c index 37059068c7..4675735727 100644 --- a/src/lib/evas/canvas/evas_events_legacy.c +++ b/src/lib/evas/canvas/evas_events_legacy.c @@ -89,7 +89,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal } case EFL_POINTER_ACTION_DOWN: - if (ev->tool == 0) + if (ev->touch_id == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_DOWN) @@ -116,7 +116,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal { TYPE_CHK(MULTI_DOWN); Evas_Event_Multi_Down *e = _event_alloc(ev->legacy); - e->device = ev->tool; + e->device = ev->touch_id; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; @@ -140,7 +140,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal } case EFL_POINTER_ACTION_UP: - if (ev->tool == 0) + if (ev->touch_id == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_UP) @@ -167,7 +167,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal { TYPE_CHK(MULTI_UP); Evas_Event_Multi_Up *e = _event_alloc(ev->legacy); - e->device = ev->tool; + e->device = ev->touch_id; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; @@ -191,7 +191,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal } case EFL_POINTER_ACTION_MOVE: - if (ev->tool == 0) + if (ev->touch_id == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_MOVE) @@ -220,7 +220,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal { TYPE_CHK(MULTI_MOVE); Evas_Event_Multi_Move *e = _event_alloc(ev->legacy); - e->device = ev->tool; + e->device = ev->touch_id; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; @@ -274,7 +274,7 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal e->dev = ev->device; /* FIXME: Get device id from above device object. 0 for now. */ e->device = 0; - e->toolid = ev->tool; + e->toolid = ev->touch_id; e->axis = malloc(sizeof(Evas_Axis) * 11); e->axis[e->naxis].label = EVAS_AXIS_LABEL_WINDOW_X; e->axis[e->naxis].value = ev->cur.x; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index 4fbb4d49ee..fb934c6df1 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -180,7 +180,7 @@ _efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event) eina_hash_add(pd->m_object_events, &gesture_type, touch_event); } - efl_gesture_touch_point_record(touch_event, pointer_data->tool, pointer_data->cur, + efl_gesture_touch_point_record(touch_event, pointer_data->touch_id, pointer_data->cur, pointer_data->timestamp, pointer_data->action); //This is for handling the case that mouse event pairs dont match. diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index bf98148534..dc335bff68 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -283,7 +283,7 @@ _inputs_timer1_cb(void *data) { ptr = efl_add(EFL_INPUT_POINTER_CLASS, win); efl_input_pointer_position_set(ptr, points[0][i]); - efl_input_pointer_tool_set(ptr, i); + efl_input_pointer_touch_id_set(ptr, i); efl_input_pointer_button_set(ptr, 1); if (i == 0) @@ -323,12 +323,12 @@ _inputs_timer2_cb(void *data) fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_X)); fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_Y)); - fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_TOOL)); + fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_TOUCH_ID)); fail_if(efl_input_pointer_action_get(ptr) != EFL_POINTER_ACTION_DOWN); x = efl_input_pointer_value_get(ptr, EFL_INPUT_VALUE_X); y = efl_input_pointer_value_get(ptr, EFL_INPUT_VALUE_Y); - tool = efl_input_pointer_tool_get(ptr); + tool = efl_input_pointer_touch_id_get(ptr); for (i = 0; i < 4; i++) if (tool == i) @@ -350,7 +350,7 @@ _inputs_timer2_cb(void *data) { ptr = efl_add(EFL_INPUT_POINTER_CLASS, win); efl_input_pointer_position_set(ptr, points[1][i]); - efl_input_pointer_tool_set(ptr, i); + efl_input_pointer_touch_id_set(ptr, i); efl_input_pointer_button_set(ptr, 1); /* move first */ @@ -386,12 +386,12 @@ _inputs_timer3_cb(void *data) fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_X)); fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_Y)); - fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_TOOL)); + fail_if(!efl_input_pointer_value_has_get(ptr, EFL_INPUT_VALUE_TOUCH_ID)); fail_if(efl_input_pointer_action_get(ptr) != EFL_POINTER_ACTION_MOVE); x = efl_input_pointer_value_get(ptr, EFL_INPUT_VALUE_X); y = efl_input_pointer_value_get(ptr, EFL_INPUT_VALUE_Y); - tool = efl_input_pointer_tool_get(ptr); + tool = efl_input_pointer_touch_id_get(ptr); for (i = 0; i < 4; i++) if (tool == i)