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>
33 #include <X11/extensions/Xfixes.h> /* PointerBarrier */
35 /*******************************************************************
48 int return_mode; /* AttachToMaster, Floating */
65 int type; /* must be first element */
67 XIRemoveMasterInfo remove;
68 XIAttachSlaveInfo attach;
69 XIDetachSlaveInfo detach;
70 } XIAnyHierarchyChangeInfo;
80 typedef XIModifierState XIGroupState;
135 } XIValuatorClassInfo;
164 XIAnyClassInfo **classes;
173 typedef unsigned int BarrierEventID;
178 PointerBarrier barrier;
179 BarrierEventID eventid;
180 } XIBarrierReleasePointerInfo;
183 * Generic XI2 event. All XI2 events have the same header.
186 int type; /* GenericEvent */
187 unsigned long serial; /* # of last request processed by server */
188 Bool send_event; /* true if this came from a SendEvent request */
189 Display *display; /* Display the event was read from */
190 int extension; /* XI extension offset */
205 * Notifies the client that the device hierarchy has been changed. The client
206 * is expected to re-query the server for the device hierarchy.
209 int type; /* GenericEvent */
210 unsigned long serial; /* # of last request processed by server */
211 Bool send_event; /* true if this came from a SendEvent request */
212 Display *display; /* Display the event was read from */
213 int extension; /* XI extension offset */
214 int evtype; /* XI_HierarchyChanged */
218 XIHierarchyInfo *info;
222 * Notifies the client that the classes have been changed. This happens when
223 * the slave device that sends through the master changes.
226 int type; /* GenericEvent */
227 unsigned long serial; /* # of last request processed by server */
228 Bool send_event; /* true if this came from a SendEvent request */
229 Display *display; /* Display the event was read from */
230 int extension; /* XI extension offset */
231 int evtype; /* XI_DeviceChanged */
233 int deviceid; /* id of the device that changed */
234 int sourceid; /* Source for the new classes. */
235 int reason; /* Reason for the change */
237 XIAnyClassInfo **classes; /* same as in XIDeviceInfo */
238 } XIDeviceChangedEvent;
241 int type; /* GenericEvent */
242 unsigned long serial; /* # of last request processed by server */
243 Bool send_event; /* true if this came from a SendEvent request */
244 Display *display; /* Display the event was read from */
245 int extension; /* XI extension offset */
259 XIButtonState buttons;
260 XIValuatorState valuators;
261 XIModifierState mods;
266 int type; /* GenericEvent */
267 unsigned long serial; /* # of last request processed by server */
268 Bool send_event; /* true if this came from a SendEvent request */
269 Display *display; /* Display the event was read from */
270 int extension; /* XI extension offset */
271 int evtype; /* XI_RawKeyPress, XI_RawKeyRelease, etc. */
274 int sourceid; /* Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */
277 XIValuatorState valuators;
282 int type; /* GenericEvent */
283 unsigned long serial; /* # of last request processed by server */
284 Bool send_event; /* true if this came from a SendEvent request */
285 Display *display; /* Display the event was read from */
286 int extension; /* XI extension offset */
302 XIButtonState buttons;
303 XIModifierState mods;
307 typedef XIEnterEvent XILeaveEvent;
308 typedef XIEnterEvent XIFocusInEvent;
309 typedef XIEnterEvent XIFocusOutEvent;
312 int type; /* GenericEvent */
313 unsigned long serial; /* # of last request processed by server */
314 Bool send_event; /* true if this came from a SendEvent request */
315 Display *display; /* Display the event was read from */
316 int extension; /* XI extension offset */
317 int evtype; /* XI_PropertyEvent */
319 int deviceid; /* id of the device that changed */
325 int type; /* GenericEvent */
326 unsigned long serial; /* # of last request processed by server */
327 Bool send_event; /* true if this came from a SendEvent request */
328 Display *display; /* Display the event was read from */
329 int extension; /* XI extension offset */
334 unsigned int touchid;
339 } XITouchOwnershipEvent;
342 int type; /* GenericEvent */
343 unsigned long serial; /* # of last request processed by server */
344 Bool send_event; /* true if this came from a SendEvent request */
345 Display *display; /* Display the event was read from */
346 int extension; /* XI extension offset */
359 PointerBarrier barrier;
360 BarrierEventID eventid;
365 extern Bool XIQueryPointer(
375 XIButtonState *buttons,
376 XIModifierState *mods,
380 extern Bool XIWarpPointer(
387 unsigned int src_width,
388 unsigned int src_height,
393 extern Status XIDefineCursor(
400 extern Status XIUndefineCursor(
406 extern Status XIChangeHierarchy(
408 XIAnyHierarchyChangeInfo* changes,
412 extern Status XISetClientPointer(
418 extern Bool XIGetClientPointer(
424 extern int XISelectEvents(
431 extern XIEventMask *XIGetSelectedEvents(
434 int *num_masks_return
437 extern Status XIQueryVersion(
439 int* major_version_inout,
440 int* minor_version_inout
443 extern XIDeviceInfo* XIQueryDevice(
449 extern Status XISetFocus(
456 extern Status XIGetFocus(
459 Window *focus_return);
461 extern Status XIGrabDevice(
468 int paired_device_mode,
473 extern Status XIUngrabDevice(
479 extern Status XIAllowEvents(
486 extern Status XIAllowTouchEvents(
489 unsigned int touchid,
494 extern int XIGrabButton(
501 int paired_device_mode,
505 XIGrabModifiers *modifiers_inout
508 extern int XIGrabKeycode(
514 int paired_device_mode,
518 XIGrabModifiers *modifiers_inout
521 extern int XIGrabEnter(
527 int paired_device_mode,
531 XIGrabModifiers *modifiers_inout
534 extern int XIGrabFocusIn(
539 int paired_device_mode,
543 XIGrabModifiers *modifiers_inout
546 extern int XIGrabTouchBegin(
553 XIGrabModifiers *modifiers_inout
556 extern Status XIUngrabButton(
562 XIGrabModifiers *modifiers
565 extern Status XIUngrabKeycode(
571 XIGrabModifiers *modifiers
574 extern Status XIUngrabEnter(
579 XIGrabModifiers *modifiers
582 extern Status XIUngrabFocusIn(
587 XIGrabModifiers *modifiers
590 extern Status XIUngrabTouchBegin(
595 XIGrabModifiers *modifiers
598 extern Atom *XIListProperties(
601 int *num_props_return
604 extern void XIChangeProperty(
629 Bool delete_property,
633 unsigned long *num_items_return,
634 unsigned long *bytes_after_return,
639 XIBarrierReleasePointers(
641 XIBarrierReleasePointerInfo *barriers,
646 XIBarrierReleasePointer(
649 PointerBarrier barrier,
650 BarrierEventID eventid
653 extern void XIFreeDeviceInfo(XIDeviceInfo *info);
657 #endif /* XINPUT2_H */