summaryrefslogtreecommitdiff
path: root/XI2proto.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-09-20 15:03:03 +1000
committerChase Douglas <chase.douglas@ubuntu.com>2010-10-08 18:07:59 +0200
commit7a944ed08cec97fd553758a7c04ca45374224583 (patch)
tree7db47b95e7208657d06a9a345b4b5c8cf90ada05 /XI2proto.h
parent52e92f280c4e065d6a3f040493a0b46d2c8bee1d (diff)
Add TouchStateNotify/TouchMotion/TouchClass, bump to 2.1
Introduce multitouch support through a new TouchClass, as well as new TouchBegin, TouchEnd and TouchMotion events. Bump to version 2.1. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'XI2proto.h')
-rw-r--r--XI2proto.h115
1 files changed, 114 insertions, 1 deletions
diff --git a/XI2proto.h b/XI2proto.h
index 2fd91eb..ba9c691 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -187,6 +187,48 @@ typedef struct {
uint16_t pad2;
} xXIValuatorInfo;
+/**
+ * Denotes multitouch capability on a device, in general terms; XITouchInfo
+ * is used to detail specific touchpoints.
+ */
+typedef struct {
+ uint16_t type; /**< Always TouchClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< Source device for this class */
+ uint8_t mode; /**< ::XIModeRelative, XIModeAbsolute */
+ uint8_t pad0;
+ FP3232 min_x; /**< Min x value */
+ FP3232 max_x; /**< Max x value */
+ FP3232 min_y; /**< Min y value */
+ FP3232 max_y; /**< Max y value */
+ FP3232 min_touch_width; /**< Min touch/tool width */
+ FP3232 max_touch_width; /**< Max touch/tool width */
+ uint32_t max_touches; /**< Max number of active touchpoints */
+ uint32_t num_touches; /**< Current number of active touchpoints */
+ uint32_t pad1;
+ uint32_t pad2;
+} xXITouchClassInfo;
+
+/**
+ * Denotes a touchpoint on a device.
+ * One XITouchInfo describes exactly one touchpoint on the device; capabilities
+ * are given in XITouchClassInfo.
+ */
+typedef struct {
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t orientation; /**< Last published orientation */
+ uint32_t touchid; /**< Valuator number */
+ Atom tool; /**< Tool identifier */
+ FP3232 x; /**< Last published x value */
+ FP3232 y; /**< Last published y value */
+ FP3232 touch_major; /**< Last published touch width (maj axis)*/
+ FP3232 touch_minor; /**< Last published touch width (min axis)*/
+ FP3232 tool_major; /**< Last published tool width (maj axis) */
+ FP3232 tool_minor; /**< Last published tool width (min axis) */
+ uint32_t pad0;
+ uint32_t pad1;
+} xXITouchInfo;
+
/**
* Used to select for events on a given window.
@@ -610,7 +652,9 @@ typedef struct {
/**
- * Allow or replay events on the specified grabbed device.
+ * Allow or replay events on the specified grabbed device. The
+ * Detail variant was added in XI 2.1 for TouchBegin grabs: servers
+ * must check the request length to determine which to use.
*/
typedef struct {
uint8_t reqType;
@@ -623,6 +667,18 @@ typedef struct {
} xXIAllowEventsReq;
#define sz_xXIAllowEventsReq 12
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIAllowEvents */
+ uint16_t length; /**< Length in 4 byte units */
+ Time time;
+ uint16_t deviceid;
+ uint8_t mode;
+ uint8_t pad;
+ uint32_t detail;
+} xXIAllowEventsDetailReq;
+#define sz_xXIAllowEventsDetailReq 16
+
/**
* Passively grab the device.
@@ -967,6 +1023,63 @@ typedef struct
uint32_t pad3;
} xXIPropertyEvent;
+/**
+ * Sent as TouchBegin when a touch sequence starts and TouchEnd when it
+ * finishes.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber; /**< Sequence number of event */
+ uint32_t length; /**< Length in 4 byte units */
+ uint16_t evtype; /**< ::XI_TouchBegin, XI_TouchEnd */
+ uint16_t deviceid; /**< Device event was delivered to */
+ Time time; /**< Time event was received */
+ uint32_t touchid; /**< Unique identifier for this touch */
+ uint32_t tool; /**< Finger/tool ID (if supported) */
+ uint16_t sourceid; /**< Provoking device */
+ uint16_t pad0;
+ Window root; /**< Root window for this event */
+ Window event; /**< Window event was delivered to */
+ Window child; /**< Window event occurred within */
+} xXITouchStateEvent;
+
+typedef xXITouchStateEvent xXITouchBeginEvent;
+typedef xXITouchStateEvent xXITouchEndEvent;
+
+/**
+ * Sent when a touchpoint moves (analagous to MotionNotify).
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber; /**< Sequence number of event */
+ uint32_t length; /**< Length in 4 byte units */
+ uint16_t evtype; /**< ::XI_TouchMotion */
+ uint16_t deviceid; /**< Device event was delivered to */
+ Time time; /**< Time of event generation */
+ uint16_t sourceid; /**< Provoking device */
+ uint16_t mask; /**< Components present in this event */
+ uint32_t touchid; /**< Unique identifier for this touch */
+ Window root; /**< Root window for this event */
+ Window event; /**< Window event was delivered to */
+ Window child; /**< Window event occurred within */
+ FP1616 root_x; /**< x value scaled to screen co-ords */
+ FP1616 root_y; /**< y value scaled to screen co-ords */
+ FP1616 event_x; /**< x value within event window */
+ FP1616 event_y; /**< y value within event window */
+ FP3232 x; /**< Unscaled x co-ordinate */
+ FP3232 y; /**< Unscaled y co-ordinate */
+ FP3232 touch_width_major; /**< Major axis of touched area */
+ FP3232 touch_width_minor; /**< Minor axis of touched area */
+ FP3232 tool_width_major; /**< Major axis of proximate tool */
+ FP3232 tool_width_minor; /**< Minor axis of proximate tool */
+ uint16_t orientation; /**< Tool orientation, in degrees */
+ uint16_t flags; /**< Bitmask of flags */
+} xXITouchMotionEvent;
+
#undef Window
#undef Time