2 * XIint.h - Header definition and support file for the internal
3 * support routines used by the Xi library.
8 #include <X11/extensions/XI.h>
10 /* inputproto 2.0 still shipped with these defined in the proto headers */
11 #ifndef XInput_Initial_Release
12 /* Indices into the versions[] array (XExtInt.c). Used as a index to
13 * retrieve the minimum version of XI from _XiCheckExtInit */
15 #define XInput_Initial_Release 1
16 #define XInput_Add_XDeviceBell 2
17 #define XInput_Add_XSetDeviceValuators 3
18 #define XInput_Add_XChangeDeviceControl 4
19 #define XInput_Add_DevicePresenceNotify 5
20 #define XInput_Add_DeviceProperties 6
27 extern XExtDisplayInfo *XInput_find_display(Display *);
29 extern int _XiCheckExtInit(Display *, int, XExtDisplayInfo *);
30 extern int _XiCheckVersion(XExtDisplayInfo *info, int version_index);
32 extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *, XExtDisplayInfo *);
33 extern XExtensionVersion* _XiGetExtensionVersionRequest(Display *dpy, _Xconst char *name, int xi_opcode);
34 extern Status _xiQueryVersion(Display *dpy, int*, int*, XExtDisplayInfo *);
36 extern Status _XiEventToWire(
37 register Display * /* dpy */,
38 register XEvent * /* re */,
39 register xEvent ** /* event */,
40 register int * /* count */
43 typedef struct _XInputData
46 XExtensionVersion *vers;
51 * Returns the next valid memory block of the given size within the block
52 * previously allocated.
53 * Use letting pointers inside a struct point to bytes after the same
54 * struct, e.g. during protocol parsing etc.
56 * Caller is responsible for allocating enough memory.
67 * ptr = malloc(large_enough);
68 * bar = next_block(&ptr, sizeof(struct foo));
71 * bar->a = next_block(&ptr, bar->num_a);
72 * bar->b = next_block(&ptr, bar->num_b);
75 next_block(void **ptr, int size) {
81 *(unsigned char**)ptr += size;
86 #ifndef HAVE__XEATDATAWORDS
87 #include <X11/Xmd.h> /* for LONG64 on 64-bit platforms */
90 static inline void _XEatDataWords(Display *dpy, unsigned long n)
93 if (n >= (ULONG_MAX >> 2))
96 _XEatData (dpy, n << 2);