summaryrefslogtreecommitdiff
path: root/include/eventstr.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-09-20 15:03:06 +1000
committerChase Douglas <chase.douglas@ubuntu.com>2010-10-13 21:42:27 +0200
commita6cdd84853df31b8d2beffcbf7fbc5e51dbd74b5 (patch)
tree4147c8c3b56826ca841aa3f780bdf31e80ae3838 /include/eventstr.h
parentf7d671b89a6c4e00f1333960b56d18f69548628e (diff)
Input: Add initial multitouch support from Xi 2.1
Xi 2.1 adds TouchClasses to devices, as well as TouchBegin, TouchMotion and TouchEnd events, to allow support for multiple touchpoints on a single device. This is a full implementation of the Xi 2.1 additions. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'include/eventstr.h')
-rw-r--r--include/eventstr.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/eventstr.h b/include/eventstr.h
index 433227e6e..da11d6a44 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -65,6 +65,9 @@ enum EventType {
ET_RawButtonRelease,
ET_RawMotion,
ET_XQuartz,
+ ET_TouchBegin,
+ ET_TouchEnd,
+ ET_TouchMotion,
ET_Internal = 0xFF /* First byte */
};
@@ -209,6 +212,43 @@ struct _RawDeviceEvent
} valuators;
};
+struct _TouchStateEvent
+{
+ unsigned char header; /**< Always ET_Internal */
+ enum EventType type; /**< ET_TouchBegin or ET_TouchEnd */
+ int length; /**< Length in bytes */
+ Time time; /**< Time in ms */
+ int deviceid; /**< Device to post this event for */
+ int sourceid; /**< The physical source device */
+ uint32_t touchid; /**< Unique identifier for this touch */
+ uint32_t tool; /**< Identifier of the physical tool */
+ Window root; /**< Root window for events */
+ FP1616 root_x; /**< x in screen co-ordinates */
+ FP1616 root_y; /**< y in screen co-ordinates */
+};
+
+struct _TouchMotionEvent
+{
+ unsigned char header; /**< Always ET_Internal */
+ enum EventType type; /**< ET_TouchMotion */
+ int length; /**< Length in bytes */
+ Time time; /**< Time in ms */
+ int deviceid; /**< Device to post this event for */
+ int sourceid; /**< The physical source device */
+ uint32_t touchid; /**< Unique identifier for this touch */
+ uint16_t mask; /**< Components present in this event */
+ Window root; /**< Root window event is relative to */
+ FP1616 root_x; /**< x in screen co-ordinates */
+ FP1616 root_y; /**< y in screen co-ordinates */
+ FP3232 x;
+ FP3232 y;
+ FP3232 touch_width_major;
+ FP3232 touch_width_minor;
+ FP3232 tool_width_major;
+ FP3232 tool_width_minor;
+ uint16_t orientation;
+};
+
#ifdef XQUARTZ
#define XQUARTZ_EVENT_MAXARGS 5
struct _XQuartzEvent {
@@ -234,6 +274,8 @@ union _InternalEvent {
} any;
DeviceEvent device_event;
DeviceChangedEvent changed_event;
+ TouchStateEvent touch_state_event;
+ TouchMotionEvent touch_motion_event;
#if XFreeXDGA
DGAEvent dga_event;
#endif