summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-12-14 12:45:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-16 11:18:47 +1000
commit84db813b9db34975b5fe288a8a551bb98f0cc1c1 (patch)
tree0bd1479ef867b1e4c06e09150af257fcec74cf5e /include
parent92a5862d0c120b009a688237ec7142b7c21ae272 (diff)
Hook up TouchBegin/Update/End events
The are the same as device events internally but require the touch ID separately from the detail.button field (the protocol uses the detail field for the touch id). For simpler integration of pointer emulation we need to set the detail.button field while keeping the touchid around. Add the three new touch event types to the various places in the server where they need to be handled. The actual handling of the events is somewhat more complicated in most places. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/dix.h1
-rw-r--r--include/eventstr.h7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/dix.h b/include/dix.h
index 9b9dc4bf3..704320133 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -582,6 +582,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev);
extern _X_EXPORT Bool IsPointerDevice(DeviceIntPtr dev);
extern _X_EXPORT Bool IsKeyboardDevice(DeviceIntPtr dev);
extern Bool IsPointerEvent(InternalEvent *event);
+extern Bool IsTouchEvent(InternalEvent *event);
extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev);
diff --git a/include/eventstr.h b/include/eventstr.h
index 4d836fb14..96260760a 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -50,6 +50,9 @@ enum EventType {
ET_ButtonPress,
ET_ButtonRelease,
ET_Motion,
+ ET_TouchBegin,
+ ET_TouchUpdate,
+ ET_TouchEnd,
ET_Enter,
ET_Leave,
ET_FocusIn,
@@ -84,9 +87,11 @@ struct _DeviceEvent
int deviceid; /**< Device to post this event for */
int sourceid; /**< The physical source device */
union {
- uint32_t button; /**< Button number */
+ uint32_t button; /**< Button number (also used in pointer emulating
+ touch events) */
uint32_t key; /**< Key code */
} detail;
+ uint32_t touchid; /**< Touch ID (client_id) */
int16_t root_x; /**< Pos relative to root window in integral data */
float root_x_frac; /**< Pos relative to root window in frac part */
int16_t root_y; /**< Pos relative to root window in integral part */