--- proto-old/Input/XI.h 2005-12-26 01:25:22.000000000 -0500 +++ proto/Input/XI.h 2005-12-26 01:25:58.000000000 -0500 @@ -110,6 +110,10 @@ #define sz_xGetDeviceControlReply 32 #define sz_xChangeDeviceControlReq 8 #define sz_xChangeDeviceControlReply 32 +#define sz_xAddInputDeviceReq 4 +#define sz_xAddInputDeviceReply 32 +#define sz_xRemoveInputDeviceReq 4 +#define sz_xRemoveInputDeviceReply 32 #define INAME "XInputExtension" @@ -137,6 +141,7 @@ #define XInput_Add_XDeviceBell 2 #define XInput_Add_XSetDeviceValuators 3 #define XInput_Add_XChangeDeviceControl 4 +#define XInput_Add_XAddInputDevice 5 #define XI_Absent 0 #define XI_Present 1 @@ -153,6 +158,9 @@ #define XI_Add_XChangeDeviceControl_Major 1 #define XI_Add_XChangeDeviceControl_Minor 3 +#define XI_Add_XAddInputDevice_Major 1 +#define XI_Add_XAddInputDevice_Minor 4 + #define DEVICE_RESOLUTION 1 #define NoSuchExtension 1 @@ -244,6 +252,8 @@ #define _deviceOwnerGrabButton 8 #define _noExtensionEvent 9 +#define _devicePresence 0 + #define XI_BadDevice 0 #define XI_BadEvent 1 #define XI_BadMode 2 --- proto-old/Input/XInput.h 2005-12-26 01:25:22.000000000 -0500 +++ proto/Input/XInput.h 2005-12-26 01:25:58.000000000 -0500 @@ -149,6 +149,13 @@ #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 @@ /******************************************************************* * + * 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. @@ -824,6 +849,11 @@ char buttons[32]; } XButtonState; +typedef struct { + char *name; + char *value; +} XDeviceOption; + /******************************************************************* * * Function definitions. @@ -1120,6 +1150,19 @@ XDeviceControl* /* control */ ); +extern int XAddInputDevice( + Display* /* display */, + _Xconst char* /* name */, + _Xconst char* /* driver */, + XDeviceOption* /* options */, + int /* nOptions */ +); + +extern int XRemoveInputDevice( + Display* /* display */, + _Xconst char* /* name */ +); + _XFUNCPROTOEND #endif /* _XINPUT_H_ */ --- proto-old/Input/XIproto.h 2005-12-26 01:25:22.000000000 -0500 +++ proto/Input/XIproto.h 2005-12-26 01:25:58.000000000 -0500 @@ -72,7 +72,7 @@ #define numInputClasses 7 -#define IEVENTS 15 +#define IEVENTS 16 #define IERRORS 5 #define CLIENT_REQ 1 @@ -113,6 +113,7 @@ #define XI_ChangeDeviceNotify 12 #define XI_DeviceKeystateNotify 13 #define XI_DeviceButtonstateNotify 14 +#define XI_DevicePresenceNotify 15 /********************************************************* * @@ -156,6 +157,10 @@ #define X_GetDeviceControl 34 #define X_ChangeDeviceControl 35 +/* Added in version 1.4 */ +#define X_AddInputDevice 36 +#define X_RemoveInputDevice 37 + /********************************************************* * * Protocol request and reply structures. @@ -1348,6 +1353,65 @@ /* End of merged section */ +/********************************************************* + * + * AddInputDevice. + * + */ + +typedef struct { + char *name; + char *value; +} xDeviceOption; + +typedef struct { + CARD8 reqType; /* input extension major code */ + CARD8 ReqType; /* always X_AddInputDevce */ + CARD16 length B16; +} xAddInputDeviceReq; + +typedef struct { + CARD8 repType; /* X_Reply */ + CARD8 RepType; /* always X_AddInputDevce */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD8 status; + BYTE pad1, pad2, pad3; + CARD32 pad02 B32; + CARD32 pad03 B32; + CARD32 pad04 B32; + CARD32 pad05 B32; + CARD32 pad06 B32; +} xAddInputDeviceReply; + + +/********************************************************* + * + * RemoveInputDevice. + * + */ + +typedef struct { + CARD8 reqType; /* input extension major code */ + CARD8 ReqType; /* always X_RemoveInputDevce */ + CARD16 length B16; +} xRemoveInputDeviceReq; + +typedef struct { + CARD8 repType; /* X_Reply */ + CARD8 RepType; /* always X_RemoveInputDevce */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD8 status; + BYTE pad1, pad2, pad3; + CARD32 pad02 B32; + CARD32 pad03 B32; + CARD32 pad04 B32; + CARD32 pad05 B32; + CARD32 pad06 B32; +} xRemoveInputDeviceReply; + + /********************************************************** * * Input extension events. @@ -1523,6 +1587,26 @@ 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