summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-05-01 22:31:09 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-05-01 22:31:09 +0930
commitce7bbfb7e0ecaf977c4ec8e760c634cebf8ac167 (patch)
tree5d736275362661c03f9a618fd77c0f4165dd6182
parent02c50062d357bc5d43ab4440eb195a33df0ec8b9 (diff)
Add XGE support and event types for RawDeviceEvent and PairingChanged event.
-rw-r--r--XI.h6
-rw-r--r--XInput.h52
-rw-r--r--XIproto.h88
3 files changed, 130 insertions, 16 deletions
diff --git a/XI.h b/XI.h
index a9b96c5..6e00ba1 100644
--- a/XI.h
+++ b/XI.h
@@ -126,6 +126,7 @@ SOFTWARE.
#define sz_xGetClientPointerReply 32
#define sz_xGetPairedPointerReq 8
#define sz_xGetPairedPointerReply 32
+#define sz_xXiSelectEventReq 12
#define INAME "XInputExtension"
@@ -298,6 +299,11 @@ SOFTWARE.
#define XI_DeviceBusy 3
#define XI_BadClass 4
+/* GE masks */
+#define XI_PointerKeyboardPairingChangedMask (1 << 0)
+#define XI_RandomStringMask (1 << 1)
+#define XI_RawDeviceEventMask (1 << 2)
+
/* Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
* definition of XEventClass since that would be a library interface change.
* See the top of X.h for more _XSERVER64 magic.
diff --git a/XInput.h b/XInput.h
index 617b4cc..7f6fcb9 100644
--- a/XInput.h
+++ b/XInput.h
@@ -168,19 +168,13 @@ extern "C" {
_class = (0x10000 | _devicePresence); \
}
-#define PointerKeyboardPairing(dpy, type, _class) \
- { \
- extern int _XiGetPointerKeyboardPairingNotifyEvent(Display *); \
- type = _XiGetPointerKeyboardPairingNotifyEvent(Display *); \
- _class = (0x10000 | _pairingNotify); \
- }
-
#define DeviceEnterNotify(d, type, _class) \
FindTypeAndClass(d, type, _class, OtherClass, _deviceEnterNotify);
#define DeviceLeaveNotify(d, type, _class) \
FindTypeAndClass(d, type, _class, OtherClass, _deviceLeaveNotify);
+/* Errors */
#define BadDevice(dpy,error) _xibaddevice(dpy, &error)
#define BadClass(dpy,error) _xibadclass(dpy, &error)
@@ -507,16 +501,51 @@ typedef XDeviceCrossingEvent XDeviceEnterWindowEvent;
* Keyboard events will follow the focus of the given mouse.
*/
typedef struct {
- int type;
+ int type; /* GenericEvent */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
- Window window; /* unused */
+ int extension; /* XI extension offset */
+ int evtype; /* PointerKeyboardPairingCHangedNotify */
Time time;
XID pointerid; /* pointer deviceid */
XID keyboardid; /* keyboard deviceid */
} XPointerKeyboardPairingChangedNotifyEvent;
+
+/*
+ * XRandomStringEvent.
+ * FOR TESTING ONLY. DO NOT USE.
+ */
+
+typedef struct {
+ int type; /* GenericEvent */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ int extension; /* XI extension offset */
+ int evtype; /* RandomStringEvent */
+ char* string;
+} XRandomStringEvent;
+
+/*
+ * RawDeviceEvent.
+ * Data as received directly from the device.
+ */
+typedef struct {
+ int type; /* GenericEvent */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ int extension; /* XI extension offset */
+ int evtype; /* XI_RawDeviceEvent */
+ int buttons;
+ int num_valuators;
+ int first_valuator;
+ int* valuators;
+} XRawDeviceEvent;
+
+
/*******************************************************************
*
* Control structures for input devices that support input class
@@ -1380,6 +1409,11 @@ extern Bool XGetClientPointer(
int* /* deviceid */
);
+extern Status XiSelectEvent(
+ Display* /* dpy */,
+ Window /* win */,
+ Mask /* mask */
+);
_XFUNCPROTOEND
diff --git a/XIproto.h b/XIproto.h
index dadccab..918aae3 100644
--- a/XIproto.h
+++ b/XIproto.h
@@ -57,6 +57,7 @@ SOFTWARE.
#define Window CARD32
#define Time CARD32
#define KeyCode CARD8
+#define Mask CARD32
/*********************************************************
*
@@ -72,7 +73,7 @@ SOFTWARE.
#define numInputClasses 7
-#define IEVENTS 19
+#define IEVENTS 18
#define IERRORS 5
#define CLIENT_REQ 1
@@ -116,7 +117,12 @@ struct tmask
#define XI_DevicePresenceNotify 15
#define XI_DeviceEnterNotify 16
#define XI_DeviceLeaveNotify 17
-#define XI_PointerKeyboardPairingChangedNotify 18
+
+/* GE events */
+#define XI_PointerKeyboardPairingChangedNotify 0
+#define XI_RandomStringEvent 1
+#define XI_RawDeviceEvent 2
+
/*********************************************************
*
@@ -170,6 +176,7 @@ struct tmask
#define X_SetClientPointer 44
#define X_GetClientPointer 45
#define X_GetPairedPointer 46
+#define X_XiSelectEvent 47
/*********************************************************
*
@@ -1702,6 +1709,22 @@ typedef struct {
CARD32 pad5 B32;
} xGetPairedPointerReply;
+
+/**********************************************************
+ *
+ * XiSelectevent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major opcode */
+ CARD8 ReqType; /* always X_XiSelectEvent */
+ CARD16 length B16;
+ Window window B32; /* window to be changed */
+ Mask mask B32; /* mask to be applied */
+} xXiSelectEventReq;
+
+
/**********************************************************
*
* Input extension events.
@@ -1934,10 +1957,12 @@ typedef deviceEnterNotify deviceLeaveNotify;
typedef struct
{
- BYTE type;
- BYTE pad00;
+ BYTE type; /* always GenericEvent */
+ BYTE extension; /* Xi extension offset */
CARD16 sequenceNumber B16;
- Time time B32;
+ CARD32 length B32;
+ CARD16 evtype B16;
+ CARD32 time B32;
CARD8 pointer;
CARD8 keyboard;
CARD16 pad0;
@@ -1945,13 +1970,62 @@ typedef struct
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
- CARD32 pad5;
- CARD32 pad6;
} pairingChangedNotify;
+/**********************************************************
+ *
+ * RandomStringEvent.
+ * GE event, != 32 bytes.
+ *
+ * FOR TESTING, DO NOT USE THIS.
+ */
+
+typedef struct
+ {
+ BYTE type; /* always GenericEvent */
+ BYTE extension; /* XI extension offset */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 evtype B16; /* XI_RandomStringEvent */
+ CARD16 slen B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } randomStringEvent;
+
+/*********************************************************
+ * RawDeviceEvent.
+ *
+ * GE event, may be larger than 32 bytes. If length is > 0, then the event is
+ * followed by (length * CARD32) fields denoting the values of valuator4 to
+ * valuator(num_valuators-1).
+ */
+
+typedef struct
+ {
+ BYTE type; /* always GenericEvent */
+ BYTE extension; /* XI extension offset */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 evtype B16; /* XI_RawDeviceEvent */
+ CARD8 buttons;
+ CARD8 num_valuators;
+ CARD8 first_valuator;
+ CARD8 pad0;
+ CARD16 pad1;
+ CARD32 valuator0 B32;
+ CARD32 valuator1 B32;
+ CARD32 valuator2 B32;
+ CARD32 valuator3 B32;
+ } rawDeviceEvent;
+
+
#undef Window
#undef Time
#undef KeyCode
+#undef Mask
#endif