summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_callbacks.c
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2014-11-25 12:07:50 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-25 12:43:15 +0900
commit26c943bac0d4b62bce63a6b575c58d15e5e6113f (patch)
tree79fef2ccc792a21408577ae579e287f3442acada /src/lib/evas/canvas/evas_callbacks.c
parent86aef83eb2aa89a76135e0cbab6999684f51839a (diff)
Expose device (e.g. pen) axis information to applications
Summary: This patch set adds the necessary code to expose device axis state to applications. This was primarily written with graphics tablets in mind, which -- in addition to acting like a mouse -- also provide information about pen pressure, tilt, etc. Other devices could potentially benefit from this API as well: touchscreens, joysticks, knob controllers, "spaceballs", etc. Whenever an update to the device state is recieved, an "Axis update" event is synthesized. This event contains the updated information, typically scaled and normalized to a particular logical range (e.g. zero to one for pressure, -pi to pi radians for angles, etc.). Information about the tool which generated the event is also stored so that applications can disambiguate events from multiple devices (or in the case of multitouch screens, individual fingers). This API is only wired up for use with X11 at the moment. Support for other backends (e.g. Wayland) should be easy to add for those familiar them. **Note**: The following is a list of changes from the "v2" patches originally sent to the mailinglist //Define and implement new Ecore_Event_Axis_Update events// * Harcode axis labels instead of including xserver-properties.h * Use C89-style comments * Use doxygen comments * Update comment text to note axes with unbounded/undefined ranges/units * Create "Ecore_Axis" and "Ecore_Axis_Label" typedefs * Reference typedef'd instead of raw types * Adjust how we count through valuators to support tilt/az * Add support for tilt and azimuth * Tweak memory management in case number of valuators differ * Expand TWIST axis normalization to declared range * Only normalize TWIST axis if resolution == 1 (wacom bug) * Cache label atoms on first use to minimize round-trips //Implement EVAS_CALLBACK_AXIS_UPDATE event and friends// * Update to doxygen comments * Update comment text to note axes with unbounded/undefined ranges/units * Typedef 'Evas_Axis_Label', 'Evas_Axis' * Move typedef for 'Evas_Event_Axis_Update' * Reference typedef'd instead of raw types //Wire the Ecore and Evas implementations of axis update events together// * Expose ecore_event_evas_axis_update in Ecore_Input_Evas.h * Move ecore_event_evas_axis_update to more logical position //DEBUG: Add axis update logging to evas-multi-touch.c// * Removed from patch set //Make evas-multi-touch demo use new axis functionality// * Have pressure adjust rectangle brightness instead of size * Use more available axis data when rendering rectangle (azimuth, tilt, twist) Test Plan: The evas-multi-touch demo was updated to support axis update events. A graphics tablet was then used to verify that the pressure, azimuth, tilt, and twist data was coming through correctly. Reviewers: cedric, raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1514 Conflicts: src/lib/ecore_input/Ecore_Input.h Carsten Haitzler - ** fixed forward enum typedefs (make things unhappy) ** fixed conflict above ** fixed wrong param type for _evas_canvas_event_feed_axis_update() ** fixed @sinces to be 1.13 ** fixed formatting/indeting ** fixed order of operation reliance in if's with ()'s to be clear ** fixed functions to be static that should have been
Diffstat (limited to 'src/lib/evas/canvas/evas_callbacks.c')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index a1b82314c3..52bd014895 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -12,6 +12,9 @@ EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_PRE =
12EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_POST = 12EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_RENDER_POST =
13 EO_EVENT_DESCRIPTION("Render Post", "Called just after rendering stops on the canvas target @since 1.2"); 13 EO_EVENT_DESCRIPTION("Render Post", "Called just after rendering stops on the canvas target @since 1.2");
14 14
15EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_AXIS_UPDATE =
16 EO_EVENT_DESCRIPTION("Axis Update", "Device axis value changed");
17
15EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_IN = 18EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_IN =
16 EO_HOT_EVENT_DESCRIPTION("Canvas Focus In", "Canvas got focus as a whole"); 19 EO_HOT_EVENT_DESCRIPTION("Canvas Focus In", "Canvas got focus as a whole");
17EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_OUT = 20EAPI const Eo_Event_Description _EVAS_CANVAS_EVENT_FOCUS_OUT =
@@ -66,7 +69,8 @@ static const Eo_Event_Description *_legacy_evas_callback_table[EVAS_CALLBACK_LAS
66 EVAS_CANVAS_EVENT_RENDER_PRE, 69 EVAS_CANVAS_EVENT_RENDER_PRE,
67 EVAS_CANVAS_EVENT_RENDER_POST, 70 EVAS_CANVAS_EVENT_RENDER_POST,
68 EVAS_OBJECT_EVENT_IMAGE_RESIZE, 71 EVAS_OBJECT_EVENT_IMAGE_RESIZE,
69 EVAS_CANVAS_EVENT_DEVICE_CHANGED 72 EVAS_CANVAS_EVENT_DEVICE_CHANGED,
73 EVAS_CANVAS_EVENT_AXIS_UPDATE
70}; 74};
71 75
72typedef struct 76typedef struct