summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel.stone@nokia.com>2006-07-17 19:34:45 -0400
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-07-17 19:34:45 -0400
commit7a4a2a3e733378abced0a184627adfda4ed387b9 (patch)
tree2ebde5313c1b0aa68506550454bb292512cfd38c
parent6767671f502964d385aa41de3a45fb479c6330c0 (diff)
add DevicePresenceNotify event, clean up
Add DevicePresenceNotify event, which indicates that something in the device list changed (Kristian Høgsberg, Red Hat). Add a core event control, which toggles the sending or not of core events by an extended device. Clean up some random detritus from the MetroLink merge.
-rw-r--r--XI.h14
-rw-r--r--XInput.h41
-rw-r--r--XIproto.h59
-rw-r--r--configure.ac2
4 files changed, 100 insertions, 16 deletions
diff --git a/XI.h b/XI.h
index c710e0a..dc1f22d 100644
--- a/XI.h
+++ b/XI.h
@@ -137,6 +137,7 @@ SOFTWARE.
#define XInput_Add_XDeviceBell 2
#define XInput_Add_XSetDeviceValuators 3
#define XInput_Add_XChangeDeviceControl 4
+#define XInput_Add_DevicePresenceNotify 5
#define XI_Absent 0
#define XI_Present 1
@@ -153,7 +154,12 @@ SOFTWARE.
#define XI_Add_XChangeDeviceControl_Major 1
#define XI_Add_XChangeDeviceControl_Minor 3
+#define XI_Add_DevicePresenceNotify_Major 1
+#define XI_Add_DevicePresenceNotify_Minor 4
+
#define DEVICE_RESOLUTION 1
+#define DEVICE_TOUCHSCREEN 2
+#define DEVICE_CORE 3
#define NoSuchExtension 1
@@ -204,12 +210,6 @@ SOFTWARE.
#define DeviceMode (1L << 0)
#define Relative 0
#define Absolute 1
-/* Merged from Metrolink tree for XINPUT stuff */
-#define TS_Raw 57
-#define TS_Scaled 58
-#define SendCoreEvents 59
-#define DontSendCoreEvents 60
-/* End of merged section */
#define ProximityState (1L << 1)
#define InProximity (0L << 1)
@@ -244,6 +244,8 @@ SOFTWARE.
#define _deviceOwnerGrabButton 8
#define _noExtensionEvent 9
+#define _devicePresence 0
+
#define XI_BadDevice 0
#define XI_BadEvent 1
#define XI_BadMode 2
diff --git a/XInput.h b/XInput.h
index ee44105..2f1fffb 100644
--- a/XInput.h
+++ b/XInput.h
@@ -149,6 +149,13 @@ SOFTWARE.
#define NoExtensionEvent(d,type,_class) \
{ _class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;}
+#define DevicePresence(dpy, type, _class) \
+ { \
+ extern int_XiGetDevicePresenceNotifyEvent(Display *); \
+ type = _XiGetDevicePresenceNotifyEvent(dpy); \
+ _class = (0x10000 | _devicePresence); \
+ }
+
#define BadDevice(dpy,error) _xibaddevice(dpy, &error)
#define BadClass(dpy,error) _xibadclass(dpy, &error)
@@ -418,6 +425,24 @@ typedef struct {
/*******************************************************************
*
+ * DevicePresenceNotify event. This event is sent when the list of
+ * input devices changes. No information about the change is
+ * contained in this event, the client should use XListInputDevices()
+ * to learn what has changed.
+ *
+ */
+
+typedef struct {
+ int type;
+ 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 */
+ Time time;
+} XDevicePresenceNotifyEvent;
+
+/*******************************************************************
+ *
* Control structures for input devices that support input class
* Feedback. These are used by the XGetFeedbackControl and
* XChangeFeedbackControl functions.
@@ -632,6 +657,22 @@ typedef struct {
int *max_resolutions;
} XDeviceResolutionState;
+typedef struct {
+ XID control;
+ int length;
+ int min_x;
+ int max_x;
+ int min_y;
+ int max_y;
+ int button_threshold;
+} XDeviceTSControl, XDeviceTSState;
+
+typedef struct {
+ XID control;
+ int length;
+ int status;
+} XDeviceCoreControl, XDeviceCoreState;
+
/*******************************************************************
*
* An array of XDeviceList structures is returned by the
diff --git a/XIproto.h b/XIproto.h
index 1da0248..ec2941b 100644
--- a/XIproto.h
+++ b/XIproto.h
@@ -72,7 +72,7 @@ SOFTWARE.
#define numInputClasses 7
-#define IEVENTS 15
+#define IEVENTS 16
#define IERRORS 5
#define CLIENT_REQ 1
@@ -113,6 +113,7 @@ struct tmask
#define XI_ChangeDeviceNotify 12
#define XI_DeviceKeystateNotify 13
#define XI_DeviceButtonstateNotify 14
+#define XI_DevicePresenceNotify 15
/*********************************************************
*
@@ -1290,6 +1291,24 @@ typedef struct {
CARD32 num_valuators B32; /* number of valuators */
} xDeviceResolutionState;
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD32 min_x;
+ CARD32 max_x;
+ CARD32 min_y;
+ CARD32 max_y;
+ CARD32 button_threshold;
+} xDeviceTSState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 status;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceCoreState;
+
/*********************************************************
*
* ChangeDeviceControl.
@@ -1332,21 +1351,23 @@ typedef struct {
CARD8 pad1,pad2;
} xDeviceResolutionCtl;
-
-/* Merged from Metrolink tree for XINPUT stuff */
-
typedef struct {
- CARD16 control;
- CARD16 length;
+ CARD16 control B16;
+ CARD16 length B16;
CARD32 min_x;
CARD32 max_x;
CARD32 min_y;
CARD32 max_y;
CARD32 button_threshold;
-} xDeviceTSCalibrationCtl;
-
-/* End of merged section */
+} xDeviceTSCtl;
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD8 status;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceCoreCtl;
/**********************************************************
*
@@ -1523,6 +1544,26 @@ typedef struct
CARD32 pad04 B32;
} changeDeviceNotify;
+/**********************************************************
+ *
+ * devicePresenceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE pad00;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+ } devicePresenceNotify;
+
#undef Window
#undef Time
#undef KeyCode
diff --git a/configure.ac b/configure.ac
index 3503bb9..aa96cc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ([2.57])
-AC_INIT([InputProto], [1.3.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([InputProto], [1.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
XORG_RELEASE_VERSION