jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8938d8d557393b009d4db1058bcc3e342a1a9008
commit 8938d8d557393b009d4db1058bcc3e342a1a9008 Author: Jean-Philippe Andre <[email protected]> Date: Tue Aug 23 18:12:10 2016 +0900 evas events: Rename properties and introduce generic value This paves the way to a merge of pointer and axis events into the class Efl.Event.Pointer. --- src/lib/ecore_evas/ecore_evas.c | 4 +- src/lib/efl/interfaces/efl_common_internal.h | 3 +- src/lib/efl/interfaces/efl_event_types.eot | 54 ++++++ src/lib/evas/canvas/efl_event_pointer.c | 252 +++++++++++++++++++++------ src/lib/evas/canvas/efl_event_pointer.eo | 102 +++++++---- src/lib/evas/canvas/evas_events.c | 34 ++-- src/lib/evas/canvas/evas_events_legacy.c | 12 +- 7 files changed, 351 insertions(+), 110 deletions(-) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 7d491ca..3ae9c92 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -4376,7 +4376,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->finger = info->multi.device; + ev->tool = 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; @@ -4433,7 +4433,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->finger = info->multi.device; + ev->tool = info->multi.device; _pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y); ev->radius = info->multi.radius; diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h index 5063fe8..83fb3c2 100644 --- a/src/lib/efl/interfaces/efl_common_internal.h +++ b/src/lib/efl/interfaces/efl_common_internal.h @@ -29,7 +29,7 @@ struct _Efl_Event_Pointer_Data unsigned int timestamp; /* FIXME: store as double? */ int button; unsigned int pressed_buttons; - int finger; + int tool; /* finger or tool ID */ double radius, radius_x, radius_y; double pressure; double angle; @@ -49,6 +49,7 @@ struct _Efl_Event_Pointer_Data Evas_Modifier *modifiers; Evas_Lock *locks; void *legacy; /* DO NOT TOUCH THIS */ + uint32_t value_flags; Eina_Bool evas_done : 1; /* set by evas */ Eina_Bool fake : 1; Eina_Bool win_fed : 1; diff --git a/src/lib/efl/interfaces/efl_event_types.eot b/src/lib/efl/interfaces/efl_event_types.eot index 2cb1fa7..93aadb8 100644 --- a/src/lib/efl/interfaces/efl_event_types.eot +++ b/src/lib/efl/interfaces/efl_event_types.eot @@ -65,3 +65,57 @@ enum Efl.Event.Object_Pointer_Mode { @since 1.2 ]] } + +enum Efl.Input.Value { + [[Keys for the generic values of all events. + + @since 1.19 + ]] + none, [[Not a valid value type.]] + timestamp, [[Timestamp of this event in seconds.]] + button, [[ID of the button that triggered this event (unsigned int). + 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.]] + x, [[Absolute X position where this event occurred, in pixels. + Relative to the window. Default: last known position.]] + y, [[Absolute Y position where this event occurred, in pixels. + Relative to the window. Default: last known position.]] + dx, [[Relative X movement, in pixels. Range: unbounded. Default: 0.]] + dy, [[Relative Y movement, in pixels. Range: unbounded. Default: 0.]] + previous_x, [[Previous X position of the pointer, in pixels. + Default: last known position, may be equal to x.]] + previous_y, [[Previous Y position of the pointer, in pixels. + Default: last known position, may be equal to y.]] + radius, [[Average radius of the pressed area under a finger or tool, + in pixels. Default is 1.]] + radius_x, [[Spread over X of the pressed area under a finger or tool, + in pixels. Default is 1.]] + radius_y, [[Spread over Y of the pressed area under a finger or tool, + in pixels. Default is 1.]] + pressure, [[Pressure applied to the button, touch or pen tip. + Range: [0, 1]. Default is 1.]] + distance, [[Relative distance along physical Z axis. Range: [0, 1]. + Default is 0.]] + azimuth, [[Angle of tool about the Z axis from positive X axis. + Range: [-PI, PI]. Unit: Radians.]] + tilt, [[Angle of tool about plane of sensor from positive Z axis. + Range: [0.0, PI]. Unit: Radians.]] + tilt_x, [[Current tilt along the X axis of the tablet's current logical + orientation, in radians off the tablet's Z axis. + Range: [-PI, PI]. Unit: Radians.]] + tilt_y, [[Current tilt along the Y axis of the tablet's current logical + orientation, in radians off the tablet's Z axis. + Range: [-PI, PI]. Unit: Radians.]] + twist, [[Rotation of tool about its major axis from its "natural" + position. Range: [-PI, PI] Unit: Radians.]] + wheel_delta, [[Delta movement of the wheel in discrete steps (int). + Default: 0.]] + wheel_angle, [[Delta movement of the wheel in radians. Default: 0.]] + wheel_direction, [[Direction of the wheel (horizontal = 1 or vertical = 0). + Default: 0. Prefer the property $wheel_direction to read.]] + slider, [[Current position of the slider on the tool. Range: [-1, 1]. + Default: 0.]] +} diff --git a/src/lib/evas/canvas/efl_event_pointer.c b/src/lib/evas/canvas/efl_event_pointer.c index 69881dd..019eb83 100644 --- a/src/lib/evas/canvas/efl_event_pointer.c +++ b/src/lib/evas/canvas/efl_event_pointer.c @@ -190,20 +190,6 @@ _efl_event_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, } EOLIAN static void -_efl_event_pointer_position_precise_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double x, double y) -{ - pd->cur.x = x; - pd->cur.y = y; -} - -EOLIAN static void -_efl_event_pointer_position_precise_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double *x, double *y) -{ - if (x) *x = pd->cur.x; - if (y) *y = pd->cur.y; -} - -EOLIAN static void _efl_event_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int x, int y) { pd->prev.x = (double) x; @@ -218,17 +204,11 @@ _efl_event_pointer_previous_position_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_ } EOLIAN static void -_efl_event_pointer_previous_position_precise_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double x, double y) -{ - pd->prev.x = x; - pd->prev.y = y; -} - -EOLIAN static void -_efl_event_pointer_previous_position_precise_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double *x, double *y) +_efl_event_pointer_delta_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int *dx, int *dy) { - if (x) *x = pd->prev.x; - if (y) *y = pd->prev.y; + // Using (int) twice to return the same as previous_position - position + if (dx) *dx = (int) pd->prev.x - (int) pd->cur.x; + if (dy) *dy = (int) pd->prev.y - (int) pd->cur.y; } EOLIAN static void @@ -306,47 +286,27 @@ _efl_event_pointer_wheel_direction_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Da } EOLIAN static void -_efl_event_pointer_wheel_distance_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int dist) +_efl_event_pointer_wheel_delta_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int dist) { pd->wheel.z = dist; } EOLIAN static int -_efl_event_pointer_wheel_distance_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_event_pointer_wheel_delta_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) { return pd->wheel.z; } EOLIAN static int -_efl_event_pointer_finger_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) -{ - return pd->finger; -} - -EOLIAN static void -_efl_event_pointer_finger_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int id) +_efl_event_pointer_tool_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) { - pd->finger = id; + return pd->tool; } EOLIAN static void -_efl_event_pointer_touch_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double *r, double *rx, double *ry, double *press, double *angle) +_efl_event_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int id) { - if (r) *r = pd->radius; - if (rx) *rx = pd->radius_x; - if (ry) *ry = pd->radius_y; - if (press) *press = pd->pressure; - if (angle) *angle = pd->angle; -} - -EOLIAN static void -_efl_event_pointer_touch_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double r, double rx, double ry, double press, double angle) -{ - pd->radius = r; - pd->radius_x = rx; - pd->radius_y = ry; - pd->pressure = press; - pd->angle = angle; + pd->tool = id; } EOLIAN static Eina_Bool @@ -400,4 +360,196 @@ _efl_event_pointer_efl_event_input_fake_get(Eo *obj EINA_UNUSED, Efl_Event_Point return pd->fake; } +EOLIAN static Eina_Bool +_efl_event_pointer_value_has_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +{ + // read-only + if ((key <= EFL_INPUT_VALUE_NONE) || (key > EFL_INPUT_VALUE_SLIDER)) + return EINA_FALSE; + return (pd->value_flags & (1 << (int) key)) != 0; +} + +EOLIAN static Eina_Bool +_efl_event_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key, double val) +{ + if ((key <= EFL_INPUT_VALUE_NONE) || (key > EFL_INPUT_VALUE_SLIDER)) + return EINA_FALSE; + + // note: not a fan of setting ints based on a double... + switch (key) + { + case EFL_INPUT_VALUE_TIMESTAMP: + pd->timestamp = (unsigned int) (val * 1000.0); + break; + + case EFL_INPUT_VALUE_BUTTON: + pd->button = (int) val; + break; + + case EFL_INPUT_VALUE_BUTTONS_PRESSED: + pd->pressed_buttons = (int) val; + break; + + case EFL_INPUT_VALUE_TOOL: + pd->tool = (int) val; + break; + + case EFL_INPUT_VALUE_X: + pd->cur.x = val; + break; + + case EFL_INPUT_VALUE_Y: + pd->cur.y = val; + break; + + case EFL_INPUT_VALUE_DX: + case EFL_INPUT_VALUE_DY: + return EINA_FALSE; + + case EFL_INPUT_VALUE_PREVIOUS_X: + pd->prev.x = val; + break; + + case EFL_INPUT_VALUE_PREVIOUS_Y: + pd->prev.y = val; + break; + + case EFL_INPUT_VALUE_RADIUS: + pd->radius = val; + break; + + case EFL_INPUT_VALUE_RADIUS_X: + pd->radius_x = val; + break; + + case EFL_INPUT_VALUE_RADIUS_Y: + pd->radius_y = val; + break; + + case EFL_INPUT_VALUE_PRESSURE: + return pd->pressure; + + case EFL_INPUT_VALUE_DISTANCE: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_AZIMUTH: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_TILT: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_TILT_X: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_TILT_Y: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_TWIST: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_WHEEL_DELTA: + pd->wheel.z = (int) val; + break; + + case EFL_INPUT_VALUE_WHEEL_ANGLE: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_WHEEL_DIRECTION: + pd->wheel.dir = val ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL; + break; + + case EFL_INPUT_VALUE_SLIDER: + return EINA_FALSE; // TODO + + case EFL_INPUT_VALUE_NONE: + default: + return EINA_FALSE; + } + + return EINA_TRUE; +} + +EOLIAN static double +_efl_event_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +{ + switch (key) + { + case EFL_INPUT_VALUE_TIMESTAMP: + return (double) pd->timestamp / 1000.0; + + case EFL_INPUT_VALUE_BUTTON: + return (double) pd->button; + + case EFL_INPUT_VALUE_BUTTONS_PRESSED: + return (double) pd->pressed_buttons; + + case EFL_INPUT_VALUE_TOOL: + return (double) pd->tool; + + case EFL_INPUT_VALUE_X: + return pd->cur.x; + + case EFL_INPUT_VALUE_Y: + return pd->cur.y; + + case EFL_INPUT_VALUE_DX: + return pd->cur.x - pd->prev.x; + + case EFL_INPUT_VALUE_DY: + return pd->cur.y - pd->prev.y; + + case EFL_INPUT_VALUE_PREVIOUS_X: + return pd->prev.x; + + case EFL_INPUT_VALUE_PREVIOUS_Y: + return pd->prev.y; + + case EFL_INPUT_VALUE_RADIUS: + return pd->radius; + + case EFL_INPUT_VALUE_RADIUS_X: + return pd->radius_x; + + case EFL_INPUT_VALUE_RADIUS_Y: + return pd->radius_y; + + case EFL_INPUT_VALUE_PRESSURE: + return pd->pressure; + + case EFL_INPUT_VALUE_DISTANCE: + return 0.0; // TODO + + case EFL_INPUT_VALUE_AZIMUTH: + return 0.0; // TODO + + case EFL_INPUT_VALUE_TILT: + return 0.0; // TODO + + case EFL_INPUT_VALUE_TILT_X: + return 0.0; // TODO + + case EFL_INPUT_VALUE_TILT_Y: + return 0.0; // TODO + + case EFL_INPUT_VALUE_TWIST: + return 0.0; // TODO + + case EFL_INPUT_VALUE_WHEEL_DELTA: + return (double) pd->wheel.z; + + case EFL_INPUT_VALUE_WHEEL_ANGLE: + return 0.0; // TODO (emulate??) + + case EFL_INPUT_VALUE_WHEEL_DIRECTION: + return (pd->wheel.dir == EFL_ORIENT_HORIZONTAL) ? 1.0 : 0.0; + + case EFL_INPUT_VALUE_SLIDER: + return 0.0; // TODO + + case EFL_INPUT_VALUE_NONE: + default: + return 0; + } +} + #include "efl_event_pointer.eo.c" diff --git a/src/lib/evas/canvas/efl_event_pointer.eo b/src/lib/evas/canvas/efl_event_pointer.eo index e73866a..2722d1c 100644 --- a/src/lib/evas/canvas/efl_event_pointer.eo +++ b/src/lib/evas/canvas/efl_event_pointer.eo @@ -3,7 +3,7 @@ import efl_event_types; class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input) { - [[Event data carried over with any pointer event (mouse, touch, ...) + [[Event data carried over with any pointer event (mouse, touch, pen, ...) @since 1.18 ]] @@ -14,14 +14,52 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input act: Efl.Pointer.Action; } } + @property value_has { + [[$true if this event carries a valid value for the specified $key.]] + get {} + keys { + key: Efl.Input.Value; + } + values { + has: bool; + } + } + @property value { + [[Represents a generic value for this event. + + Refer to the documentation of @Efl.Input.Value for each value's + meaning, type and range. Call @.value_has.get to determine whether + the returned value is valid or not for this event. + + Most values are precise floating point values, usually in pixels, + radians, or in a range of [-1, 1] or [0, 1]. Some values are + discrete values (integers) and thus should preferably be queried + with the other methods of this class. + ]] + set { + return: bool; [[$false if the value could not be set (eg. delta).]] + } + get {} + keys { + key: Efl.Input.Value; + } + values { + val: double; + } + } @property button { - [[The mouse button that triggered the event.]] + [[The mouse button that triggered the event. + + Valid if and only if @.value_has($button) is $true. + ]] values { but: int; [[1 to 32, 0 if not a button event.]] } } @property button_pressed { - [[Whether a mouse button is pressed at the moment of the event.]] + [[Whether a mouse button is pressed at the moment of the event. + + Valid if and only if @.value_has($button_pressed) is $true.]] keys { button: int; } @@ -30,59 +68,53 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input } } @property position { - [[Position where the event happened, relative to the window.]] - values { - x: int; - y: int; - } - } - @property position_precise { - [[Position where the event happened, with subpixel precision + [[Position where the event happened, relative to the window. - Note: Same value as @.position, relative to the window. + This position, in integers, is an approximation of + @.value.get($x), @.value.get($y). Use @.position if you need + simple pixel positions, but prefer the generic interface + if you need precise coordinates. ]] values { - x: double; - y: double; + x: int; + y: int; } } @property previous_position { [[Position of the previous event, valid for move events. - Relative to the window. May be equal to @.position. + Relative to the window. May be equal to @.position (by default). + + This position, in integers, is an approximation of + @.value.get($previous_x), @.value.get($previous_y). + Use @.previous_position if you need simple pixel positions, + but prefer the generic interface if you need precise coordinates. ]] values { x: int; y: int; } } - @property previous_position_precise { - [[Position of the previous event, with subpixel precision. + @property delta { + [[Position delta, or movement, since the last event. - Valid for move events, may not be valid for other events. - Relative to the window. May be equal to @.position_precise. + This position, in integers, is an approximation of + @.value.get($dx), @.value.get($dy). Use @.delta if you need + simple pixel positions, but prefer the generic interface + if you need precise coordinates. ]] + get {} values { - x: double; - y: double; + dx: int; + dy: int; } } - @property finger { - [[Finger ID in case of a multi touch event.]] + @property tool { + [[ID of the tool (eg. pen) that triggered this event.]] values { id: int; } } - @property touch { - [[Touch information about a specific finger or pointer.]] - values { - radius: double; - rad_x: double; - rad_y: double; - pressure: double; - angle: double; - } - } @property source { [[The object where this event first originated, in case of propagation or repetition of the event. @@ -116,11 +148,13 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input } } @property wheel_direction { + [[Direction of the wheel.]] values { dir: Efl.Orient; [[Horizontal or Vertical only.]] } } - @property wheel_distance { + @property wheel_delta { + [[Delta movement of the wheel in discrete steps.]] values { dist: int; } diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 83539fa..f1b019f 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -395,7 +395,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->finger = 0; + ev->tool = 0; EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write) { @@ -480,7 +480,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->finger = 0; + ev->tool = 0; if (e->pointer.mouse_grabbed) { @@ -650,7 +650,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->finger = 0; + ev->tool = 0; copy = evas_event_list_copy(src->proxy->src_event_in); EINA_LIST_FOREACH(copy, l, eo_child) @@ -1242,7 +1242,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da ev->modifiers = &(e->modifiers); ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; - ev->finger = 0; + ev->tool = 0; if (ev->device) efl_ref(ev->device); _evas_walk(e); @@ -1440,7 +1440,7 @@ _canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data ev->modifiers = &(e->modifiers); ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; - ev->finger = 0; + ev->tool = 0; if (ev->device) efl_ref(ev->device); _evas_walk(e); @@ -1721,7 +1721,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da ev->locks = &(e->locks); ev->event_flags = e->default_event_flags; ev->pressed_buttons = e->pointer.button; - ev->finger = 0; + ev->tool = 0; if (ev->device) efl_ref(ev->device); _evas_walk(e); @@ -2236,7 +2236,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da 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->finger, e->pointer.downs); + ev->timestamp, ev->cur.x, ev->cur.y, ev->tool, e->pointer.downs); e->pointer.downs++; if (e->is_frozen) return; e->last_timestamp = ev->timestamp; @@ -2252,7 +2252,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da _evas_walk(e); /* append new touch point to the touch point list */ - _evas_touch_point_append(eo_e, ev->finger, ev->cur.x, ev->cur.y); + _evas_touch_point_append(eo_e, ev->tool, ev->cur.x, ev->cur.y); if (e->pointer.mouse_grabbed == 0) { if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1; @@ -2282,7 +2282,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da _evas_post_event_callback_call(eo_e, e); /* update touch point's state to EVAS_TOUCH_POINT_STILL */ - _evas_touch_point_update(eo_e, ev->finger, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_STILL); + _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_STILL); _evas_unwalk(e); if (ev->device) efl_unref(ev->device); @@ -2301,7 +2301,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data 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->finger, e->pointer.downs); + ev->timestamp, ev->cur.x, ev->cur.y, ev->tool, e->pointer.downs); if (e->pointer.downs <= 0) return; e->pointer.downs--; if (e->is_frozen) return; @@ -2318,7 +2318,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data _evas_walk(e); /* update released touch point */ - _evas_touch_point_update(eo_e, ev->finger, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_UP); + _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_UP); copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, eo_obj) { @@ -2342,7 +2342,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data if ((e->pointer.mouse_grabbed == 0) && !_post_up_handle(e, ev->eo)) _evas_post_event_callback_call(eo_e, e); /* remove released touch point from the touch point list */ - _evas_touch_point_remove(eo_e, ev->finger); + _evas_touch_point_remove(eo_e, ev->tool); _evas_unwalk(e); if (ev->device) efl_unref(ev->device); @@ -2368,7 +2368,7 @@ _canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e, if (!fy) fy = y; ev->action = action; - ev->finger = d; + ev->tool = d; ev->cur.x = fx; ev->cur.y = fy; ev->pressure = pres; @@ -2468,7 +2468,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da _evas_walk(e); /* update moved touch point */ - _evas_touch_point_update(eo_e, ev->finger, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_MOVE); + _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_MOVE); /* if our mouse button is grabbed to any objects */ if (e->pointer.mouse_grabbed > 0) { @@ -3179,21 +3179,21 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event) switch (ev->action) { case EFL_POINTER_ACTION_MOVE: - if (ev->finger == 0) + if (ev->tool == 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->finger == 0) + if (ev->tool == 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->finger == 0) + if (ev->tool == 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 a025530..92d2558 100644 --- a/src/lib/evas/canvas/evas_events_legacy.c +++ b/src/lib/evas/canvas/evas_events_legacy.c @@ -82,7 +82,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, } case EFL_POINTER_ACTION_DOWN: - if (ev->finger == 0) + if (ev->tool == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_DOWN) @@ -109,7 +109,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, { TYPE_CHK(MULTI_DOWN); Evas_Event_Multi_Down *e = _event_alloc(ev->legacy); - e->device = ev->finger; + e->device = ev->tool; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; @@ -133,7 +133,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, } case EFL_POINTER_ACTION_UP: - if (ev->finger == 0) + if (ev->tool == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_UP) @@ -160,7 +160,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, { TYPE_CHK(MULTI_UP); Evas_Event_Multi_Up *e = _event_alloc(ev->legacy); - e->device = ev->finger; + e->device = ev->tool; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; @@ -184,7 +184,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, } case EFL_POINTER_ACTION_MOVE: - if (ev->finger == 0) + if (ev->tool == 0) { // filter out MULTI with finger 0, valid for eo, invalid for legacy if (type == EVAS_CALLBACK_MULTI_MOVE) @@ -213,7 +213,7 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, { TYPE_CHK(MULTI_MOVE); Evas_Event_Multi_Move *e = _event_alloc(ev->legacy); - e->device = ev->finger; + e->device = ev->tool; e->radius = ev->radius; e->radius_x = ev->radius_x; e->radius_y = ev->radius_y; --
