2 * Copyright © 2009 Red Hat, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 /* Definitions used by the library and client */
31 #include <X11/extensions/XI2.h>
32 #include <X11/extensions/Xge.h>
34 /*******************************************************************
47 int return_mode; /* AttachToMaster, Floating */
64 int type; /* must be first element */
66 XIRemoveMasterInfo remove;
67 XIAttachSlaveInfo attach;
68 XIDetachSlaveInfo detach;
69 } XIAnyHierarchyChangeInfo;
79 typedef XIModifierState XIGroupState;
134 } XIValuatorClassInfo;
163 XIAnyClassInfo **classes;
173 * Generic XI2 event. All XI2 events have the same header.
176 int type; /* GenericEvent */
177 unsigned long serial; /* # of last request processed by server */
178 Bool send_event; /* true if this came from a SendEvent request */
179 Display *display; /* Display the event was read from */
180 int extension; /* XI extension offset */
195 * Notifies the client that the device hierarchy has been changed. The client
196 * is expected to re-query the server for the device hierarchy.
199 int type; /* GenericEvent */
200 unsigned long serial; /* # of last request processed by server */
201 Bool send_event; /* true if this came from a SendEvent request */
202 Display *display; /* Display the event was read from */
203 int extension; /* XI extension offset */
204 int evtype; /* XI_HierarchyChanged */
208 XIHierarchyInfo *info;
212 * Notifies the client that the classes have been changed. This happens when
213 * the slave device that sends through the master changes.
216 int type; /* GenericEvent */
217 unsigned long serial; /* # of last request processed by server */
218 Bool send_event; /* true if this came from a SendEvent request */
219 Display *display; /* Display the event was read from */
220 int extension; /* XI extension offset */
221 int evtype; /* XI_DeviceChanged */
223 int deviceid; /* id of the device that changed */
224 int sourceid; /* Source for the new classes. */
225 int reason; /* Reason for the change */
227 XIAnyClassInfo **classes; /* same as in XIDeviceInfo */
228 } XIDeviceChangedEvent;
231 int type; /* GenericEvent */
232 unsigned long serial; /* # of last request processed by server */
233 Bool send_event; /* true if this came from a SendEvent request */
234 Display *display; /* Display the event was read from */
235 int extension; /* XI extension offset */
249 XIButtonState buttons;
250 XIValuatorState valuators;
251 XIModifierState mods;
256 int type; /* GenericEvent */
257 unsigned long serial; /* # of last request processed by server */
258 Bool send_event; /* true if this came from a SendEvent request */
259 Display *display; /* Display the event was read from */
260 int extension; /* XI extension offset */
261 int evtype; /* XI_RawKeyPress, XI_RawKeyRelease, etc. */
264 int sourceid; /* Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */
267 XIValuatorState valuators;
272 int type; /* GenericEvent */
273 unsigned long serial; /* # of last request processed by server */
274 Bool send_event; /* true if this came from a SendEvent request */
275 Display *display; /* Display the event was read from */
276 int extension; /* XI extension offset */
292 XIButtonState buttons;
293 XIModifierState mods;
297 typedef XIEnterEvent XILeaveEvent;
298 typedef XIEnterEvent XIFocusInEvent;
299 typedef XIEnterEvent XIFocusOutEvent;
302 int type; /* GenericEvent */
303 unsigned long serial; /* # of last request processed by server */
304 Bool send_event; /* true if this came from a SendEvent request */
305 Display *display; /* Display the event was read from */
306 int extension; /* XI extension offset */
307 int evtype; /* XI_PropertyEvent */
309 int deviceid; /* id of the device that changed */
315 int type; /* GenericEvent */
316 unsigned long serial; /* # of last request processed by server */
317 Bool send_event; /* true if this came from a SendEvent request */
318 Display *display; /* Display the event was read from */
319 int extension; /* XI extension offset */
324 unsigned int touchid;
329 } XITouchOwnershipEvent;
333 extern Bool XIQueryPointer(
343 XIButtonState *buttons,
344 XIModifierState *mods,
348 extern Bool XIWarpPointer(
355 unsigned int src_width,
356 unsigned int src_height,
361 extern Status XIDefineCursor(
368 extern Status XIUndefineCursor(
374 extern Status XIChangeHierarchy(
376 XIAnyHierarchyChangeInfo* changes,
380 extern Status XISetClientPointer(
386 extern Bool XIGetClientPointer(
392 extern int XISelectEvents(
399 extern XIEventMask *XIGetSelectedEvents(
402 int *num_masks_return
405 extern Status XIQueryVersion(
407 int* major_version_inout,
408 int* minor_version_inout
411 extern XIDeviceInfo* XIQueryDevice(
417 extern Status XISetFocus(
424 extern Status XIGetFocus(
427 Window *focus_return);
429 extern Status XIGrabDevice(
436 int paired_device_mode,
441 extern Status XIUngrabDevice(
447 extern Status XIAllowEvents(
454 extern Status XIAllowTouchEvents(
457 unsigned int touchid,
462 extern int XIGrabButton(
469 int paired_device_mode,
473 XIGrabModifiers *modifiers_inout
476 extern int XIGrabKeycode(
482 int paired_device_mode,
486 XIGrabModifiers *modifiers_inout
489 extern int XIGrabEnter(
495 int paired_device_mode,
499 XIGrabModifiers *modifiers_inout
502 extern int XIGrabFocusIn(
507 int paired_device_mode,
511 XIGrabModifiers *modifiers_inout
514 extern int XIGrabTouchBegin(
521 XIGrabModifiers *modifiers_inout
524 extern Status XIUngrabButton(
530 XIGrabModifiers *modifiers
533 extern Status XIUngrabKeycode(
539 XIGrabModifiers *modifiers
542 extern Status XIUngrabEnter(
547 XIGrabModifiers *modifiers
550 extern Status XIUngrabFocusIn(
555 XIGrabModifiers *modifiers
558 extern Status XIUngrabTouchBegin(
563 XIGrabModifiers *modifiers
566 extern Atom *XIListProperties(
569 int *num_props_return
572 extern void XIChangeProperty(
597 Bool delete_property,
601 unsigned long *num_items_return,
602 unsigned long *bytes_after_return,
606 extern void XIFreeDeviceInfo(XIDeviceInfo *info);
610 #endif /* XINPUT2_H */