summaryrefslogtreecommitdiff
path: root/XI2.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-02-07 10:19:06 +0000
committerDaniel Stone <daniel@fooishbar.org>2011-02-15 14:24:08 +0000
commit99f15a2346c882237c78afbd638932f132d6113c (patch)
treed1946016515d790b3369d6c6ccc9d5823dd3eeef /XI2.h
parent13baef91f071ee1607f4c3bf6c1fea60e6651b89 (diff)
Add touch classes and events, bump to 2.1
Introduce multitouch support through a new TouchClass, as well as new TouchBegin, TouchEnd, TouchOwnership, TouchUpdate, and TouchUpdateUnowned events. Bump to version 2.1. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Co-authored-by: Chase Douglas <chase.douglas@canonical.com> Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'XI2.h')
-rw-r--r--XI2.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/XI2.h b/XI2.h
index 6ba1377..40c9ca6 100644
--- a/XI2.h
+++ b/XI2.h
@@ -36,6 +36,7 @@
#define XI_2_Major 2
#define XI_2_Minor 0
+#define XI_2_1_Minor 1
/* Property event flags */
#define XIPropertyDeleted 0
@@ -65,6 +66,8 @@
#define XIGrabtypeKeycode 1
#define XIGrabtypeEnter 2
#define XIGrabtypeFocusIn 3
+#define XIGrabtypeTouchBegin 4
+#define XIGrabtypeTouchBeginInert 5
/* Passive grab modifier */
#define XIAnyModifier (1U << 31)
@@ -79,6 +82,11 @@
#define XIAsyncPair 4
#define XISyncPair 5
+/* XIAllowTouchEvents bitmask event-modes */
+#define XITouchOwnerAccept (1 << 0)
+#define XITouchOwnerRejectEnd (1 << 1)
+#define XITouchOwnerRejectContinue (1 << 2)
+
/* DeviceChangedEvent change reasons */
#define XISlaveSwitch 1
#define XIDeviceChange 2
@@ -113,15 +121,27 @@
#define XISlaveKeyboard 4
#define XIFloatingSlave 5
-/* Device classes */
+/* Device classes: classes that are not identical to Xi 1.x classes must be
+ * numbered starting from 8. */
#define XIKeyClass 0
#define XIButtonClass 1
#define XIValuatorClass 2
+#define XITouchClass 8
+#define XITouchValuatorClass 9
/* Device event flags (common) */
/* Device event flags (key events only) */
#define XIKeyRepeat (1 << 16)
/* Device event flags (pointer events only) */
+#define XIPointerEmulated (1 << 16)
+/* Device event flags (touch events only) */
+#define XITouchPendingEnd (1 << 16)
+/* Device event flags (touch end events only) */
+#define XITouchAccepted (1 << 17)
+
+/* Touch modes */
+#define XIDirectTouch 1
+#define XIDependentTouch 2
/* XI2 event mask macros */
#define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7)))
@@ -151,7 +171,12 @@
#define XI_RawButtonPress 15
#define XI_RawButtonRelease 16
#define XI_RawMotion 17
-#define XI_LASTEVENT XI_RawMotion
+#define XI_TouchBegin 18
+#define XI_TouchEnd 19
+#define XI_TouchOwnership 20
+#define XI_TouchUpdate 21
+#define XI_TouchUpdateUnowned 22
+#define XI_LASTEVENT XI_TouchUpdateUnowned
/* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
* as XI_LASTEVENT if the server is supposed to handle masks etc. for this
* type of event. */
@@ -177,5 +202,10 @@
#define XI_RawButtonPressMask (1 << XI_RawButtonPress)
#define XI_RawButtonReleaseMask (1 << XI_RawButtonRelease)
#define XI_RawMotionMask (1 << XI_RawMotion)
+#define XI_TouchBeginMask (1 << XI_TouchBegin)
+#define XI_TouchEndMask (1 << XI_TouchEnd)
+#define XI_TouchOwnershipChangedMask (1 << XI_TouchOwnershipChanged)
+#define XI_TouchUpdateMask (1 << XI_TouchUpdate)
+#define XI_TouchUpdateUnownedMask (1 << XI_TouchUpdateUnowned)
#endif /* _XI2_H_ */