From f6838e26a85e748c03ede2cd670858d682395e67 Mon Sep 17 00:00:00 2001 From: Sehong Na Date: Sat, 31 May 2014 12:46:09 +0900 Subject: [PATCH 1/1] Initialize Tizen 2.3 --- COPYING | 84 + ChangeLog | 3887 +++++++++++++++ INSTALL | 291 ++ Makefile.am | 16 + README | 25 + configure.ac | 56 + docbook.am | 105 + include/X11/extensions/XInput.h | 1277 +++++ include/X11/extensions/XInput2.h | 610 +++ man/Makefile.am | 185 + man/XAllowDeviceEvents.man | 178 + man/XAllowDeviceEvents.txt | 133 + man/XChangeDeviceControl.man | 1 + man/XChangeDeviceDontPropagateList.man | 197 + man/XChangeDeviceDontPropagateList.txt | 92 + man/XChangeDeviceKeyMapping.man | 1 + man/XChangeDeviceProperty.man | 1 + man/XChangeFeedbackControl.man | 1 + man/XChangeKeyboardDevice.man | 147 + man/XChangeKeyboardDevice.txt | 68 + man/XChangePointerDevice.man | 163 + man/XChangePointerDevice.txt | 79 + man/XCloseDevice.man | 1 + man/XDeleteDeviceProperty.man | 1 + man/XDeviceBell.man | 169 + man/XDeviceBell.txt | 78 + man/XDeviceTimeCoord.man | 1 + man/XFreeDeviceList.man | 1 + man/XGetDeviceButtonMapping.man | 1 + man/XGetDeviceControl.man | 285 ++ man/XGetDeviceControl.txt | 126 + man/XGetDeviceDontPropagateList.man | 1 + man/XGetDeviceFocus.man | 1 + man/XGetDeviceKeyMapping.man | 361 ++ man/XGetDeviceKeyMapping.txt | 146 + man/XGetDeviceModifierMapping.man | 257 + man/XGetDeviceModifierMapping.txt | 118 + man/XGetDeviceMotionEvents.man | 230 + man/XGetDeviceMotionEvents.txt | 109 + man/XGetDeviceProperty.man | 225 + man/XGetDeviceProperty.txt | 160 + man/XGetExtensionVersion.man | 117 + man/XGetExtensionVersion.txt | 51 + man/XGetFeedbackControl.man | 584 +++ man/XGetFeedbackControl.txt | 273 + man/XGetSelectedExtensionEvents.man | 1 + man/XGrabDevice.man | 294 ++ man/XGrabDevice.txt | 159 + man/XGrabDeviceButton.man | 325 ++ man/XGrabDeviceButton.txt | 170 + man/XGrabDeviceKey.man | 348 ++ man/XGrabDeviceKey.txt | 177 + man/XIChangeHierarchy.man | 299 ++ man/XIChangeHierarchy.txt | 120 + man/XIChangeProperty.man | 281 ++ man/XIChangeProperty.txt | 235 + man/XIDefineCursor.man | 190 + man/XIDefineCursor.txt | 79 + man/XIDeleteProperty.man | 1 + man/XIFreeDeviceInfo.man | 1 + man/XIGetClientPointer.man | 1 + man/XIGetFocus.man | 1 + man/XIGetProperty.man | 1 + man/XIGetSelectedEvents.man | 1 + man/XIGrabButton.man | 423 ++ man/XIGrabButton.txt | 238 + man/XIGrabDevice.man | 318 ++ man/XIGrabDevice.txt | 154 + man/XIGrabEnter.man | 379 ++ man/XIGrabEnter.txt | 197 + man/XIGrabFocusIn.man | 1 + man/XIGrabKeycode.man | 1 + man/XIListProperties.man | 70 + man/XIListProperties.txt | 54 + man/XIQueryDevice.man | 671 +++ man/XIQueryDevice.txt | 273 + man/XIQueryPointer.man | 205 + man/XIQueryPointer.txt | 102 + man/XIQueryVersion.man | 153 + man/XIQueryVersion.txt | 72 + man/XISelectEvents.man | 223 + man/XISelectEvents.txt | 98 + man/XISetClientPointer.man | 161 + man/XISetClientPointer.txt | 69 + man/XISetFocus.man | 191 + man/XISetFocus.txt | 86 + man/XIUndefineCursor.man | 1 + man/XIUngrabButton.man | 1 + man/XIUngrabDevice.man | 1 + man/XIUngrabEnter.man | 1 + man/XIUngrabFocusIn.man | 1 + man/XIUngrabKeycode.man | 1 + man/XIWarpPointer.man | 185 + man/XIWarpPointer.txt | 89 + man/XListDeviceProperties.man | 119 + man/XListDeviceProperties.txt | 53 + man/XListInputDevices.man | 566 +++ man/XListInputDevices.txt | 224 + man/XOpenDevice.man | 254 + man/XOpenDevice.txt | 113 + man/XQueryDeviceState.man | 205 + man/XQueryDeviceState.txt | 84 + man/XSelectExtensionEvent.man | 241 + man/XSelectExtensionEvent.txt | 123 + man/XSendExtensionEvent.man | 206 + man/XSendExtensionEvent.txt | 114 + man/XSetDeviceButtonMapping.man | 192 + man/XSetDeviceButtonMapping.txt | 97 + man/XSetDeviceFocus.man | 297 ++ man/XSetDeviceFocus.txt | 154 + man/XSetDeviceMode.man | 125 + man/XSetDeviceMode.txt | 57 + man/XSetDeviceModifierMapping.man | 1 + man/XSetDeviceValuators.man | 153 + man/XSetDeviceValuators.txt | 74 + man/XUngrabDevice.man | 1 + man/XUngrabDeviceButton.man | 1 + man/XUngrabDeviceKey.man | 1 + packaging/libXi.spec | 92 + specs/Makefile.am | 16 + specs/encoding.xml | 2312 +++++++++ specs/inputlib.xml | 75 + specs/library.xml | 8559 ++++++++++++++++++++++++++++++++ src/Makefile.am | 82 + src/XAllowDv.c | 87 + src/XChDProp.c | 106 + src/XChgDCtl.c | 234 + src/XChgFCtl.c | 194 + src/XChgKMap.c | 95 + src/XChgKbd.c | 88 + src/XChgPnt.c | 92 + src/XChgProp.c | 98 + src/XCloseDev.c | 85 + src/XDelDProp.c | 64 + src/XDevBell.c | 90 + src/XExtInt.c | 1987 ++++++++ src/XExtToWire.c | 487 ++ src/XFreeLst.c | 72 + src/XGMotion.c | 140 + src/XGetBMap.c | 107 + src/XGetCPtr.c | 70 + src/XGetDCtl.c | 242 + src/XGetDProp.c | 139 + src/XGetFCtl.c | 267 + src/XGetKMap.c | 108 + src/XGetMMap.c | 102 + src/XGetProp.c | 114 + src/XGetVers.c | 117 + src/XGrDvBut.c | 112 + src/XGrDvKey.c | 114 + src/XGrabDev.c | 108 + src/XGtFocus.c | 91 + src/XGtSelect.c | 142 + src/XIAllowEvents.c | 102 + src/XIDefineCursor.c | 69 + src/XIGetDevFocus.c | 65 + src/XIGrabDevice.c | 108 + src/XIHierarchy.c | 162 + src/XIPassiveGrab.c | 246 + src/XIProperties.c | 242 + src/XIQueryDevice.c | 124 + src/XIQueryPointer.c | 107 + src/XIQueryVersion.c | 90 + src/XISelEv.c | 176 + src/XISetCPtr.c | 65 + src/XISetDevFocus.c | 59 + src/XIWarpPointer.c | 80 + src/XIint.h | 85 + src/XListDProp.c | 82 + src/XListDev.c | 274 + src/XOpenDev.c | 109 + src/XQueryDv.c | 187 + src/XSelect.c | 94 + src/XSetBMap.c | 92 + src/XSetDVal.c | 99 + src/XSetMMap.c | 92 + src/XSetMode.c | 87 + src/XSndExEv.c | 124 + src/XStFocus.c | 89 + src/XUngrDev.c | 86 + src/XUngrDvB.c | 93 + src/XUngrDvK.c | 93 + xi.pc.in | 12 + 183 files changed, 41732 insertions(+) create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 README create mode 100644 configure.ac create mode 100644 docbook.am create mode 100644 include/X11/extensions/XInput.h create mode 100644 include/X11/extensions/XInput2.h create mode 100644 man/Makefile.am create mode 100644 man/XAllowDeviceEvents.man create mode 100644 man/XAllowDeviceEvents.txt create mode 100644 man/XChangeDeviceControl.man create mode 100644 man/XChangeDeviceDontPropagateList.man create mode 100644 man/XChangeDeviceDontPropagateList.txt create mode 100644 man/XChangeDeviceKeyMapping.man create mode 100644 man/XChangeDeviceProperty.man create mode 100644 man/XChangeFeedbackControl.man create mode 100644 man/XChangeKeyboardDevice.man create mode 100644 man/XChangeKeyboardDevice.txt create mode 100644 man/XChangePointerDevice.man create mode 100644 man/XChangePointerDevice.txt create mode 100644 man/XCloseDevice.man create mode 100644 man/XDeleteDeviceProperty.man create mode 100644 man/XDeviceBell.man create mode 100644 man/XDeviceBell.txt create mode 100644 man/XDeviceTimeCoord.man create mode 100644 man/XFreeDeviceList.man create mode 100644 man/XGetDeviceButtonMapping.man create mode 100644 man/XGetDeviceControl.man create mode 100644 man/XGetDeviceControl.txt create mode 100644 man/XGetDeviceDontPropagateList.man create mode 100644 man/XGetDeviceFocus.man create mode 100644 man/XGetDeviceKeyMapping.man create mode 100644 man/XGetDeviceKeyMapping.txt create mode 100644 man/XGetDeviceModifierMapping.man create mode 100644 man/XGetDeviceModifierMapping.txt create mode 100644 man/XGetDeviceMotionEvents.man create mode 100644 man/XGetDeviceMotionEvents.txt create mode 100644 man/XGetDeviceProperty.man create mode 100644 man/XGetDeviceProperty.txt create mode 100644 man/XGetExtensionVersion.man create mode 100644 man/XGetExtensionVersion.txt create mode 100644 man/XGetFeedbackControl.man create mode 100644 man/XGetFeedbackControl.txt create mode 100644 man/XGetSelectedExtensionEvents.man create mode 100644 man/XGrabDevice.man create mode 100644 man/XGrabDevice.txt create mode 100644 man/XGrabDeviceButton.man create mode 100644 man/XGrabDeviceButton.txt create mode 100644 man/XGrabDeviceKey.man create mode 100644 man/XGrabDeviceKey.txt create mode 100644 man/XIChangeHierarchy.man create mode 100644 man/XIChangeHierarchy.txt create mode 100644 man/XIChangeProperty.man create mode 100644 man/XIChangeProperty.txt create mode 100644 man/XIDefineCursor.man create mode 100644 man/XIDefineCursor.txt create mode 100644 man/XIDeleteProperty.man create mode 100644 man/XIFreeDeviceInfo.man create mode 100644 man/XIGetClientPointer.man create mode 100644 man/XIGetFocus.man create mode 100644 man/XIGetProperty.man create mode 100644 man/XIGetSelectedEvents.man create mode 100644 man/XIGrabButton.man create mode 100644 man/XIGrabButton.txt create mode 100644 man/XIGrabDevice.man create mode 100644 man/XIGrabDevice.txt create mode 100644 man/XIGrabEnter.man create mode 100644 man/XIGrabEnter.txt create mode 100644 man/XIGrabFocusIn.man create mode 100644 man/XIGrabKeycode.man create mode 100644 man/XIListProperties.man create mode 100644 man/XIListProperties.txt create mode 100644 man/XIQueryDevice.man create mode 100644 man/XIQueryDevice.txt create mode 100644 man/XIQueryPointer.man create mode 100644 man/XIQueryPointer.txt create mode 100644 man/XIQueryVersion.man create mode 100644 man/XIQueryVersion.txt create mode 100644 man/XISelectEvents.man create mode 100644 man/XISelectEvents.txt create mode 100644 man/XISetClientPointer.man create mode 100644 man/XISetClientPointer.txt create mode 100644 man/XISetFocus.man create mode 100644 man/XISetFocus.txt create mode 100644 man/XIUndefineCursor.man create mode 100644 man/XIUngrabButton.man create mode 100644 man/XIUngrabDevice.man create mode 100644 man/XIUngrabEnter.man create mode 100644 man/XIUngrabFocusIn.man create mode 100644 man/XIUngrabKeycode.man create mode 100644 man/XIWarpPointer.man create mode 100644 man/XIWarpPointer.txt create mode 100644 man/XListDeviceProperties.man create mode 100644 man/XListDeviceProperties.txt create mode 100644 man/XListInputDevices.man create mode 100644 man/XListInputDevices.txt create mode 100644 man/XOpenDevice.man create mode 100644 man/XOpenDevice.txt create mode 100644 man/XQueryDeviceState.man create mode 100644 man/XQueryDeviceState.txt create mode 100644 man/XSelectExtensionEvent.man create mode 100644 man/XSelectExtensionEvent.txt create mode 100644 man/XSendExtensionEvent.man create mode 100644 man/XSendExtensionEvent.txt create mode 100644 man/XSetDeviceButtonMapping.man create mode 100644 man/XSetDeviceButtonMapping.txt create mode 100644 man/XSetDeviceFocus.man create mode 100644 man/XSetDeviceFocus.txt create mode 100644 man/XSetDeviceMode.man create mode 100644 man/XSetDeviceMode.txt create mode 100644 man/XSetDeviceModifierMapping.man create mode 100644 man/XSetDeviceValuators.man create mode 100644 man/XSetDeviceValuators.txt create mode 100644 man/XUngrabDevice.man create mode 100644 man/XUngrabDeviceButton.man create mode 100644 man/XUngrabDeviceKey.man create mode 100755 packaging/libXi.spec create mode 100644 specs/Makefile.am create mode 100644 specs/encoding.xml create mode 100644 specs/inputlib.xml create mode 100644 specs/library.xml create mode 100644 src/Makefile.am create mode 100644 src/XAllowDv.c create mode 100644 src/XChDProp.c create mode 100644 src/XChgDCtl.c create mode 100644 src/XChgFCtl.c create mode 100644 src/XChgKMap.c create mode 100644 src/XChgKbd.c create mode 100644 src/XChgPnt.c create mode 100644 src/XChgProp.c create mode 100644 src/XCloseDev.c create mode 100644 src/XDelDProp.c create mode 100644 src/XDevBell.c create mode 100644 src/XExtInt.c create mode 100644 src/XExtToWire.c create mode 100644 src/XFreeLst.c create mode 100644 src/XGMotion.c create mode 100644 src/XGetBMap.c create mode 100644 src/XGetCPtr.c create mode 100644 src/XGetDCtl.c create mode 100644 src/XGetDProp.c create mode 100644 src/XGetFCtl.c create mode 100644 src/XGetKMap.c create mode 100644 src/XGetMMap.c create mode 100644 src/XGetProp.c create mode 100644 src/XGetVers.c create mode 100644 src/XGrDvBut.c create mode 100644 src/XGrDvKey.c create mode 100644 src/XGrabDev.c create mode 100644 src/XGtFocus.c create mode 100644 src/XGtSelect.c create mode 100644 src/XIAllowEvents.c create mode 100644 src/XIDefineCursor.c create mode 100644 src/XIGetDevFocus.c create mode 100644 src/XIGrabDevice.c create mode 100644 src/XIHierarchy.c create mode 100644 src/XIPassiveGrab.c create mode 100644 src/XIProperties.c create mode 100644 src/XIQueryDevice.c create mode 100644 src/XIQueryPointer.c create mode 100644 src/XIQueryVersion.c create mode 100644 src/XISelEv.c create mode 100644 src/XISetCPtr.c create mode 100644 src/XISetDevFocus.c create mode 100644 src/XIWarpPointer.c create mode 100644 src/XIint.h create mode 100644 src/XListDProp.c create mode 100644 src/XListDev.c create mode 100644 src/XOpenDev.c create mode 100644 src/XQueryDv.c create mode 100644 src/XSelect.c create mode 100644 src/XSetBMap.c create mode 100644 src/XSetDVal.c create mode 100644 src/XSetMMap.c create mode 100644 src/XSetMode.c create mode 100644 src/XSndExEv.c create mode 100644 src/XStFocus.c create mode 100644 src/XUngrDev.c create mode 100644 src/XUngrDvB.c create mode 100644 src/XUngrDvK.c create mode 100644 xi.pc.in diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..3b8f4fd --- /dev/null +++ b/COPYING @@ -0,0 +1,84 @@ +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +Copyright 2008 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +Copyright © 2009 Red Hat, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..dcca8e8 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3887 @@ +commit ae163b6202d844a46541928d00049b29cbdf930f +Author: Peter Hutterer +Date: Thu May 3 16:01:35 2012 +1000 + + libXi 1.6.1 + + Signed-off-by: Peter Hutterer + +commit fd5e000308925f703ecd15c288127ab33a456425 +Author: Peter Hutterer +Date: Mon Apr 23 13:32:59 2012 +1000 + + man: update XIQueryVersion for current server behaviour + + XIQueryVersion(v1); + XIQueryVersion(v2); + + is now ok as long as v1 <= v2. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + +commit f8f44f42eb543ecd944a84facba6c09bf48e7711 +Author: Chase Douglas +Date: Fri Apr 20 15:30:30 2012 -0700 + + Destroy extension record after last display is removed + + The extension record is currently leaked and never freed. + + Signed-off-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 2ac185d2fd2b884f4f59a7f7f61f414d139859aa +Author: Peter Hutterer +Date: Mon Mar 26 09:07:34 2012 +1000 + + Set the RawEvent sourceid (#34240) + + XI 2.2 and later include the sourceid in raw events. + + X.Org Bug 34240 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit dfc101e4c6cdac4ff9a51732b2754287fbdc8582 +Author: Peter Hutterer +Date: Mon Mar 26 09:05:24 2012 +1000 + + Move version comparison into a helper function. + + No functional changes, this simply introduces a version helper function that + returns -1, 0 or 1 depending on the version comparison result. To be used + internally only. + + Needed for fix to #34240 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 8436c920953f288aea2d6d5f370f8eaaaef82d97 +Author: Peter Hutterer +Date: Thu Mar 15 11:51:41 2012 +1000 + + Fix wrong button label and mask copy on OS X + + Regression introduced in c1a5a70b51f12dedf354102217c7cd4247ed3a4b. + + If double-padding is applied, the length of the mask on the wire may be + smaller than libXi's mask_len. When copying, only the wire length must be + copied, with the remainder set to 0. + When advancing to the button labels, the wire length matters, not libXi's + internal length. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Tested-by: Jeremy Huddleston + +commit 70b730b0548ca9e408f14f2576b972beb32a0ad0 +Author: Peter Hutterer +Date: Thu Mar 8 16:03:50 2012 +1000 + + libXi 1.6.0 + + Signed-off-by: Peter Hutterer + +commit 1b9f0394c3d4d3833f8560ae8170a4d5842419ab +Author: Chase Douglas +Date: Wed Mar 7 14:52:54 2012 -0800 + + Fix XIScrollClass increment value on 32-bit machines + + This fixes scroll class increment values on 32-bit machines. Performing + 1UL << 32 shifts the bit off the end of a 32-bit unsigned long value. By + expanding to 1ULL, we have the full 64-bits of an unsigned long long + including on 32-bit machines. + + Before this change, xinput list --long would output scroll increment + values of -nan. + + Signed-off-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit c1a5a70b51f12dedf354102217c7cd4247ed3a4b +Author: Michał Masłowski +Date: Tue Feb 21 20:54:40 2012 +0100 + + Fix bus error on MIPS N32 for bug #38331. + + XIValuatorClassInfo and XIScrollClassInfo might have an address + of 4 bytes modulo 8, while they contain doubles which need 8 byte + alignment. This is fixed by adding extra padding after each structure + or array in sizeDeviceClassType and adding helper functions to + determine sizes and padding only in one place. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38331 + Signed-off-by: Michał Masłowski + Signed-off-by: Peter Hutterer + +commit 34964b05c16161de65709d60799b9ad97ce56296 +Author: Peter Hutterer +Date: Fri Jan 27 15:35:44 2012 +1000 + + libXi 1.5.99.3 + + Signed-off-by: Peter Hutterer + +commit b355b7300235395717de06809ee6631ce55d3189 +Author: Peter Hutterer +Date: Fri Jan 27 13:28:52 2012 +1000 + + Handle new XIAllowEvent request size + + inputproto 2.1.99.6 restored the previous request for ABI compatibility + reasons, and it introduced a new XI 2.2 specific define. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 07ced7b48219e3bc0c98806f3d7106f86d1b2ca0 +Author: Peter Hutterer +Date: Tue Jan 17 21:26:14 2012 +0100 + + Force class alignment to a multiple of sizeof(XID). + + Calculate length field to a multiples of sizeof(XID). XIDs are typedefs + to ulong and thus may be 8 bytes on some platforms. This can trigger a + SIGBUS if a class ends up not being 8-aligned (e.g. after XAxisInfo). + + Reported-by: Nicolai Stange + Signed-off-by: Peter Hutterer + Signed-off-by: Matthieu Herrb + +commit 15feb92b30e13e7439a3434bea9f454645b97444 +Author: Peter Hutterer +Date: Thu Jan 5 13:55:41 2012 +1000 + + man: fix typo Mappiing → Mapping + + Signed-off-by: Peter Hutterer + +commit 8576ae6b9ee974829e2fb8a834087652a6e9e1a2 +Author: Cyril Brulebois +Date: Thu Dec 22 15:50:47 2011 +0100 + + configure.ac: Fix a typo in comments. + + Signed-off-by: Cyril Brulebois + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit ae0187c8708d2378373889827117911086581fdd +Author: Peter Hutterer +Date: Thu Dec 22 09:42:43 2011 +1000 + + libXi 1.5.99.2 + + Signed-off-by: Peter Hutterer + +commit 47f3d887a7731f4ab68a69ed31dbe7acf6d13270 +Merge: 82a6312 e73e2fe +Author: Peter Hutterer +Date: Wed Dec 21 15:40:37 2011 +1000 + + Merge branch 'multitouch' + + Conflicts: + configure.ac + +commit 82a631263ef4e6f46c1f33748089db8bf603b095 +Author: Peter Hutterer +Date: Wed Dec 21 15:33:17 2011 +1000 + + libXi 1.5.0 + + Signed-off-by: Peter Hutterer + +commit e73e2fe95dab3e0048b24d16327adbe54326ff3f +Author: Peter Hutterer +Date: Wed Sep 14 22:33:57 2011 -0700 + + Implement support for XI 2.2 + + Adds support for the new TouchClass for multitouch-capable servers/devices. + + New events: + XITouchOwnershipEvent + + New event types handled: + XITouchBegin, XITouchUpdate, XITouchEnd + XIRawTouchBegin, XIRawTouchUpdate, XIRawTouchEnd + + New functions: + XIGrabTouchBegin ... passive grabs on touches + XIUngrabTouchBegin + XIAllowTouchEvents ... Allow/reject touch event sequences + + New XIQueryDevice classes: + XITouchClassInfo + + Requires libX11 1.5 for GetReqSized + + Co-authored by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 7888d14a499062a1c3b333f31f1330cecf1e97c1 +Author: Peter Hutterer +Date: Tue Oct 25 13:30:47 2011 +1000 + + Bump to 1.5.99.1 + + Signed-off-by: Peter Hutterer + +commit fa6505f0a86b296e8f12f0fb8f472ef17b501fdb +Author: Peter Hutterer +Date: Mon Dec 19 09:36:34 2011 +1000 + + man: minor formatting fix in XIGrabButton + +commit 49408e39e4b084fe362e9ee197bfa0aa1c55384d +Author: Peter Hutterer +Date: Fri Nov 11 15:32:21 2011 +1000 + + Include config.h from source files + + Signed-off-by: Peter Hutterer + Reviewed-by: Gaetan Nadon + Reviewed-by: Jeremy Huddleston + +commit ba83a1e58592e41f207524f106ba26dd71fe4171 +Author: Peter Hutterer +Date: Wed Oct 26 08:55:35 2011 +1000 + + Stop unnecessary calls to size_classes + + Xmalloc is a macro evaluating its argument twice. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + +commit 6d6ae8fc8b9620bf864ac7dff8d818573eee3e4f +Author: Peter Hutterer +Date: Wed Oct 26 08:54:53 2011 +1000 + + Fix duplicate sizeof in copy_classes + + sizeof(bla * sizeof()) is'nt right. + + Plus add some () to the next_block call too to emphasise that *nclasses is + the multiplicator. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + +commit 323730f7fa70190d2ea00e62c6964fee524ca430 +Author: Peter Hutterer +Date: Thu Oct 27 10:27:49 2011 +1000 + + man: passive grabs return the number of failed modifier combinations + + Signed-off-by: Peter Hutterer + +commit 5189df57e18c79327848fb117a8ede59868c8fdb +Author: Peter Hutterer +Date: Fri Oct 21 08:49:31 2011 +1000 + + man: XIGrabButton returns error codes, not status codes + + Reword slightly that the returned value is the error code for this + particular grab. + + Signed-off-by: Peter Hutterer + +commit 05aaf65b3b6b7dc7268137ce4ee516f08eefb62f +Author: Peter Hutterer +Date: Fri Oct 21 08:07:45 2011 +1000 + + man: fix #include for XIGrabButton + + Reported-by: Matthias Clasen + Signed-off-by: Peter Hutterer + +commit c25debae73be50b9a77454ed4d72ffeaab726846 +Author: Peter Hutterer +Date: Mon Oct 10 10:24:38 2011 +1000 + + Bump to 1.4.99.1 + + Signed-off-by: Peter Hutterer + +commit 7ca05f3094958c04e8f78a786061124c58f8e1f3 +Author: Peter Hutterer +Date: Wed Sep 28 11:16:42 2011 +1000 + + Remove superfluous assignment of lib->classes in XIQueryDevices. + + A few lines south from here we malloc lib->classes, this assignment is a + leftover from 225071e2e67fb65a0258397212f9826c9b25e078. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit e97c3dd00369b47af067e30e910335b199a2f147 +Author: Matt Dew +Date: Mon Oct 3 22:05:51 2011 -0600 + + 1 - fix the capitalization of the ID attriutes to match either the + or <funcdef> string it goes with. + 2 - fix any <linkend>'s that were affected by 1. + 3 - any <function> in the docs that has an actual funcdef, + will become an olink. + + Signed-off-by: Matt Dew <marcoz@osource.org> + +commit 5f9df47340e192d095127e3c7da180b0fb3dc286 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Sep 23 09:04:21 2011 +1000 + + Use a separate nclasses variable in XIQueryDevice + + No functional changes, just clarifying the code. If we skip over unknown + classes, lib->num_classes != wire->num_classe. Use a separate variable to + make that change more explicit and align the code closer with + wireToDeviceChangedEvent. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit 2eb34db82dbd8429594c7ce1d361cabf3571edf1 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Sep 16 21:00:19 2011 -0700 + + Make shadow man pages generated by asciidoc work with Solaris man + + Solaris man requires .so entries in man pages include the man section + directory, not just the man page filename, even when it's in the same + directory, so use sed to add it in. + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + + This may be a temporary fix only. See + http://lists.freedesktop.org/archives/xorg-devel/2011-September/025219.html + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit a43c0a5d2a6cf80df314c96e0b58804dd87868be +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Sep 20 15:11:13 2011 -0400 + + specs: refactor and complete copyright legal text + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 552f60789263ad2a1d983cf5b479af63d90f7591 +Author: Jeremy Huddleston <jeremyhu@apple.com> +Date: Sun Sep 18 00:53:56 2011 -0700 + + Use AM_CPPFLAGS to use in tree headers before installed headers + + This addresses a build failure found by the tinderbox. + + Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> + Reviewed-by: Gaetan Nadon <memsize@videotron.ca> + +commit 69f2580fd47cfe24105892e9ffb79cd046954b7d +Merge: fc5d478 3ed1b46 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sat Sep 17 06:41:30 2011 +1000 + + Merge branch 'smooth-scrolling' + + Conflicts: + src/XExtInt.c + +commit 3ed1b463205295a5ebba7d570a4cb8dfade51a38 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 17 14:50:39 2011 +1000 + + Support XI 2.1 XIScrollClass + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 00382417331d0b38373796fd31757be9fd3e9971 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jun 2 13:23:32 2011 +1000 + + Support XI 2.1 internally + + Add the required constants to pretend to support XI 2.1. + Having named constants for 2.1 seems a bit pointless, so let's just use the + numbers directly. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit fc5d47895c1361763aa7f088b6d8cb3859e3fda8 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sat Sep 17 06:40:01 2011 +1000 + + Require inputproto 2.0.99.1 or later + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4dcbad7e10289317edc22113c1f451d79df221e1 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 3 15:46:47 2011 +1000 + + man: update property and grab man pages for new constants + + Suggest the use of the new XIGrabModeAsync, etc. defines instead of the core + defines. Add a BUGS section to each man page explaining + backwards-compatibility. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit 14f674296bc23b3cd50f6d302c3064250132c2c1 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Aug 22 13:55:56 2011 +1000 + + man: fix typo in XIQueryDevice man page + + struct name is XIValuatorClassInfo. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 91f928a70246c26cbee00bf59a8e318e9317142e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 17 15:20:48 2011 +1000 + + Handle unknown device classes. + + If the server sends an unknown device class in response to an XIQueryDevice + call, no memory is allocated for these classes but we still write type + and sourceid as well as setting to->classes[i]. The latter causes multiple + classes to point to the same memory field. + + Move the common code of assigning these three into the respective class type + handlers so to automatically skip any unknown classes. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit f5b4ff2b4bbac5477af337ed63d019b1f1bc21c9 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Sep 15 11:58:31 2011 -0400 + + inputlib: restore original title "X Input Device Extension Library" + + Somehow the title got changed during troff to docbook conversion. + Latest troff version: + ftp://www.x.org/pub/X11R7.0/doc/PDF/XiLib.pdf + + Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 5174411eb67ff672abb3301268bd4fe06851ce3e +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Sep 15 11:57:12 2011 -0400 + + inputlib: prefix 1.0 with the word Version + + To be consistent with all other docs + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit b695f07ac85e76c7502a743343aacb2c93318ac5 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Sep 15 11:56:33 2011 -0400 + + inputlib: fix copyright statements + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit d8aea9731674ecb4e313051f866966113473e395 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Sep 12 16:54:45 2011 -0400 + + docs: use the &fullrelvers; entity to set X11 release information + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit b4690e1d9d0a27e04c7204614c0e88edef210ba7 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 11 19:49:54 2011 -0400 + + docs: remove <productnumber> which is not used by default + + This element is not rendered by default on the title. A template + customization is required to display it. + X Window System does not have a product number. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 83a3f9d1b06391d5c25602c0b6a3dba63e7abc81 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Sep 8 20:00:00 2011 -0400 + + docbook.am: embed css styles inside the HTML HEAD element + + Rather than referring to the external xorg.css stylesheet, embed the content + of the file in the html output produced. This is accomplished by using + version 1.10 of xorg-xhtml.xsl. + + This makes the whole html docs tree much more relocatable. + In addition, it eliminates xorg.css as a runtime file which makes + xorg-sgml-doctools a build time only package. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit bd4c9c82e889d737f3488c234659216a218d8eb2 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Sep 7 10:31:04 2011 -0400 + + docbook.am: global maintenance update - entities, images and olinking + + Adding support in libX11 for html chunking caused a reorg of docbook.am + as well as the xorg-sgml-doctools masterdb for olinking. + The parameter img.src.path is added for pdf images. + A searchpath to the root builddir is added for local entities, if present. + + The docbook.am makefile hides all the details and is identical for + all 22 modules having DocBook documentation. It is included by a thin + Makefile.am which requires no docbook knowledge. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 942dd55eb370e0acea3184de78619766a09f7670 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 3 15:46:47 2011 +1000 + + man: update property and grab man pages for new constants + + Suggest the use of the new XIGrabModeAsync, etc. defines instead of the core + defines. Add a BUGS section to each man page explaining + backwards-compatibility. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit eb5039859810a0fc4e4e594a4a1ccd99c5fecf85 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Aug 22 13:55:56 2011 +1000 + + man: fix typo in XIQueryDevice man page + + struct name is XIValuatorClassInfo. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 635c2c029b1e73311c3f650bcaf7eeb9e782134b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 17 15:20:48 2011 +1000 + + Handle unknown device classes. + + If the server sends an unknown device class in response to an XIQueryDevice + call, no memory is allocated for these classes but we still write type + and sourceid as well as setting to->classes[i]. The latter causes multiple + classes to point to the same memory field. + + Move the common code of assigning these three into the respective class type + handlers so to automatically skip any unknown classes. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit ca73cd3b7630e7eb7d26c61c4af10d35dbce5465 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Aug 12 14:24:26 2011 +1000 + + Don't use the protocol defines for 2.0 versioning. + + Otherwise we run into the old problem again: recompiling libXi against + newer inputproto headers will appear to change the version support, + potentially causing errors or other misbehaviours. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit 5a299d1731d3db16ccdd3a66246c81ca522f1702 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Mon Aug 1 16:47:38 2011 -0700 + + Fix the FIXME output in man page .TH macros generated by asciidoc + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit e8531dd6a981c6cf19a1d256c29e886e34e8f51a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Sep 7 15:21:31 2010 +1000 + + Add XI2 library-internal array offsets to XIint.h + + These defines are currently defined in XI.h and XI2.h. Their only use is as + offset into a library-internal array. Add them to XIint.h to have them where + they belong. + + These defines do not have any effect on the protocol. They are simply + offsets into an array for libXi-specific version checking. The defines are + added to this header for readability, given that we cannot remove them from + the protocol without potentially breaking clients (who should never use + these anyway, but...) means they will never get hit. + + Future defines for these offsets will only be added to libXi, not the + protocol. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 653b45b7cc275a560c1ea213216a908c125e443d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 24 10:09:10 2011 +1000 + + man: Fix formatting in XGetFeedbackControl + + Indent structs to make them more readable, make "Structures" header an + actual header. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 809c9e936b9f5234de03148376d389fdcfa6d40a +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Jun 12 18:39:46 2011 -0400 + + Install xml versions of specs even if HAVE_XMLTO is false + + DocBook/XML input source is also a usefull output format that can be viewed + with an XML viewer or editor and by some O/S help system. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 94f585af88a6486148ad6514f1f74eb83ce547ef +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Jun 5 16:27:37 2011 -0400 + + Install target dbs alongside generated documents + + This matches a change in xorg-sgml-docs whereby the masterdb will look for + the target dbs into the same location as the generated documents. + + The target dbs are now installed alongside the generated documents. + Previously they are installed in $prefix/sgml/X11/dbs alongside masterdb which + has the potential of installing outside the package prefix and cause + distcheck to fail when user does not have write permission in this package. + + Requires XORG_CHECK_SGML_DOCTOOLS(1.8) which was released 2011-06-11 + +commit 2d2581479c64b8b44ab91e90ecb04acd5d106ea2 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Jun 9 15:59:23 2011 -0400 + + make: use AM_V_at rather than AM_V_GEN to prefix the mv command + + This will prevent outputting a "GEN" prefix. Moving and removing files + is not "generating" anything. + + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit f4bdafebaf123c584e1b5e4ff1bc48f7cf4c5b26 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Jun 9 15:49:23 2011 -0400 + + make: remove unneeded AM_V_GEN silent rule directive. + + It happens to be in the middle of the script statement and cause this + incorrect output: + + rm XCloseDevice.man && make + GEN XOpenDevice.3 + /bin/bash: line 1: @echo: command not found + /bin/bash: line 2: @echo: command not found + [...] + + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit f4930482c24a22c8cdf9da3c96516936ddd1f7b9 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 7 14:12:08 2011 +1000 + + Bump to 1.4.99 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 938ef832b892fdefe0d5c2bb4510c91bbbccca9f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 3 15:10:27 2011 +1000 + + man: Fix typo in XIChangeProperty + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 597a6a51721d30c4354d1133bb6da6bd2e12446e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 3 15:02:35 2011 +1000 + + man: Fix wrong event names in XIGrabButton. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 7736957fa2598800c14a88cae1dd7809b184d743 +Author: Matt Dew <marcoz@osource.org> +Date: Tue May 31 20:03:23 2011 -0600 + + Add id attributes to funcsynopsis to allow other docs to olink to them. + + Signed-off-by: Matt Dew <marcoz@osource.org> + Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Gaetan Nadon <memsize@videotron.ca> + +commit 9faab2bc0bdd4d98a04e572a7a5201bfcd3bdc70 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jun 2 16:21:59 2011 +1000 + + Use Data, not Data32 in XIPassiveGrabDevice + + Data32 takes and iterates over an array of longs, thus skipping every 4 + bytes on LP64. Here we only have arrays of ints, use the normal Data macro + instead. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit 67441d30df756eb715a262d3439865dedd4055e8 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jun 2 14:17:44 2011 +1000 + + man: fix missing comma in XIGrabEnter man page + +commit 4a694b3f4f5c92d62526ea1c5461c59df86c13db +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 5 09:30:21 2011 +1000 + + Silence compiler warning due to differnent event conversion procs + + XExtInt.c:161:5: warning: initialization from incompatible pointer type + + XSndExEv.c: In function 'XSendExtensionEvent': + XSndExEv.c:84:8: warning: assignment from incompatible pointer type + + Xlib and libXi differ in the conversion functions. libXi takes an xEvent** + and a num_events parameter since it may split an event into multiple + xEvents. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit fd680f025b1db22b1069aed2f142f670181574e5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 5 09:20:23 2011 +1000 + + Silence compiler warning in XListDProp.c + + XListDProp.c: In function 'XListDeviceProperties': + XListDProp.c:72:9: warning: pointer targets in passing argument 2 of + '_XRead32' differ in signedness + /usr/include/X11/Xlibint.h:652:13: note: expected 'long int *' but argument + is of type 'Atom *' + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit aa2432240ad02c54280f2d11c007969c3eb9b79f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 5 09:43:32 2011 +1000 + + man: fix typo, layout in XGetExtensionVersion.man + + Fix a typo and move from MPX to XI2. Add a linebreak to make the + depreciation separate from the function description. Changes in the second + paragraph are just realignment due to the linebreak. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit f148a6279f07f029fc6a5b0a6556ff6622e6686a +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Wed Feb 2 17:01:52 2011 -0800 + + Move Xinput server API documentation from libXi to xserver + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Gaetan Nadon <memsize@videotron.ca> + +commit 4cc2b17a3d069b296837edbd6e81af5bbf9821b4 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 3 14:51:12 2011 +1000 + + Remove a few unused assignments. + + Found by static analyzer. + + Reported-by: Jeremy Huddleston <jeremyhu@apple.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit cc6feecae23b321952921cf927bc965386844c8c +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 3 14:34:22 2011 +1000 + + XIChangeHierarchy: Return Success early if no actual changes are requested. + + Do the same for negative num_changes. + + Found by static analyzer. + + Reported-by: Jeremy Huddleston <jeremyhu@apple.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit af65475b1f6b7209750220a74aaad9968d54aaf7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 3 13:21:02 2011 +1000 + + Allocate enough memory for raw events + extra data. + + Necessary space was calculated, but not actually used to allocate memory. As + a result, valuator data would overwrite the allocated memory. + + ==4166== Invalid write of size 1 + ==4166== at 0x4C29F04: memcpy (mc_replace_strmem.c:497) + ==4166== by 0x8F39180: ??? (in /usr/lib/libXi.so.6.1.0) + ==4166== by 0x7433D48: _XCopyEventCookie (in /usr/lib/libX11.so.6.3.0) + ==4166== by 0x7425166: XPeekEvent (in /usr/lib/libX11.so.6.3.0) + ==4166== by 0x49C3E3: process_key (x11_be.c:1065) + ==4166== by 0x49EA5C: event_key_release (x11_be.c:2201) + ==4166== by 0x49DD6E: x11_be_process_events (x11_be.c:1892) + ==4166== by 0x4A38F4: x11_be_main_loop (x11_be.c:4353) + ==4166== by 0x4A39E1: x11_be_thread_main (x11_be.c:4385) + ==4166== by 0x87549C9: start_thread (pthread_create.c:300) + ==4166== by 0x8A516FC: clone (clone.S:112) + ==4166== Address 0x168afe80 is 0 bytes after a block of size 96 alloc'd + ==4166== at 0x4C284A8: malloc (vg_replace_malloc.c:236) + ==4166== by 0x8F390BD: ??? (in /usr/lib/libXi.so.6.1.0) + ==4166== by 0x7433D48: _XCopyEventCookie (in /usr/lib/libX11.so.6.3.0) + ==4166== by 0x7425166: XPeekEvent (in /usr/lib/libX11.so.6.3.0) + ==4166== by 0x49C3E3: process_key (x11_be.c:1065) + ==4166== by 0x49EA5C: event_key_release (x11_be.c:2201) + ==4166== by 0x49DD6E: x11_be_process_events (x11_be.c:1892) + ==4166== by 0x4A38F4: x11_be_main_loop (x11_be.c:4353) + ==4166== by 0x4A39E1: x11_be_thread_main (x11_be.c:4385) + ==4166== by 0x87549C9: start_thread (pthread_create.c:300) + + Reported-by: Roger Cruz <roger.cruz@virtualcomputer.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit 18177afd4fb3934d0a9083c599fb96701eec2ad9 +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Fri Apr 1 22:49:09 2011 +0200 + + Fix XISelectEvents on 64 bits, strict alignement architectures. + + Use Data() to send the struct xXIEventMask on the wire instead of + Data32() which expects a pointer to a 64bits value on LP64 + architectures. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 75dc4029316c321d8f09fae584024f36c5c85c7f +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Feb 27 15:06:18 2011 -0500 + + Documentation: add Docbook external references support + + When writing technical documentation, it is often necessary to cross + reference to other information. When that other information is not in the + current document, additional support is needed, namely <olink>. + + A new feature with version 1.7 of xorg-sgml-doctools adds references to + other documents within or outside this package. + + This patch adds technical support for this feature but does not change + the content of the documentation as seen by the end user. + + Each book or article must generate a database containing the href + of sections that can be referred to from another document. This database + is installed in DATAROOTDIR/sgml/X11/dbs. There is a requirement that + the value of DATAROOTDIR for xorg-sgml-doctools and for the package + documentation is the same. This forms a virtual document tree. + + This database is consulted by other documents while they are being generated + in order to fulfill the missing information for linking. + Refer to the xorg-sgml-doctools for further technical information. + + Co-authored-by: Matt Dew <marcoz@osource.org> + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 32236a7779f721d252d633d06ade306f246421a3 +Author: Jeremy Huddleston <jeremyhu@apple.com> +Date: Fri Mar 18 16:30:13 2011 -0700 + + configure.ac: 1.4.2 + + Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> + +commit 2d638fc37b0dbf28e5c826f74f68ada83a8c3e2b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 15 10:55:10 2011 +1000 + + Force alignment with sizeof(Atom) for XIButtonClassInfo + + The memory layout of an XIButtonClassInfo is + [struct XIButtonClassInfo][mask][labels] + + With the mask being currently 4-byte aligned and labels a list of Atoms. On + LP64, Atoms are 8 byte, leading to unaligned access for some mask lengths. + Force the alignment to be sizeof(Atom). + + Reported-by: Christian Weisgerber <naddy@mips.inka.de> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Tested-by: Christian Weisgerber <naddy@mips.inka.de> + Reviewed-by: Adam Jackson <ajax@redhat.com> + +commit 477f922fb07eea629f16c55b0a022e836ede6d41 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 8 14:44:10 2011 +1000 + + Don't discard extra data for passive grabs. + + Failed modifier data was discarded, causing assertions inside xcb. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit f0a352412920d9989323c7d33ca75c3646ee3f35 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 8 14:01:35 2011 +1000 + + man: describe return value for XI2 passive grabbing calls. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 11b1e8ea7bc160cf9a42231742eedb0e7fefa222 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Sep 9 14:43:03 2010 +1000 + + Rename XSetCPtr.c to XISetCPtr.c. + + XISetClientPointer is an XI2.0 call and should be named accordingly. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit 19ac7ef23e7ff07068a63d1553159e7cb3ad2576 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Sep 9 14:43:02 2010 +1000 + + Require XI 2 for all XI 2 calls. + + Each XI2 call should check _XiCheckExtInit for XI version 2.0 or higher. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit 536bd44c513ede7e61e112c82a80fb9197f261f7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 23 10:53:21 2011 +1000 + + Fix typo in comment. + + Reported-by: Julien Cristau <jcristau@debian.org> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4ca8be9f3ffbafe9515e50d784f4ff83f6993be0 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 23 09:30:59 2011 +1000 + + Fix invalid read in XIGrabDevice. + + Miscalculation of length caused Data() to memcpy too many bytes. + + ==2865== Invalid read of size 1 + ==2865== at 0x4A07480: memcpy (mc_replace_strmem.c:602) + ==2865== by 0x544271E: XIGrabDevice (XIGrabDevice.c:69) + ==2865== by 0x400B0A: main (gnome642481.c:56) + ==2865== Address 0x642f614 is 0 bytes after a block of size 20 alloc'd + ==2865== at 0x4A04896: calloc (vg_replace_malloc.c:418) + ==2865== by 0x54425D3: XIGrabDevice (XIGrabDevice.c:65) + ==2865== by 0x400B0A: main (gnome642481.c:56) + + SetReqLen() expects 4-byte units. + Data() expects bytes. + + Gnome Bug 642481 <https://bugzilla.gnome.org/show_bug.cgi?id=642481> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4db3db2b38d8eb9024170633d3bf7c5050272dd0 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Feb 14 08:48:07 2011 +1000 + + Mark sourceid in Raw events as bug and force to 0.. + + The protocol does not provide a source ID for raw events, so this value is + always 0. It shouldn't really be there, but the past is so hard to change. + + Reported-by: Mark Dokter <dokter@icg.tugraz.at> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d79a9b174a79e89ca2507a61f2e12af25102313f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Feb 1 07:36:08 2011 +1000 + + man: note that callers of XIQueryPointer must free the button mask. + + buttons_return->mask is allocated by the library and must be freed by the + caller to avoid leaking. + + Reported-by: Matthias Clasen <mclasen@redhat.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 1b376f371c2f866cd1cdf047e50210a5c69772b9 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Feb 2 11:43:43 2011 -0500 + + config: comment, minor upgrade, quote and layout configure.ac + + Group statements per section as per Autoconf standard layout + Quote statements where appropriate. + Autoconf recommends not using dnl instead of # for comments + + Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters. + Use AC_PROG_LIBTOOL to replace the deprecated AM_PROG_LIBTOOL + Remove redundant AC_SUBST(*_CFLAGS) and/or *_LIBS + Remove redundant AC_PROG_MAKE_SET included with AM_INIT_AUTOMAKE + Remove redundant AC_CANONICAL_HOST included in XORG_DEFAULT_OPTIONS + Add AC_CONFIG_SRCDIR([Makefile.am]) where missing + Update minimum version of util-macros to at least 1.8. + + One or more of the above actions were applied + No functional configuration changes + + This helps automated maintenance and release activities. + Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit faff510fed9733b2860e14490d5a40d70b840eae +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jan 28 19:41:37 2011 -0500 + + config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 3776075264024af7eca93f689305d46302e88536 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jan 28 12:07:46 2011 -0500 + + config: remove already included AC_PROG_SED statement + + Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS + Use the appropriate platform version of sed + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 5283e87ca909304d3e1820ef877bf3587a9c8724 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Jan 27 18:50:15 2011 -0500 + + config: remove AC_PROG_CC as it overrides AC_PROG_C_C99 + + XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls + AC_PROG_C_C99. This sets gcc with -std=gnu99. + If AC_PROG_CC macro is called afterwards, it resets CC to gcc. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit be2a1b33c9394dcab52622bde53c83f1dd840ea0 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jan 26 07:42:53 2011 +1000 + + libXi 1.4.1 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit e0c95ce2348a9c9afaa4862368c7a5ae6913457c +Author: Carlos Garnacho <carlosg@gnome.org> +Date: Mon Jan 24 12:35:04 2011 +0100 + + Fill in mods/group->effective in XIQueryPointer() + + the other XIModifierState/XIGroupState fields are being set correctly, + but the "effective" field was being left as undefined memory. + + Signed-off-by: Carlos Garnacho <carlosg@gnome.org> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit a5961a8459614fcaa801a47cda07d3ee8246b16f +Author: Philipp Reh <sefi@s-e-f-i.de> +Date: Mon Jan 10 17:35:57 2011 +0100 + + Fix passive grabs. + + _XIPassiveGrabDevice, which is called by alle the passive grab functions, + wrongly returns an error when it shouldn't. + The attached patch adds the missing "not" to properly test the error + condition of _XReply. + + Signed-off-by: Philipp Reh <sefi@s-e-f-i.de> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 408db9e86a92c897390129ef27a804d7cf6ba6fb +Author: Paulo Zanoni <pzanoni@mandriva.com> +Date: Thu Dec 16 14:10:05 2010 -0200 + + Use docbookx.dtd version 4.3 for all docs + + Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com> + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 9419fe9f0b21232d342885a693fbf9222b5844e4 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Mon Dec 13 19:49:58 2010 +0000 + + WireToEvent: Set display member of all events as well + + All events were getting random uninitialised garbage for display; fix + that. + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit 549dd5f470148df74e65ce7bb1af316a2848a71d +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Nov 9 13:04:55 2010 -0500 + + config: HTML file generation: use the installed copy of xorg.css + + Currenlty the xorg.css file is copied in each location + where a DocBook/XML file resides. This produces about + 70 copies in the $(docdir) install tree. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit ea7e12eaf84ada28f4933e85ecf51a47c9db0b93 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Nov 2 14:26:34 2010 +1000 + + libXi 1.4 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 556246beaffb42e1f58d816542d91e360ea02080 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Nov 2 11:22:01 2010 +1000 + + man: XGetDeviceProperty(3) has no parameter 'pending'. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit ccbebb111fb2084716fce67cb44b5bd8b86adbbc +Author: Jesse Adkins <jesserayadkins@gmail.com> +Date: Tue Sep 28 13:30:03 2010 -0700 + + Purge cvs tags. + + Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit f237427f897d1dc527494653735d4bb93d740546 +Author: Carlos Garnacho <carlosg@gnome.org> +Date: Wed Oct 6 11:04:21 2010 +0200 + + Fix typo when converting raw events from the wire. + + The raw values were being miscalculated, containing only the integral part + of the FP3232, meanwhile normal valuators were mistakenly added the fractional + part of its corresponding raw value. + + Signed-off-by: Carlos Garnacho <carlosg@gnome.org> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit abc26c71b6032683b89085a7ebcd40ca81cdf3f2 +Author: Julien Cristau <jcristau@debian.org> +Date: Sun Oct 3 17:04:57 2010 +0200 + + man: fix typo in XIQueryDevice doc + + Don't pretend this is XIQueryPointer. + + Debian bug#598964 + Reported-by: Joachim Breitner <nomeata@debian.org> + Signed-off-by: Julien Cristau <jcristau@debian.org> + +commit a00926cd16a0b6ddb9f7b074dce88e3fb840831c +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Wed Aug 25 22:21:55 2010 +0200 + + Fix build with gcc 2.95 + + Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> + Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> + Reviewed-by: Matt Turner <mattst88@gmail.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 3f2814a0f9193cb33b44ef53059a4b349cf4cabc +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Aug 2 15:40:32 2010 +1000 + + man: improve readability of XAllowDeviceEvents. + + Parse the options to event-mode as a list. This requires un-indenting the + rest, otherwise the asciidoc/xmlto conversion will indent the trailing + paragraphs more than the list + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d3eb99478ca96fdfc4ceb2a9809f19f803bba6c7 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 18:05:13 2010 -0400 + + man: add $(AM_V_GEN) for silent rules where missing + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit dbcca7e1296ae671964c55be13bfbb9113a600a0 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 17:46:52 2010 -0400 + + man: whitespace management + + This style should make it easier to read filenames + in a large list. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit bc9f68de51ec7d3d88330ff843eccd6cbf9a93ad +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 12:53:04 2010 -0400 + + man: Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS + + The value of MAN_SUBST is the same for all X.Org packages. + Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 20b843c820dd147a0f8f7e6d06da7a0c18d40f1c +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 09:33:17 2010 -0400 + + man: add/change comments regarding the 3 step conversion from text source + + In the hope of making it easier to learn. + This makefile may serve as a reference. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit e7b4e33a3ea1a3cce074da2d91bda7258e01652a +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 07:54:39 2010 -0400 + + man: rename libman_pre to libman_PRE + + To be consistent with all other man pages makefiles. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit d854293a63be4a983e3e8fe8a1110a5ea1ffba2a +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Aug 15 07:32:10 2010 -0400 + + man: use "shadows" terminology in variable names. + + For man pages that are just links to a main man page. + This is how they are referred to in all other librairies. + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 9fe6bfec833a66a3a8ca70b8769eada91a320bf7 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sat Aug 14 21:41:51 2010 -0400 + + man: remove used LIB_MAN_DIR_SUFFIX (part of an unrequired broken fix) + + Local fix in CVS for bug 5628 is not required + as the problem has been fixed in + util-macros d9062e4077ebfd0985baf8418f3d0f111b9ddbba + + Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 8daf961d0fe6a1433c8248d984618a7e22ff88b8 +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Fri Jun 18 11:32:36 2010 +0300 + + Always unlock display correctly + + XISelectEvents and XIGetSelectedEvents were not unlocking display in all + return paths. + + Reported-by: Julien Cristau <jcristau@debian.org> + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + +commit 3a6839b4a229aa59188025c9b285023110a20aad +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Mon Jun 14 10:37:56 2010 +0300 + + Use single error path in XGetDeviceControl + + This reduces code duplication and fixes possible leak of d. d would leak if + allocation of Device fails. + + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit 850288fee663c07fbd491859629543f78bbadd3c +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Mon Jun 14 10:37:56 2010 +0300 + + Use single error path in XGetFeedbackControl + + This reduces code duplication and fixes possible leak of f. f would leak if + allocation of Feedback fails. + + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit 9ca839742b49d49e98a17baa40c9662ee76c397f +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Mon Jun 14 10:16:22 2010 +0300 + + Use single error path in XQueryDeviceState + + This reduces code duplication and fixes possible leak of data. data would + leak if allocation of state fails. + + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit b953bf7b9775e5970776a21ae3f7919592289c92 +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Mon Jun 14 10:05:36 2010 +0300 + + Fix memory leak in XIGetSelectedEvents + + mask_in was leaking for every successfull XIGetSelectedEvents. + + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit 6199f89992e2b6ba5f96833f4f4087b61ca61ac5 +Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com> +Date: Fri Jun 11 17:30:44 2010 +0300 + + Fix usage of uninitialized value + + In error case length of extra data could be uninitialized. This would + result randomly sized request later in function. + + Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit d364aaaa47a69789b7acfd54b625caa299780480 +Author: Matt Dew <matt@osource.org> +Date: Sat Jul 10 09:48:13 2010 -0400 + + specs: convert input .ms specs from xorg-docs module to DocBook XML + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 30b076ea0b761c4a94c275be273accf311dc81c2 +Author: Fernando Carrijo <fcarrijo@yahoo.com.br> +Date: Thu Jul 1 06:58:28 2010 -0300 + + Purge macros NEED_EVENTS and NEED_REPLIES + + Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> + Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> + Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 54fbe5759aa961dccc618b35573845f847675570 +Author: Jamey Sharp <jamey@minilop.net> +Date: Fri Apr 9 17:31:00 2010 -0700 + + Don't unlock the Display twice. + + _xiQueryVersion's caller must wrap it in a LockDisplay/UnlockDisplay + pair, so it shouldn't call UnlockDisplay itself. + + Signed-off-by: Jamey Sharp <jamey@minilop.net> + +commit f7c3b023f04e06dfe380dce488f80943a10be57e +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Mar 29 16:50:34 2010 -0400 + + config: update AC_PREREQ statement to 2.60 + + Unrelated to the previous patches, the new value simply reflects + the reality that the minimum level for autoconf to configure + all x.org modules is 2.60 dated June 2006. + + ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit e48a8569f854237f2fead7c7a75e90b6c5fe8693 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Mar 29 14:53:48 2010 -0400 + + config: remove the pkgconfig pc.in file from EXTRA_DIST + + Automake always includes it in the tarball. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 93aca1583dcdd21d79c7ab75d81a49359523a0e2 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Mar 11 10:16:51 2010 -0500 + + doc: specify minimum version for xmlto and ascidoc + + Specify 0.0.20 as the minimum version for xmlto. + Older versions do not have fop backend. + + Specify 8.4.5 as the minimum version for ascidooc. + Older versions stop with errors. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 299de21b2ab3cfa2078823215f84da67e7b3d1a3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Dec 9 13:59:57 2009 +1000 + + Initialize extension with the right number of events. + + If the server supports a lower XI version than the client, the Xlib-internal + event vector may be smashed. See libXext for more details. + http://cgit.freedesktop.org/xorg/lib/libXext/commit/?id=83fdb27df4ddc2fb088ddf2ec65f0db6b7c57287 + + This patch queries the server for the supported XI extension before + registering the extension with Xlib. The number of events registered depends + on the server version. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Julien Cristau <jcristau@debian.org> + +commit 4debc545611edd35f8fd35a52f4adf4263e49200 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Feb 16 10:37:21 2010 -0500 + + config: move CWARNFLAGS from configure.ac to Makefile.am + + Compiler warning flags should be explicitly set in the makefile + rather than being merged with other packages compiler flags. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit d7e421f97db74332783ae885f6835f84133c92b5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Feb 18 16:52:12 2010 +1000 + + man: fix types for XGetSelectedExtensionEvents. + + The return values are of type XEventClass** and int*, respectively. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + +commit b75b8fa4bda0fb18872fa82a04fe7f609a147f8b +Author: Dan Nicholson <dbn.lists@gmail.com> +Date: Tue Jan 26 09:17:12 2010 -0800 + + Need both xmlto and asciidoc to install man pages from a checkout + + The check for whether to build the pages looked for both xmlto and + asciidoc, but the check to install didn't. Refactor a bit so that the + check is done only once. + + Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> + Tested-by: Gaetan Nadon <memsize@videotron.ca> + Tested-by: Christian Hartmann <cornogle@googlemail.com> + +commit f10f6f2fd420786cddac875d1b6de2004ba8c9d4 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sat Jan 23 14:46:59 2010 -0500 + + man: remove redundant nodist prefix to libman_DATA + + The final, macro substituded, man pages (with file extension .3 + on my platform), are installed, but not distributed. There is no + need to override the correct default behaviour. + + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit c183e15263787af913bf8eb7be707e0f2e974824 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sat Jan 23 10:04:38 2010 -0500 + + man: allow installing prebuilt man pages from tarball + + The man pages source may be supplied in the tarball or built + from git. The makefile needs to take that into consideration + and adjust the targets accordingly. + + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit c94494c144c634b7fa3187c55458cafa0e06a69c +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Jan 19 13:44:49 2010 -0500 + + config: replace custom code with reusable macro XORG_WITH_XMLTO + + XORG_WITH_XMLTO provides additional functions like a configure + option which allow platform builders to control the usage of + the xmlto program. + + This is a requirement from platforms that do not have such doc tool. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit bb07265cfbd919de4903dadbfe42d1779c20225c +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Jan 14 09:22:08 2010 -0500 + + COPYING: add missing copyright notice + + Refer to: XiAllowEvents.c + Copyright © 2009 Red Hat, Inc. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 20f1b09cfdeeb2e4536e82a09b32693de65f3566 +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Thu Jan 14 21:39:47 2010 -0800 + + Update Sun license notices to current X.Org standard form + + Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> + +commit d42cdd631728eae399287b666f0f445e7af47ad3 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jan 1 13:43:03 2010 -0500 + + man: ignore generated .man from .txt files in this directory + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 9620cfa989d214a4d97c74767c218d06ed2ac792 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Nov 27 20:56:04 2009 -0500 + + Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES + + Now that the INSTALL file is generated. + Allows running make maintainer-clean. + +commit d157e3b4ac31710fb1d4d62f1cc4fa743ec61522 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Oct 28 14:09:10 2009 -0400 + + INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 + + Add missing INSTALL file. Use standard GNU file on building tarball + README may have been updated + Remove AUTHORS file as it is empty and no content available yet. + Remove NEWS file as it is empty and no content available yet. + +commit 847b72d9de8dd839c391321b50312368e63e7305 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Oct 27 15:07:25 2009 -0400 + + Deploy the new XORG_DEFAULT_OPTIONS #24242 + + This macro aggregate a number of existing macros that sets commmon + X.Org components configuration options. It shields the configuration file from + future changes. + +commit f1c7f651838c7f2f33c0c9f9306d8d6df36206c7 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Oct 26 22:08:43 2009 -0400 + + Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432 + + ChangeLog filename is known to Automake and requires no further + coding in the makefile. + +commit a9a766f9dd0e8cf32e576c040d1604422193ab07 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Oct 22 12:34:19 2009 -0400 + + .gitignore: use common defaults with custom section # 24239 + + Using common defaults will reduce errors and maintenance. + Only the very small or inexistent custom section need periodic maintenance + when the structure of the component changes. Do not edit defaults. + +commit 63621888d6e36a2f9e41e81c14728d70beeff5ee +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Oct 2 12:09:17 2009 +1000 + + libXi 1.3 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9dc825a3dede81d2425770662daefe7e19644d6d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Oct 2 12:08:30 2009 +1000 + + Require macros 1.3 for XORG_DEFAULT_OPTIONS + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 3530845c70b0d7f9f853b29337c9397a3a599e52 +Author: Julien Cristau <jcristau@debian.org> +Date: Tue Sep 29 14:15:06 2009 +0200 + + Don't export sizeDeviceClassType, size_classes and copy_classes + + Signed-off-by: Julien Cristau <jcristau@debian.org> + +commit 801d77d035a10250dab728c046a6e9b2775e6dfb +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Sep 24 14:14:48 2009 +1000 + + XQueryDeviceState: correct length of XValuatorState + + The length is suppposed to be the complete class size, not just the struct + size. Since XValuatorState is followed by multiple valuator values the + size of the class is variable and dependent on the number of valuators. + + The server assembles the valuator state last. This bug is unlikely to affect + clients as they should never go past the last class anyway. + + Tested-by: Thomas Jaeger + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit bff36ef5797d7da11972ee22ea224e207af77455 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Sep 24 13:10:26 2009 +1000 + + man: correct XQueryDeviceState return value. + + And one indentation fix in the same man page. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9c5ba6ff3fcff30507f285f2e67afbdb296a2318 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Sep 14 16:34:18 2009 +1000 + + Declare _xibad* functions before the Bad* macros. + + Reported-by: Christian Beier + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 369600cf37cd884793c4802a56c8355bc1812dc6 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Sep 7 12:22:06 2009 +1000 + + mask_len in XIGrabDevice is in 4-byte units (#23708) + + X.Org Bug 23708 <http://bugs.freedesktop.org/show_bug.cgi?id=23708> + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit fa09375a69a02cd789c70d60970a669700eaeb20 +Author: Arkadiusz Miśkiewicz <arekm@maven.pl> +Date: Sat Sep 5 20:39:47 2009 +0200 + + libXi: Man page files end with LIB_MAN_SUFFIX not LIB_MAN_DIR_SUFFIX. + + Using LIB_MAN_DIR_SUFFIX as man page files suffix is invalid since + there can be files ending with eg. 5x while being in man5 dir + (share/man/man5/man.5x) as required by FHS 2.3. + + Man page files and with LI + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 693d9a43f16d4ffd085099b532a10467aa095c17 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Sep 1 16:42:38 2009 +1000 + + Initialize send_event for cookie events. (#23609) + + X.Org Bug 23609 <http://bugs.freedesktop.org/show_bug.cgi?id=23609> + +commit eb9a2d63487641faa97d88cef3fa1c892a8f342f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 25 11:03:04 2009 +1000 + + Bump to 1.2.99.4 + +commit 2ce629c30745fc4027d2a95745bf21e8d8c7b893 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 25 09:55:23 2009 +1000 + + Remove the asciidoc warning from configure. + + This warning was put in when the released version of asciidoc required an + additional patch to build libXi. + The release of asciidoc 8.4.5 included this patch thus we don't need this + explicit warning anymore. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 17bbc8c30fb34c7130b71e5cc0b0e17093271266 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Aug 24 15:54:09 2009 +1000 + + man: fix XIQueryPointer parameter ordering. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 207a7f3d5bd559ffb67de2910795d7cd6508ce09 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Aug 24 15:31:55 2009 +1000 + + Update XIWarpPointer to take doubles (inputproto >= 1.9.99.902) + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit a8a8b40fa447c85eb5d1d61ef416d3cf198c72c1 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 18 15:21:56 2009 +1000 + + man: XIDefineCursor can generate BadDevice errors. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 326a0c01ef6e3c1f0577e185c23eec80ecf59192 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 18 15:08:50 2009 +1000 + + man: typo fixes in XIUndefineCursor, add BadCursor note. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 42a718457d183aab42778fbb127fafbae6b3e6d8 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 5 16:00:44 2009 +1000 + + man: point out temporary detachment of slave devices. + + Affects XIGrabDevice, XIGrabButton/Key and XIGrabEnter/GrabFocusIN + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 1a5f4fd2fa3ac7cfa1671d5cf0975ff365294f29 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 5 15:58:57 2009 +1000 + + man: fix XIGrabEnter man page - text with needed to be reduced. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 0d19a3ec942aedf5432a9bda1e80f29f7186ce5b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 5 15:34:10 2009 +1000 + + Update library version for new symbols. + + XI2 adds a whole lot of new symbols but leaves the existing ones. Minor bump + only. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 936f4993a9ece131aff03cf789b8c21cadaed47e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Aug 5 08:50:20 2009 +1000 + + man: correct XListInputDevices description of the name field. + + A device's name is the identifier set either by the server the + xorg.conf/HAL. The preconfigured device types (XI_MOUSE, XI_KEYBOARD, etc.) + are atoms listed in the type field only. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit bc3900ea706438005f8b5613de4d9fb6bd954f62 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 4 14:03:44 2009 +1000 + + Cosmetic fix, move a 'char* name' to 'char *name' + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 30de3da4c87322a73b2ab72e6ac83f689ec42adf +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 4 13:26:45 2009 +1000 + + Allow foreign automake, remove empty AUTHORS and NEWS. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4d8676a859a2a8ebde03d8a9fe6bd79060f16cf5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 4 11:45:53 2009 +1000 + + man: add XIQueryDevice and XIFreeDeviceInfo man page. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit c5a5d1800566b0ec073418a827ed5bc8195dd24e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Aug 4 10:48:50 2009 +1000 + + Remove leftover RCS tags. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit aa8272dd31b69f84d19dbe2c45889b806df8260e +Author: Dan Nicholson <dbn.lists@gmail.com> +Date: Mon Aug 3 06:09:12 2009 -0700 + + man: missing .man suffixes in prereq rules breaks parallel make + + Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> + +commit 888f6c238de6f09cc5b079ae22c6f37496083007 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 22 14:16:11 2009 +1000 + + Bump to 1.2.99.3 + +commit c439c39cc0f985743fbc464849f6caa805b1a1a9 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jul 21 11:41:43 2009 +1000 + + Replace keysym grabs with keycode grabs. + + Keysym grabs are tricky to get right for applications that are more + complicated than demo applications. otoh, we know keycode grabs are + working. + So let's go with keycode grabs for now and add keysym grabs later + when we've sorted out the details. + + Requires inputproto 1.9.99.15 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4f224f4da1405959b74c05d6b15469cf6c0c498f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 15 10:27:21 2009 +1000 + + Fix wrong raw_valuator wire copy, add fractional parts. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 550a33ed79925501d9a5e8b73ef256fd9e0937b5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jul 14 15:28:00 2009 +1000 + + man: fix wrong parameter in XIGrabKeysym man pages. + + XIGrabKeysym doesn't provide a cursor argument. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 504a5a770bd1d34ea7edc3b94815b2b98a61afc0 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Mon Jul 13 16:53:57 2009 +1000 + + Add flags to XIDeviceEvent and XIRawEvent. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 94bfb0cc3ebbefe548b440f8c5e14154c3a76440 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 15:37:32 2009 +1000 + + Cater for new event-specific raw event types. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit e600e6cf47abd61bd3554967c4fdb0f78cc68f41 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 15:37:59 2009 +1000 + + Fix broken formatting, remove empty comment. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 1fc161f058eecb61d37135fd024703a385769417 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 09:14:03 2009 +1000 + + Bump to 1.2.99.2 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 386283e4a6653eef5e92bad8867b64a3e10a5138 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 11:34:20 2009 +1000 + + Reshuffle deviceid + sourceid in XI2 events to allow for common typecasting. + + Except for two events, all events include a deviceid. Place it at the same + position in the struct for these events to allow quick checking with common + typecasts. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d02c85fbd2a204a78a9d515960d817ed37e3d492 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 11:24:35 2009 +1000 + + Add the deviceid to XI2 property events. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 07d7fc323367ac93c3c26eaf130284e31aa961ea +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 11:05:33 2009 +1000 + + Plug memory leak in XIHierarchyEvent copy. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 753fb6afb13a7ce154cd24261eadb56c3f4243c5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jul 13 10:05:33 2009 +1000 + + Fix segfault in XIDeviceChangedEvent wire parsing. + + Introduced by 225071e2e67fb65a0258397212f9826c9b25e078. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9d92265081830b700926b4a7b73975dd65217551 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jul 9 13:46:52 2009 +1000 + + Remove padding from XIEvent. + + The padding was originally to force the same size as the XEvent struct. This + only works on 32 bit however, the 64-bit XEvent struct is larger. + Let's just ignore the padding, there's no point to it anyway, all the Xlib + functions require XEvents anyway. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4dacd34cc05054a0ab26621aaec8125b2ffe5bbf +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 8 16:00:57 2009 +1000 + + Add event copying for raw events. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 79b1ee174bb08722198e6d00c9d1a1e9e9352b8a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 8 15:42:58 2009 +1000 + + Switch to new XIEvent structures - no need for pointers anymore. + + This removes all those pointers from event structures that were just there + due to the pre-cookie struct size limit. Pointers remaining are only those + that are of variable length (e.g. masks and valuator states). + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 64a106509ba18506e88989571c1392d48ae18a54 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 8 15:18:57 2009 +1000 + + Remove XIFreeEventData - obsolete with cookie events. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit ba0407100fd1314feb8dc0eace4352d00709cab3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jun 24 11:18:10 2009 +1000 + + Add effective modifiers/group to events - require inputproto 1.9.99.13 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d6439bc4c5c26577d0c839555a85bd1a9db784f3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jun 24 10:09:42 2009 +1000 + + Change floats to doubles in DeviceEvents and EnterEvents. + + All the other bits use doubles, there's no reason to use floats here. + +commit 225071e2e67fb65a0258397212f9826c9b25e078 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jul 7 16:46:22 2009 +1000 + + Split copy_classes and size_classes to avoid memory leak + + The switch to cookie events introduced a memory leak in + XIDeviceChangedEvents. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 55157345c261653160e0f55841dcb32910ae4106 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jul 2 11:41:40 2009 +1000 + + Use cookie events for XI2 events. + + Instead of squashing the events directly into the XEvent use the new libX11 + cookie events. This allows us to have larger events without the 96 byte + restriction. + + Requires libX11 1.2.99.1 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 0e2be045663045dc087f21df95de91f824322915 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 8 11:07:56 2009 +1000 + + Add next_block() call to advance pointers over memory. + + Simple call to get the pointer to the next field when operating on a wire + protocol struct or on a single-memory-block Xlib structure. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit c81a383f11c87976454200805b4b5416a414b4c5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jun 24 10:06:29 2009 +1000 + + Add typedefs for focus in/out events. + + The events themselves are the same as enter/leave events. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d3d00ddb93f01690ba81ce9ec504c1b352f5539d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 19 15:48:32 2009 +1000 + + man: add some missing XI2 refpages + + These missing pages may cause parallel builds to fail. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 47aeafbbd30800fa9a7a1136cb4fdb50cebe005f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jun 17 09:15:48 2009 +1000 + + Require inputproto 1.9.99.12 + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit a514d16c4535890e5aa2b5835d9a571155830251 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jun 17 09:00:10 2009 +1000 + + Axis and button labels should be called labels, not names. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 099e6f77482e971103570cfd38092c3839f94927 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 16 14:20:30 2009 +1000 + + Protect button label copying against 64-bit Atom madness. + + Datatype Atom is 8 bytes on 64 bit architectures, but it's always 4 bytes on + the wire. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit bd2a3ad028a87f76ad244efe3650d7efd3a700dd +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 16 13:24:34 2009 +1000 + + Include the current valuator state in XIQueryDevice. + +commit 1ca170b8d19b1170356a1edf4717cd4a95671a13 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Jun 14 08:40:59 2009 +1000 + + XIButtonClass now includes a XIButtonState struct. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4ec5f70a813ba08bfcea7b2ff90f7647a94a95d7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 12 16:34:13 2009 +1000 + + Fix a few wrong 'evtype' comments. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit e018af45b7d0db784272fc9fc548bce382799144 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Jun 7 17:56:17 2009 +1000 + + Add sourceid to device classes. + +commit 5f217c70a42b743e7260035bd02065eca39bc268 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jun 12 15:51:58 2009 +1000 + + XISelectEvents and XIGetSelectedEvents use "win" now instead of "window" + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 92e5ad0a641d84cf4464f37ac372724a808a785f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jun 8 15:43:24 2009 +1000 + + Require inputproto 1.9.99.11. + +commit 467bfbc6598c8c30ab9b703160cc42ae82e75f1c +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jun 8 14:21:58 2009 +1000 + + XIHierarchyEvent should list num_info, not num_devices. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 0254852c8fb0793401368c7afc6041f807ee1d87 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jun 8 13:34:50 2009 +1000 + + Rename XICreateMaster to XIAddMaster for consistency. + + add/remove is used for slave devices and for flags, so we should use it in + XIChangeHierarchy as well. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4a61fe9f05b8e7214303722dd12195488df9c599 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jun 8 13:37:38 2009 +1000 + + Silence warning: missing prototype for copy_classes + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 05531681e5175b823935e6bdfc53c9b5f63efc9d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Jun 7 15:00:40 2009 +1000 + + Remove CamelCase use from XIChangeHierarchy. + + Everything else uses underscore notation. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 45d35bcfbe2acd4dd2b560dbc21266e915cbb1e6 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Jun 7 14:59:19 2009 +1000 + + man: XIChangeHierarchy uses device ids, not XDevice* + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 199dd64b809c7622b0f0bd94e1c5551c931ea1e5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Jun 7 14:55:42 2009 +1000 + + Hierarchy changes should use "deviceid", not device. + + Every other call/interface uses deviceid, so change for consistency. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 27d39fdbfddec6bb92ee3d3b7ef6c21ab3026926 +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Thu Jun 4 07:33:29 2009 -0700 + + Fix typo in man/XGetDeviceProperty.txt (wether->whether) + + Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> + +commit e43d88541e815aa64108a6c5bc3dae5816c822dc +Author: Matthias Hopf <mhopf@suse.de> +Date: Thu Jun 4 16:29:20 2009 +0200 + + Fix building if asciidoc or xmlto is not installed. + +commit 5975cb9e6f89bf71b1740cee951fc583d7b7cfc1 +Merge: 8ea9ebc 279a8c3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Jun 4 15:49:07 2009 +1000 + + Merge branch 'master' into xi2 + + Conflicts: + man/XI.xml + +commit 8ea9ebcedcb99480a5774c7755329a2ca8fda07b +Author: Benjamin Close <Benjamin.Close@clearchain.com> +Date: Wed Jun 3 10:25:40 2009 +1000 + + configure: Search for sed as required by the man pages. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d5a69432887ba79495e58bef45ec8fc2f5dfbe1e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 2 14:54:03 2009 +1000 + + Fix typo in Makefile.am, leading to the XI2 source skipping compilation. + + Introduced with 59dc570e6ad4adab8066c7b8d2bff77cbf70bed4. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 5500d5b6f9fe3b94d68046529fbf6c80e5a4f518 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 2 12:49:40 2009 +1000 + + man: resurrect XGetDeviceProperty man pages (and associates) + + These man pages got lost in the asciidoc conversion. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit d0be870ee7798deb8cb50cdf350892c9dfc64538 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 2 12:18:58 2009 +1000 + + Add XI2 property man pages. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 8439d93ef77a934fab171ff9385277f3f2f46213 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 2 11:46:56 2009 +1000 + + man: fix copy/paste errors in XListDeviceProperties. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 59dc570e6ad4adab8066c7b8d2bff77cbf70bed4 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Jun 2 11:38:35 2009 +1000 + + Rename remaining XI2 sources to XI<foobar>.c + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 2174d35d5cdc475699be968a0c1b1aa82566171f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun May 31 21:29:47 2009 +1000 + + Return BadRequest from XIQueryVersion if XI2 isn't supported. + + XIQueryVersion (like all other calls) makes sure XGetExtensionVersion is + called beforehand anyway. So if that doesn't match 2.0 or higher, return + BadRquest before issuing the real request (which would trigger a BadRequest + error). This way, clients can use XIQueryVersion without having to set up + the error handler. + + XIQueryVersion is now guaranteed to return the server-supported version. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit b1dedc1293a854360d44856cd603d339ce95c777 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Jun 1 09:54:03 2009 +1000 + + Use Dont_Check for most XI2 requests. + + If a client issues an XI2 request against a non-XI2 server it should + generate a BadRequest error from the server. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 4d962ed1841f35aa255bbec89e37f396612cfd96 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon May 25 16:34:01 2009 +1000 + + Add support for Enter/FocusIn passive grabs. + +commit 7922430e0d063b0c3617050320d613d9dc7de7ba +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed May 27 14:15:49 2009 +1000 + + Require inputproto 1.9.99.10 + +commit a2a09f6a4fb2dcd36f89fccc8efd8386eca7d804 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed May 27 14:13:54 2009 +1000 + + Fix wrong pointer argument in _XIPassiveUngrabDevice. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9b9f9373f32ebe9a15f286d16b6ba880b44a9c22 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon May 25 12:45:52 2009 +1000 + + Add XIGetSelectedEvents. + +commit 13ce4a03824a7c5ac0270198d265b02b18786e1f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 19 13:54:33 2009 +1000 + + XIPassiveGrab: take the address of modifiers for memcpy, not the value. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 7f1f0b9cf8ad17b5a4694406137a1c2114918a67 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon May 18 16:18:27 2009 +1000 + + XIQueryPointer: fix wrong reply extra data reading. + + libXi does it differently than the server, so don't try to access &reply[1], + instead use _XRead as it should be. + + Reported-by: Mark Dokter + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit db94dc37529fc3e5e3decad67d312ea108e860d2 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon May 18 15:14:03 2009 +1000 + + XIQueryPointer should return doubles for the FP1616 wire data. + +commit 615545f9cba36ab7732d2325970a7c84b2fa6e8c +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri May 15 14:16:31 2009 +1000 + + Switch man pages to asciidoc. + + The docbook xml is unreadable and unwritable. Switch everything to asciidoc, + at least thay we we can write man pages without losing sanity. + + asciidoc seems to have some issues with __libmansuffix__, so instead we just + use libmansuffix (without underscores). + The current asciidoc version is buggy for multiple man targets (more than + one man page in a single file), so stick a big warning into configure that a + patch is required to the the right asciidoc->docbook conversion. + + Many thanks to Dan Nicholson for the Makefile.am. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9966ab40b850c780e439f86e165188919f884b64 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sat May 16 12:34:01 2009 +1000 + + Require inputproto 1.9.99.9 + +commit eaf40d1bd1a5737afa5f00c4bc2208fd1562417b +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri May 15 06:21:49 2009 -0400 + + Remove duplicated code paths in XIGetProperty. + + XIGetProperty always returns in the specified format (8, 16, 32) and never in + the Xlib's 64-bit long hackery. So we can clean this code up a bit. + + This doesn't affect XListProperties, it still returns an Atom list. + + Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> + +commit 04bf8fe62832a38f56041d860a717f13fd3a7295 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 14 16:56:17 2009 +1000 + + Return failed modifiers for passive XI2 grabs. + +commit 68da471cd7ad3b5d76bfc1207083f892b15dd34a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 14 16:34:55 2009 +1000 + + Update XIQueryPointer to include full modifier state. + +commit 3017a5124fe98eb0d1f0e4d0bdce35df06ea751b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 14 16:26:17 2009 +1000 + + Update man pages for XI2. + + Shuffling device properties up before all XI2 calls and adding all XI2 calls + (bar device property calls). Needs proofreading. + +commit ea377ea55b2014310fb0777e41ae7044396e25a3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 14 14:19:44 2009 +1000 + + Label major/minor version in XIQueryVersion as _inout. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 0dd26fd87571c1e87ca6e8734e2c55f21e53ceb8 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 14 11:31:28 2009 +1000 + + Xinput2.h: nmasks should be num_masks in XISelectEvents + +commit b4d74eebcec3080fa4ac33c74835246457b00de3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 12 19:25:15 2009 +1000 + + Adust to new device names (less "Device" in function names) + +commit eebdca00c416924b0423879a62498df8afed633e +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 12 17:33:48 2009 +1000 + + XISelectEvents, not the singular version + +commit 23246e5788a01091ed666539359614cd5c100a9b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue May 12 16:14:23 2009 +1000 + + Support per-device flags for XIDeviceHierarchyEvents + +commit 9451d09d2b9cdbe2deff7986a4c5553ba922989c +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 7 16:25:13 2009 +1000 + + Use the new prefixed constants for XI2 and require inputproto 1.99.9.8 + +commit 92cfef2cebfa85bdb0c1b3b6ee2f78520b003eb7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 7 11:41:46 2009 +1000 + + Add XI2 property requests. + + Without Xlib's 64-bit hilarity. A property claiming to be 32 bit is treated + as 32 bit value. + +commit 130774c208a2f331d6110b255676ad6cb8a1a414 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu May 7 11:02:02 2009 +1000 + + Add property event conversion. + +commit 70d9a55c86f15b71ff8b53a61b8fb0e1723e0824 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon May 4 19:05:06 2009 +1000 + + Add XIPassiveGrabDevice. + +commit 279a8c3a6466d885fa618cccb0b12f6c45608982 +Author: Bernhard R. Link <brlink@debian.org> +Date: Tue Apr 28 19:45:52 2009 +0200 + + man: fix a number of return/parameter types + + Debian bug#525546 <http://bugs.debian.org/525546> + + [jcristau: also fixed the window parameter of + X{Change,Get}DeviceDontPropagateList] + Signed-off-by: Julien Cristau <jcristau@debian.org> + +commit 6e4b80a35e5b763d4a854f1c10443b95e6ad51bd +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 21:57:42 2009 +1000 + + Silence a compiler warning by using a uchar instead of a char. + +commit 1c777e3c1127dec35166007c6e3ca65e34735eb5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 21:56:29 2009 +1000 + + Type-cast before passing into wireToFooBarEvent. + +commit 443a69833a29b557f78ec09f9eef395f52a64e10 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 21:53:17 2009 +1000 + + Convert FP1616 from int32_t to double. + +commit 516a52f9a5b095ab60086426a1945d30a44e7ef2 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 21:41:35 2009 +1000 + + XIQueryVersion: ensure we unlock in all cases and return the status. + +commit 76c9ba562bb012790636913ea6c5a6e96af578ff +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 20:09:02 2009 +1000 + + Add missing eventtype to XIRawDeviceEvent. + + Reported-by: Paul TBBle Hampson <Paul.Hampson@Pobox.com> + +commit 8487030472914230bec6ecb95e58cf621e69b608 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 19 19:58:39 2009 +1000 + + Add a bunch of missing LockDisplay() calls. + + Reported-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com> + +commit 3a699cda35a7c190010e5a974cd7a4e7be9df049 +Author: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com> +Date: Sun Apr 19 06:52:30 2009 +1000 + + libxi: Unlock display after XIQueryVersion + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 6ad47bc1338ba96c4a43a33ee3633f41e9543bd6 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Apr 16 22:16:06 2009 +1000 + + Add XIAllowEvents + +commit b3da79aba9cd8c615e953ee08d69f44c23fe3ab5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Apr 15 21:39:30 2009 +1000 + + Add XIGrabDevice + +commit 01a029e597a25f10d00accafb04d72dad39e82cf +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Apr 12 17:44:19 2009 +1000 + + parse subpixels + +commit 6c1d6174a0ba33ff377cb74adf6c0bbe0279f93b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 26 16:37:49 2009 +1000 + + XIint.h only needs XI.h as include, not the rest. + + This fixes 64bit compilation issues. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 2bc4ebba78056eecf76a294f1c3edff892b286f7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 26 16:30:45 2009 +1000 + + Remove public declarations for SizeClassInfo and ParseClassInfo. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 20629761be39493b650f48e120d5c970bca5e796 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 12 16:25:02 2009 +1000 + + Add XISetDeviceFocus and XIGetDeviceFocus + +commit 190035dbb9e74668f7965967a9529fec51d42d14 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 12 15:56:07 2009 +1000 + + man: note that XListInputDevices does not list other MDs. + +commit 8730fa24af5a344876f0c5bfd840d856b5d2b038 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Mar 11 16:32:23 2009 +1000 + + Handle XI2 focus events. + + These events are identical to enter/leave events. + +commit ffa8a602e7ae20c7430090360818d635f13b392d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Mar 11 14:20:05 2009 +1000 + + Add support for XI2 Enter/Leave events + +commit 5ff39db5c98a9e7e0e85ead6f4ffc59f6f071bd6 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 10 16:24:44 2009 +1000 + + Remove if 0 code block + +commit c6985e7651636d75ad7f7ed1b3ef434e123a8492 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 10 15:42:51 2009 +1000 + + Add support for Raw events. + +commit 2712dbc2609ad75674c77df04d42899844968e10 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Mar 8 21:16:54 2009 +1000 + + Add support for XIHierarchyEvent. + +commit 30c2e3f9398f3d9cbae70150e4bb5cec6dfcc0a1 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sun Mar 8 21:16:33 2009 +1000 + + Add support for XIDeviceChangedEvent + +commit 0cac1faccebdd317e889d2ae1a1570dc9430725f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Mar 6 12:02:45 2009 +1000 + + Add XIFreeEventData + +commit 35a9ea79fc97bf80bfc4aea7f98ae97ac8cff762 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 5 17:01:58 2009 +1000 + + Add support for XIDeviceEvents. + +commit f00f4dccba7f109dd6ec00be34543766f38264e9 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Mar 6 11:55:18 2009 +1000 + + Add Generic XIEvent struct. + +commit 13445f170c80f9e2c48e78aa1ec14e956b75c297 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 3 15:29:25 2009 +1000 + + XIint.h fix compile error, include XInput.h + +commit b42809a2e9a8fa821ce6b43e5aba374e922aab39 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 3 15:17:54 2009 +1000 + + XExtInt compile fix - include XI2.h + +commit c6da12b3965f60d893c3fabad4f95dac10ebe7d9 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Mar 4 21:01:58 2009 +1000 + + XInput2.h: Get rid of the /* foo */ in the declarations. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 65dbec3d82259bd7bbde5b7a2cdba44727a5606a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Mar 6 11:55:41 2009 +1000 + + include: Move events up to before function definitions. + +commit 13ed59c032b74d106acd08d8893c2708ef5564c5 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Sat Feb 28 10:32:54 2009 +1000 + + Add XIQueryDevice implementation. + +commit 88fcb0938a898ef6c9f48fce2874c37e3788fe9c +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Feb 26 16:49:45 2009 +1000 + + Add XIQueryVersion() - query and announce the supported XI version. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 2780363f96d07f8ca62507246bb04f6894e3b13d +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Mar 5 15:53:02 2009 +1000 + + XISelectEvent: make sure padding is zeroed out. + +commit ee1a0b4f507f32c7abe07b3324dc3a6c210964c4 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Fri Jan 16 13:36:59 2009 +1000 + + Replace XiSelectEvent() with XISelectEvent(). + +commit 5f4058db225d7cb4455fd27b11dff10422e94748 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 3 14:39:28 2009 +1000 + + Replace all XDevice* with ints. + + There's no reason to have XDevice structs. It's not as if they carry useful + information. + +commit 2d5bdbe0fad5f22f153aa74e38aa3a1ca09d4192 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue Mar 3 14:53:23 2009 +1000 + + Change XIGetClientPtr to take an int, not an XID + +commit 6be974ec5597ef37fbd3a6057d52a38356f544e0 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 15:53:29 2009 +1000 + + Fix the already existing XI2 calls to the new XI2 protocol. FIXME + + FIXME: not bisectable due to XiSelectInput. + + This includes namespacing them with an XI2 prefix. + + Affected calls: + XIGetClientPointer + XISetClientPointer + XIDefineDeviceCursor + XIUndefineDeviceCursor + XIWarpDevicePointer + XIQueryDevicePointer + XIChangeDeviceHierarchy (+ event) + +commit 60b2d114d06617ca60c2905373829299dc051c7f +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 15:32:53 2009 +1000 + + Move current XI2 stuff out of XInput.h, into XInput2.h + + This means XInput2.h is rather messy, but it also means we can leave XInput.h + untouched for the XI2 rework. + +commit c0e3fef8cc7f1953377f61b80d9b8a5ce2fcf2b7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Feb 26 15:23:57 2009 +1000 + + Require inputproto 1.9.99.7. + +commit 660b0abdb8dbc7959f9d97b83ac48110a56fd216 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 16:24:56 2009 +1000 + + XIint.h: include XIproto.h for xAnyClassPtr. + +commit 3e38a82102975670d490d95f595a410f38f4e221 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 16:02:07 2009 +1000 + + Disable generic event handling for now to allow bisecting. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit c56b75732f4506bae234a5cda474c837bb274d6b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Thu Feb 26 16:33:24 2009 +1000 + + Back out the XQueryInputVersion hack, restore previous state. + + XI2 should use a separate request to query the version rather than piggy-back + on an existing badly defined request. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 5ead375009f53c9a4634dc8f1939463ac8ef510a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 15:58:41 2009 +1000 + + Remove XExtendedGrabDevice. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 3992afdd5593f391bcff1eb39d7e975886d817e3 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 16:12:35 2009 +1000 + + Remove DeviceEnter/LeaveNotify handling. + + This will be replaced by XI2 GenericEvents. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 62858c426e6de1b99df660251737233afd335302 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 16:04:16 2009 +1000 + + Remove AttachClass handling from ListDevices. + + If you want attachment information, use XI2 and XQueryDevice(). + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit cbdc33d903ec6f90a42ec3c31905eeaef9ecf0a2 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 17:00:16 2009 +1000 + + XGetDeviceControl: size the libXi structs, not the wire structs (#20293) + + X.Org Bug 20293 <http://bugs.freedesktop.org/show_bug.cgi?id=20293> + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 78f64722c57ff5ec5d0ae35da0c8f151598e6d6b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 16:59:04 2009 +1000 + + XGetDeviceControl: Add a missing break leading to wrong length calculation. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 8f174b7f5e57c6b3e123476f384ce9164cda11b7 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Feb 25 15:28:28 2009 +1000 + + Remove leftover WindowAccess function declarations. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 6e1159a9059d762d6b5d24455237a088e839fe2c +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Mon Feb 2 20:34:34 2009 -0800 + + Add README with pointers to mailing list, bugzilla & git repos + + Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> + +commit ba2546a51d5f9087ec54fba7cae46ea1f210198a +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Thu Jan 29 19:30:30 2009 -0200 + + Return NULL on error, and match LockDisplay with UnlockDisplay. + +commit 4a1d1ff1195a2ed43ace1a33e429f2272f1331af +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Thu Jan 29 19:22:47 2009 -0200 + + Janitor: make distcheck, compile warnings, extra .gitignore files. + +commit d0326fe8cdbb08d4f52d79fd3fd4e1b2a0951d5e +Author: Dan Nicholson <dbn.lists@gmail.com> +Date: Tue Jan 13 15:54:35 2009 -0800 + + Fix build when xmlto is not available + + When xmlto is not available, make bombs since it has no way to generate + the man pages from the XI.xml. This returns the man page installation to + only occuring when xmlto is available. Unfortunately, this means they + will also not be installed when the generated pages are distributed. + + Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> + +commit 9911b7846ca2cedf08a963c84efe7907438975c1 +Author: Dan Nicholson <dbn.lists@gmail.com> +Date: Tue Dec 16 16:45:16 2008 -0800 + + Be smarter about generating man pages + + With the current rules, the man pages will be generated repeatedly if you + have xmlto installed. This is because make always thinks they are out of + date with respect to their prerequisite, do_xmlto_stage. They are changed + here to handle the multiple output files as described in the automake + manual. + + distcheck has been confirmed to still work such that building from the + tarball does not require xmlto. On the other hand, if the user wants to + rebuild the man pages, they'll have to explicitly touch XI.xml. + + It may be better to split the xml into per-page files so that xmlto only + generates one output at a time. A toplevel XI.xml can still pull together + all the pieces with XInclude. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 9e9bf1e477e764b596eb89119c0497b274b87897 +Author: Julien Cristau <jcristau@debian.org> +Date: Sun Dec 21 16:08:08 2008 +0100 + + Hide private functions + +commit db1215bf4785acb20610a7f1302e8dc3ec4d19e0 +Author: Julien Cristau <jcristau@debian.org> +Date: Fri Dec 19 16:06:50 2008 +0100 + + COPYING: add Peter's copyright notice and license + +commit dd89e1187114ba7ece2e4bcc9c25ea5139ea4f0a +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Mon Dec 8 08:34:53 2008 +1000 + + Restore XAllowDeviceEvents() + + Got accidentally removed as part of + f938c524f74fa8828a Purge device-based window access code. + + XAllowDeviceEvents is the XI equivalent to XAllowEvents, required to thaw devices + after grabs, not related to the access control code. + + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 13dee4565b509ed1ef2fbc78b1987a69f10b02e7 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Mon Nov 17 11:34:44 2008 +1000 + + Bump to 1.2.99.1 + + We need libXi 1.2 for the property support, so let's bump this one up by one. + +commit 74b2cb0be98057a522c543b5259396ec1b456794 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Wed Nov 12 22:26:43 2008 +1000 + + man: fix out of source builds. + + As pointed out by johnflux on IRC. + +commit f938c524f74fa8828a954bed51d0f3c4c7eb0fad +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri Oct 31 18:02:02 2008 +1030 + + Purge device-based window access code. + + Requires inputproto 1.9.99.6. + +commit e5c529813b04327babc20e51ca56006210cb0c37 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Mon Sep 29 16:40:21 2008 +0930 + + Add XI_JOYSTICK to list of defined types. + +commit e179b124aac13387c6f730197b8852c1f69eb9e3 +Author: Shunichi Fuji <palglowr@gmail.com> +Date: Fri Sep 26 14:47:49 2008 +0930 + + Build fix: remove dropped man pages for Conrigure/QueryDeviceProperty. + + Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> + +commit ec2665e6ba0e71a1726816054b40f71782874373 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri Sep 26 10:13:57 2008 +0930 + + Require inputproto 1.9.99.5. + +commit f9a5371d43b2c6023745f766d0e8ceff2acdff60 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri Sep 26 10:12:31 2008 +0930 + + Adjust to new property API. + + XConfigureDeviceProperty is gone. + XQueryDeviceProperty is gone. + XGetDeviceProperty doesn't have "pending" anymore. + +commit 822bff60ea26c0b509fd4de35099b4d94e9e99de +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri Aug 15 15:08:07 2008 +0930 + + Require inputproto 1.9.99.4. + +commit bec02767629ed795582ba3f645299d7036093511 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Wed Aug 13 12:03:29 2008 +0930 + + Backport device property code to XI 1.5. + + Ditching generic events, using normal XI events instead. + +commit c5179577ddf0680dffb480d27db9036e9bd27716 +Author: Peter Hutterer <peter.hutterer@redhat.com> +Date: Wed Aug 13 10:27:03 2008 +0930 + + Remove RCS tags. + +commit bfd2e08f3530091fbcd8c078f684e9aab9057df0 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 9 15:38:57 2008 +0930 + + Update man pages to include new device properties calls. + +commit 0211e3e8277c590349903989f1676f6af4baa44b +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 9 16:54:32 2008 +0930 + + Add XDevicePropertyNotifyEvent support. + +commit 7d5bb99ffce3200f82420c5a5ebac3b445aac633 +Author: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed Jul 9 16:53:46 2008 +0930 + + Add support for input device properties requests. + +commit 908ac35ebb25e2f55945825e6256d1848e17cc38 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 29 13:19:06 2008 +0930 + + Bump to 1.1.99.1 + +commit f4739e18bb44e7a04ed0ea6ec87d53ae5fb13e7d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 29 13:18:38 2008 +0930 + + Update required packages again, needs updated libX11, libXext, etc. + +commit 9831db88ee8e69dc6cf8fad0ac83d40bedd5c463 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 29 12:45:57 2008 +0930 + + Don't fail man build when missing xmlto. + + If xmlto is missing during configure, print out a warning and just do an empty + man build with no man pages at all. Better than failing with obscure errors. + +commit fd8198513c865f616be8059907550db7f777b089 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed May 28 17:14:17 2008 +0930 + + Reguire inputproto 1.9.99. + +commit 135b25157ee3e44467264a6df2e1f92f3a785643 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri May 23 10:30:56 2008 +0930 + + Add .PHONY build target to fix parallel builds. + + Copied from libXtst. + +commit 74cc34496d6ed23d8dad259c036bbfaa63b8eb15 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 22 12:58:55 2008 +0930 + + Ansify the XI 2 functions. + +commit 50990b8deb8b8484e9e02e313387ea4d2ddbd242 +Merge: 26dde5a 145947e +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 22 12:48:40 2008 +0930 + + Merge branch 'master' into mpx + +commit 145947ed603207e85a7fcb502f88717a22dfec55 +Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> +Date: Fri Feb 29 18:14:00 2008 -0300 + + libXi ansification. + + Thre are still two remaining compiler warnings, because of non matching + function prototypes and function pointer arguments prototypes: + + src/XSndExEv.c:XSendExtensionEvent() + variable register Status(**fp) (Display *, XEvent*, xEvent **, int *) + doesn't match struct _XDisplay's: + Status (*wire_vec[128])( /* vector for event to wire */ + Display * /* dpy */, + XEvent * /* re */, + xEvent * /* event */ + ); + + and + + src/XExtInt.c:xinput_extension_hooks field event_to_wire of type + XExtensionHooks that has the prototype Status (*event_to_wire)( + Display* /* display */, + XEvent* /* re */, + xEvent* /* event */ + ); + does not match Status + _XiEventToWire( + register Display *dpy, /* pointer to display structure */ + register XEvent *re, /* pointer to client event */ + register xEvent **event, /* wire protocol event */ + register int *count); + + Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au> + +commit 26dde5aaf4bbc89140cc4e3d13fe18036041022d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Apr 30 10:35:12 2008 +0930 + + Fix up AM_CFLAGS, pulled in the system-includes before the local ones. + +commit d68d321c0692848dd5eb67a3713676498c1c646b +Merge: 7d0977b 3e99cc2 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon Apr 28 14:35:11 2008 +0930 + + Merge branch 'master' into mpx + + Conflicts: + + .gitignore + man/XGrabDeviceKey.man + man/XListInputDevices.man + +commit 7d0977bc02ce4f29c0ed335fcdcce4ed7c328259 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon Apr 28 11:24:40 2008 +0930 + + man: more formatting changes (indentation, whitespaces, linewidth). + +commit 2e4cb17b0354fb424f841431a4a20cf6a3e3059c +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 19:46:21 2008 +0930 + + man: formatting changes in XI.xml + +commit 212fb41a101833c817195ef02d20248523929ef3 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 19:26:55 2008 +0930 + + man: fix up use of <function> tag and some whitespaces. + +commit 4ce9781be5f3468d184e34bf36329aa220c726bb +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 19:11:06 2008 +0930 + + man: add old HP, Ardent Computer copyright, plus my new one. + +commit 36f17efe0a4b0278fd442c0bcd97a9d762d96011 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 19:01:39 2008 +0930 + + .gitignore: add man pages. + +commit ea09ee20525e4e6a0a6517654ed12fd419f00b23 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 19:01:03 2008 +0930 + + man: switch over to using xmlto to generate man pages. + + Removing all nroff man pages. + +commit b620f6995b76742c95b32db054d0b5d9fef7a33d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 18:57:48 2008 +0930 + + man: fixes in XI.xml + + Some global whitespace replacements (e.g. space before comma) + Splitting refnames where two functions are listed. + Adding refmiscinfo tags (see libXtst) + +commit 51886a38dd42bb62bf3ffcadbf73472e6d2b514f +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sun Apr 27 16:33:00 2008 +0930 + + man: add XI.xml. Contains all libXi man pages in docbook.format. + + Note that conversion was half-automated and half-manual. There's a lot of + little things to be fixed up. + +commit c142891001e53b3c9d1d4a0cfcb0ff555c2f0070 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sat Apr 26 17:07:39 2008 +0930 + + Deprecate XGetExtensionVersion(), replace with XQueryInputVersion(). + + We need XI to be able to do some sort of versioning support. + +commit 94284e40f5fc9bf30cc2cc5915f6adb22de7bffe +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Apr 25 18:07:36 2008 +0930 + + Add XInput.h file from inputproto package. + + This file only belongs to libXi, it shouldn't have been in the inputproto + package in the first place. For a revision history of this file refer to + git://anongit.freedesktop.org/git/xorg/proto/inputproto + +commit 166083c09a96b1b7e612bdbb1515d79c3bf57185 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Apr 25 18:05:37 2008 +0930 + + Removing previously removed man pages from Makefile.am as well... + +commit c1c8a0e585089b3c18ddbd9039f0053a40dbe6cb +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Apr 25 17:58:16 2008 +0930 + + Extend XListInputDevices man page to include MPX details. + +commit 064f0ec80c6e3cd2f05dd104ca17359b2f7ab833 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Apr 25 17:37:24 2008 +0930 + + Remove XChangePointerKeyboardPairing call. + +commit ef953b30eb212a65e2aa841c8ccdbbe9127b3b56 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Apr 25 17:34:57 2008 +0930 + + Remove XChangePointerKeyboardPairing and XGetPairedPointer man pages. + + Calls don't exist anymore. + +commit 3e99cc281509c70c9240e71ae55cf4e62c6569ba +Author: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Sun Mar 9 08:30:32 2008 +0100 + + nuke RCS Ids + +commit df2cf307c365feea924f2c907d8109cf53461a75 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue Feb 26 15:47:25 2008 +1030 + + Remove XGetPairedPointer(), was removed from the protocol. + + The information needed is in the attached field of ListInputDevices. + +commit 5ca4f620883c63e57edd409b139d82092679010a +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue Feb 26 15:45:46 2008 +1030 + + Remove XExtendedUngrabDevice. XUngrabDevice does the same. + +commit 2b25e823d3c0820b135fb42584be462dba342aa7 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 18:30:09 2008 +1030 + + XChangeDeviceHiearchy has changed to take a array of unions. + + And the parameters were swapped around too. + +commit 80159390595f9a8970c114c66190db371d585da1 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 09:24:29 2008 +1030 + + XQueryDevicePointer: remove unused variables. + +commit e3492c8385b2d0cce0c6e3e862f43a63f3e8917b +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 09:23:03 2008 +1030 + + XQueryDevicePointer: "shared" parameter removed. + +commit aa6c7a07d7f3f73980ad3b6c537b5f83bc3ddd30 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 09:21:26 2008 +1030 + + Remove XFakeDeviceData call. + + This call needs to be better refined and tested before we put it in. + +commit d97dcf6896a1c16b46068d16d3d689a3720cce46 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 09:20:53 2008 +1030 + + Remove RawDeviceEvent parsing. These events have been removed. + +commit 447441f4dfdd114ce1f738ccfda097ca1f4d609a +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 14 09:19:35 2008 +1030 + + Remove XGrabAccessControl and XUngrabAccessControl calls. + +commit 1b15f1bc3b8b33da3a30b7ee23c728dce9e48929 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Sat Jan 26 10:50:28 2008 +1030 + + XiSelectEvent: add additional device parameter. + +commit 411340ccb7070e2e966a36f64f2fb3019ea0242a +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Thu Nov 29 13:49:21 2007 -0800 + + Coverity #743/744: Returned without freeing storage bufp/savp + + If either bufp or savp failed to malloc, we returned without freeing the other. + +commit 5ac8f5dcfb2cf5f695c903179a5a95ac6bd4303e +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue Nov 27 10:47:56 2007 +1030 + + GetDeviceControl: calculate the length field correctly. + + Length field should indicate the length of the struct in bytes. Not the length + of the pointer to the struct... + (cherry picked from commit ddcc71df2a273a410cb5a933aef5501fa56d84cf) + +commit ddcc71df2a273a410cb5a933aef5501fa56d84cf +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue Nov 27 10:47:56 2007 +1030 + + GetDeviceControl: calculate the length field correctly. + + Length field should indicate the length of the struct in bytes. Not the length + of the pointer to the struct... + +commit a9191fcf42a4f5ef5022450b327afe2562c9a0e2 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Nov 14 10:11:15 2007 +1030 + + Remove XRegisterPairingClient and XUnregisterPairingClient. + + Deprecated with the introduction of the device hierarchy. + +commit 16dc064bf997dfa9226a574e5989d8cd1209a5b0 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue Nov 13 11:39:54 2007 +1030 + + Add XDeviceClassesChangedEvent parsing. + + Some stuff from XListInputDevices moved into separate functions to be re-used + in the event parsing. + +commit 0e6331a2c8494cd24d75ab80443f9f071be47334 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Nov 8 17:47:06 2007 +1030 + + Remove PKPairingChangedEvent, replace with DeviceHierarchyChangedNotify event. + + Remove leftovers of RandomStringEvent as well. + +commit a7f53f26ac83257f594058c484ecd19e009e142c +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Oct 19 14:27:58 2007 +0930 + + Add XChangeDeviceHierarchy. + + Used to create/remove master devices or change attachment of slave devices. + +commit d1f92d6c14d7c9b553b8530a1daf0a77a8babccf +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Oct 18 12:22:37 2007 +0930 + + Create AttachInfo class for all devices, containing attachment info. + + Thanks to Xlib's braindead design we can't just add the field to XDeviceInfo. + So we just fake up a new class, add it to all devices and let clients deal + with it. + +commit fbd0431546c3ede8d606559fdd7a18f4cce05743 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Oct 18 10:39:21 2007 +0930 + + Add XI_2_Major and XI_2_Minor to versions. + +commit 0239ef13d66113024066b7db8ade3942af563656 +Author: Eric Anholt <eric@anholt.net> +Date: Wed Sep 5 09:45:20 2007 -0700 + + Bump version to 1.1.3. + +commit 235b283ef6eda4591c95b4749d0a8cd0181783a6 +Author: James Cloos <cloos@jhcloos.com> +Date: Mon Sep 3 05:53:41 2007 -0400 + + Add *~ to .gitignore to skip patch/emacs droppings + +commit 89d7e38124cdb34c55f8c28680725b5b645fe106 +Author: Eric S. Raymond <esr@thyrsus.com> +Date: Sun Jan 14 10:51:00 2007 -0800 + + Bug #9659: Bad markup on XListInputDevices.3x + + X.Org Bugzilla #9659 <https://bugs.freedesktop.org/show_bug.cgi?id=9659> + +commit bf01e98979e6fa500f74d882c1b21746c60d5d31 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Aug 1 05:16:45 2007 +0300 + + XSetDeviceFocus: Add missing extension check + + Actually check for Xi existing before we try to do anything fancy. + +commit 8f5f7e9d6fc288a5cc00df3a7fec44211cdbe8f4 +Author: David Weinehall <tao@debian.org> +Date: Wed Aug 1 05:12:21 2007 +0300 + + XGetSelectedExtensionEvents: Still more locking bugs + + Fix a couple more return-without-unlocks. + +commit a07c3cc1eec0427a056414ef44ef6ee4204df383 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Aug 1 03:03:44 2007 +0300 + + XChangeDeviceControl: Fix completely broken locking + + Drop the display lock when we exit from XChangeDeviceControl(), instead of + leaking it. + +commit 7f1b5257b7eb0c873988c33453c110fc5f9996dd +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Aug 1 01:59:17 2007 +0300 + + Bump to 1.1.2 + +commit 257345a0500ef0b7cf8e56f19a8bf93721408673 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Aug 1 01:37:05 2007 +0300 + + DevicePresenceNotify: Don't make non-static function, static + + I wish that there was a better way to do this, but c'est la vie. It's our + exposed API, so we've just got to deal for now. + +commit 3da6998ef89c99ad01f20a8f37e3c26c0b7c1ced +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Jul 27 01:30:13 2007 +0930 + + XChangePointerKeyboardPairing, XGetPairedPointer, XSetClientPointer man pages. + + Use XID instead of int for XGetPairedPointer. + +commit 25c023f91851a4b32b295b6d5633f6ee87d0ba14 +Author: Paulo Ricardo Zanoni <prz05@c3sl.ufpr.br> +Date: Tue Jul 10 10:14:47 2007 +0930 + + Access control: change calls to use XID* instead of char*. + + X{Deny|Perm}Devices: clear perm/deny list if called with no devices. + +commit 9d0aa39742a0d1d4221ad4104708b0f8f60c14c7 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Jul 5 10:47:45 2007 +0930 + + Bump to version 1.1.1. + +commit ddc3b9cbbcc892a48dce2bd441e6d404cd44d943 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Jun 13 15:36:01 2007 +0930 + + Bug 9657: Bad markup on XGrabDeviceKey.3x + + <https://bugs.freedesktop.org/show_bug.cgi?id=9657> + +commit caa4ab9a959140119c6c2fd12a379b55b0dff258 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Jun 13 15:36:01 2007 +0930 + + Bug 9657: Bad markup on XGrabDeviceKey.3x + + <https://bugs.freedesktop.org/show_bug.cgi?id=9657> + +commit f128ce2d1f8dcd841185c728a6c2b44bb64108f6 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu May 17 20:16:49 2007 +0930 + + Squish flag and same_screen into the upper bits of mode (DeviceEnterLeave). + +commit 12e3d8b1db94feecf27ed98c8ac523f755c59e45 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon May 14 18:09:38 2007 +0930 + + Add XExtendedGrabDevice and XExtendedUngrabDevice. + +commit f8215ada9c1f3e8f001c77362005168492e35cf4 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon May 7 14:13:40 2007 +0930 + + Add XiSelectEvent call. + + Should have been part of 44ccc08bb19d9d55fb9ff6bfb0592d5d79b9b712. + +commit d76c4412c9fab7dae6b0283feb847174fb19d1fe +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed May 2 18:17:34 2007 +0930 + + Add XFakeDeviceData call. + +commit fe33724ed6cdaad6b13a7ca1c9f03dbb98d93982 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed May 2 09:44:37 2007 +0930 + + Add deviceid and ev-to-wire conversion for RawDeviceEvent. + +commit 44ccc08bb19d9d55fb9ff6bfb0592d5d79b9b712 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Tue May 1 22:30:04 2007 +0930 + + Add XGE support. Supporting RawDeviceEvents and PairingChangedNotifies. + +commit 656b31865bf44b5e9bb9603bed6115d497d94796 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Mar 22 21:15:00 2007 +1030 + + Change XSetClientPointer API to use XDevice argument instead of deviceid. + +commit 6476513b250a4ea4de1e93bfe00046e9b6a46732 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Mar 22 17:28:54 2007 +1030 + + Add XGetClientPointer call. + Add XGetPairedPointer call. + +commit e3ddf2f58a0e9822c248a362a975bf7bb786e23d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Fri Mar 9 15:47:36 2007 +1030 + + Add XSetClientPointer call. + +commit f1df9eb1ffc23b83418f9a9ce31d8b2ec748fbd4 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 22 20:07:11 2007 +1030 + + Add calls to allow per-device window access control + Cosmetic change, error return value in XQueryDevicePointer. + +commit 21765b25a938cf6c8302415d5d15e9a08c7bed98 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Feb 21 10:02:46 2007 +1030 + + Adding XRegisterPairingClient and XUnregisterPairingClient calls. + +commit 1ab0fa01391156d96cf6d3adc1076ad5216ac23d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Thu Feb 15 14:28:17 2007 +1030 + + Use flags byte in deviceEnterNotify and XDeviceCrossingEvents. + +commit 6a123cbfed985382f5b0c209d880dabeb8ee9733 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon Jan 29 18:20:47 2007 +1030 + + Adding XChangePointerKeyboardPairing call. + +commit bfd533c3a7e854d893a06e6a7fe2b3f079508a4d +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Jan 10 14:53:44 2007 +1030 + + Adding DeviceEnterNotify and DeviceLeaveNotify calls + New XI version using Add_MPX_Major/Minor + +commit ebc24f1fad85281a1e9e795ec261eea111f40304 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Mon Jan 8 12:32:27 2007 +1030 + + Adding XDefineDeviceCursor and XUndefDeviceCursor calls + Fix casting typo in XWarpDevicePointer and XQueryDevicePointer + Reverting useless whitespace commit in XExtInt.c + +commit 448def03e88d3460ce97a49df0816dedd609c1e3 +Author: Peter Hutterer <peter@cs.unisa.edu.au> +Date: Wed Dec 20 13:08:29 2006 +1030 + + Adding XWarpDevicePointer and XQueryDevicePointer calls. + +commit c8696a5230c565f8999fea136a85a875b04e7b9a +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Dec 6 18:56:56 2006 +0200 + + Makefile.am: make ChangeLog hook safer + + Make ChangeLog hook as safe as possible. + +commit 60dccd9a7be95e35b4b8c90934888efedfde84cc +Author: Jamey Sharp <jamey@minilop.net> +Date: Sun Nov 19 01:04:26 2006 -0800 + + Bug #8663: _XiCheckExtInit must drop the Display lock in all error cases. + +commit 41710257257939b181a1615937610550b40621b9 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Wed Nov 8 16:19:58 2006 +0200 + + DevicePresenceNotify: remove verbosity, fill out all fields + Don't throw a printf every time we get a DPN, and fill in all the fields + when copying the structure. + +commit eeebae55766bd4c0121479a7b7188d6a0545f66c +Author: Daniel Stone <daniel@fooishbar.org> +Date: Sat Oct 21 12:08:21 2006 +0300 + + re-enable iscore in DEVICE_CORE, re-enable DEVICE_ENABLE + +commit 50c88082ba2ee4785f4beaa351f2b772f1a381ad +Author: Zephaniah E. Hull <warp@agamemnon.b5> +Date: Sat Oct 21 04:01:46 2006 -0400 + + Comment out DEVICE_ENABLE, and use of iscore in the DEVICE_CORE control. + (We now compile again.) + + Track the DEVICE_TOUCHSCREEN -> DEVICE_ABS_CALIB and new DEVICE_ABS_AREA + changes to the input protocol. + +commit 2a3f042241bb63601f5745f397bb1b66ecc5a592 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Fri Oct 20 00:39:50 2006 +0300 + + add DEVICE_ENABLE control, add iscore to DEVICE_CORE + + Add DEVICE_ENABLE for enabling/disabling devices, and an 'iscore' + flag to DEVICE_CORE that specifies whether or not the device is a + virtual core device. + +commit c27e00ceceed3fea011c98c0e70ab568bf0687c6 +Author: Jamey Sharp <jamey@minilop.net> +Date: Sun Oct 15 00:26:21 2006 -0700 + + Don't call XInput_find_display in _XiCheckExtInit, while the Display lock is held. + + All callers of _XiCheckExtInit have already called XInput_find_display + first outside the lock, so just pass their copy of the XExtDisplayInfo + structure down. Besides being more correct, this should be slightly + faster. :-) + + Thanks to Magnus Kessler <Magnus.Kessler@gmx.net> for identifying + the bug and proposing a workaround. + +commit 5dda1e1509d40ef64ebc816ce538cef462a4fa51 +Author: Jamey Sharp <jamey@minilop.net> +Date: Sun Oct 15 00:03:57 2006 -0700 + + Don't call XInput_find_display in _XiGetExtensionVersion, while the Display lock is held. + + _XiGetExtensionVersion has two callers. One had already called + XInput_find_display, and the other could easily do so outside the + Display lock. So I change the _XiGetExtensionVersion interface to + accept a previously-computed XExtDisplayInfo from the caller. + Besides being more correct, this should be slightly faster. :-) + + Thanks to Magnus Kessler <Magnus.Kessler@gmx.net> for identifying + the bug and proposing a workaround. + +commit 8e317d390d1ef8f2c072957355b5d71db3b89c43 +Author: Jamey Sharp <jamey@minilop.net> +Date: Sat Oct 14 23:56:20 2006 -0700 + + Add *.o to .gitignore. + +commit 6e08a76fd8e356f98d2d6913f0c1b1401090768d +Merge: ba84e84 360ceac +Author: Daniel Stone <daniel@fooishbar.org> +Date: Sun Sep 24 20:02:24 2006 +0300 + + Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/lib/libXi + +commit ba84e84575b4167b0c6298e86a860b0741e2d2a3 +Merge: 93d3c2c 576c579 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Sun Sep 24 19:58:56 2006 +0300 + + Merge branch 'input-hotplug' + +commit 360ceacb2a3cbad1652d1b02d79b24469db2980a +Author: Drew Parsons <dparsons@debian.org> +Date: Mon Aug 14 14:10:52 2006 -0700 + + Bug 7855/Patch 6530: incorrect manpage section suffix + + Bug 7855 <https://bugs.freedesktop.org/show_bug.cgi?id=7855> + Patch 6530 <https://bugs.freedesktop.org/attachment.cgi?id=6530> + Based on patch by Fabio M. Di Nitto c/- Colin Watson, Debian Bug#377204. + +commit 576c5794cf4b786dfc183c9b6f0a387cad4a5460 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jul 18 11:46:02 2006 -0400 + + bump version to 1.1.0, require inputproto 1.4 + Bump the version to 1.1.0, and make sure we build with inputproto 1.4, + for the DEVICE_{TOUCHSCREEN,CORE} controls, and DevicePresenceNotify. + +commit b22d8d0e1519d3f86474f4a79f3c4b27b46c662a +Author: Daniel Stone <krh@redhat.com> +Date: Tue Jul 18 11:45:07 2006 -0400 + + add DevicePresenceNotify event + Add a DevicePresenceNotify event, which notes that something about the + device list changed. + +commit 878d9e76764d27f5af861817b46b2caf2d89d7c4 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jul 18 11:43:24 2006 -0400 + + add sensible DEVICE_TOUCHSCREEN and DEVICE_CORE controls + Add a more sensible DEVICE_TOUCHSCREEN control, which allows you to + clip the x and y values. + Add a DEVICE_CORE control, which toggles the sending of core events + by extended devices. + +commit 93d3c2c45ccd9a806342746c4df33c684a284dd6 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jul 18 11:39:16 2006 -0400 + + remove ChangeLog, add dist hook + Remove ChangeLog from the tree, and add a git dist hook to generate + it automatically. + +commit 8f0d3c6d1f64fdc3b20d0beb831fa457214d5188 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jul 18 11:28:58 2006 -0400 + + fix indentation on function declarations + Another brief run with indent. + +commit 2d9a57cd77575ca9850d226c79a897cbe88d06e9 +Author: Alan Coopersmith <alan.coopersmith@sun.com> +Date: Thu Jul 13 14:58:59 2006 -0700 + + renamed: .cvsignore -> .gitignore + +commit 5693a8da9bdf553e1c9a8ebd50d0d75018cc5c0e +Author: Adam Jackson <ajax@nwnk.net> +Date: Thu Apr 27 00:14:32 2006 +0000 + + Bump to 1.0.1 + +commit f50ac4deec13dfd070715f636887e12f6301070f +Author: Daniel Stone <daniel@fooishbar.org> +Date: Fri Mar 31 14:50:24 2006 +0000 + + Mass reindent. Sorry. + +commit 6b055729fd0f89eedd2bf00befd8e42804f12b4a +Author: Adam Jackson <ajax@nwnk.net> +Date: Mon Mar 20 19:54:58 2006 +0000 + + Bug #6286: Fix build on Cygwin. (Yaakov Selkowitz) + +commit 48ad6d382f6fdc9fba416cc5ee9d49324b515b68 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Sun Feb 12 18:19:22 2006 +0000 + + Bug #5628 <https://bugs.freedesktop.org/show_bug.cgi?id=5628> Shadow pages + not created correctly when MANDIR & MANSUFFIX don't match. + +commit 04debb347c80f9487b4b507e5202d323d6b2d05a +Author: Kevin E Martin <kem@kem.org> +Date: Thu Dec 15 00:24:30 2005 +0000 + + Update package version number for final X11R7 release candidate. + +commit 2c3bffb3e4ba665da6a9a152a65ac94b7eb8421e +Author: Kevin E Martin <kem@kem.org> +Date: Tue Dec 6 22:48:43 2005 +0000 + + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +commit 82059b8d9f29e140a9abd40e93bb9f66f0963638 +Author: Kevin E Martin <kem@kem.org> +Date: Sat Dec 3 05:49:44 2005 +0000 + + Update package version number for X11R7 RC3 release. + +commit f8652da907e902e4ee0b682851e2918a363f0d3d +Author: Kevin E Martin <kem@kem.org> +Date: Sat Dec 3 04:41:49 2005 +0000 + + Add check and cflags for malloc(0) returning NULL. + +commit 5401f8a75cdc9ef218acda9a25f440ff136d2543 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Mon Nov 28 22:03:05 2005 +0000 + + Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 + update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) + +commit fcbf0710165e6f87633e5a044229172c81a90341 +Author: Kevin E Martin <kem@kem.org> +Date: Sat Nov 19 07:15:41 2005 +0000 + + Update pkgconfig files to separate library build-time dependencies from + application build-time dependencies, and update package deps to work + with separate build roots. + +commit ef419a10f278e3fc66f2e4166c895e7ffcaab58d +Author: Kevin E Martin <kem@kem.org> +Date: Wed Oct 19 02:48:10 2005 +0000 + + Update package version number for RC1 release. + +commit 367dcdc269e67130569ad4665a50fe053070afe7 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Tue Oct 18 00:00:08 2005 +0000 + + Use @LIB_MAN_SUFFIX@ instead of $(LIB_MAN_SUFFIX) in macro substitutions to + work better with BSD make + +commit 8ec9b7efc4f3d9fca2ba25f090b282469c996145 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Mon Oct 17 21:13:21 2005 +0000 + + Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a + suffix rule (reported by Matthieu Herrb) + +commit 6967e23708c1411c3ce0fd832f811bb769c99626 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Thu Oct 13 04:25:46 2005 +0000 + + Add generated man pages to .cvsignores + +commit 7e777d014ec5b9c768f9c0d5a6dc27ff7e89135b +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Wed Oct 12 01:01:29 2005 +0000 + + Use sed to put version number in man page Add shadow man pages for man + pages that document multiple functions. + +commit af2031f4df3080f91ff258b92a4d373b5f28ef48 +Author: Kevin E Martin <kem@kem.org> +Date: Wed Oct 5 19:55:52 2005 +0000 + + Added missing file to EXTRA_DIST + +commit 403868cc906504c2339a7e204dad39b735b53440 +Author: Kevin E Martin <kem@kem.org> +Date: Fri Jul 29 21:22:51 2005 +0000 + + Various changes preparing packages for RC0: + - Verify and update package version numbers as needed + - Implement versioning scheme + - Change bug address to point to bugzilla bug entry form + - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to + reenable it) + - Fix makedepend to use pkgconfig and pass distcheck + - Update build script to build macros first + - Update modular Xorg version + +commit e715500a2a4e21adc162bbc0bb3edb60a131831a +Author: Daniel Stone <daniel@fooishbar.org> +Date: Sat Jul 16 07:10:44 2005 +0000 + + Set soversion to 6.0.0 using -version-number. + +commit 8603538c6ab5488e70179bdfcf46196b7defe253 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jul 12 07:59:16 2005 +0000 + + Change version to 1.3.0 and soversion to 6.0.0; add XIint.h to distfiles. + +commit da5d2fbc2d5ed6ebe09d69816e5d9ac9972a04b2 +Author: Keith Packard <keithp@keithp.com> +Date: Sat Jul 9 06:40:48 2005 +0000 + + Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory + +commit 411d59f535e4b5bda9c0fed9384506500c2c18ca +Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk> +Date: Fri Jul 1 20:09:11 2005 +0000 + + xtrap.pc.in: s/Xfixes/XTrap/ xi.pc.in: s/Xt/Xi/ Xv/src/Makefile.am: remove + whitespace after backslash modularizeapp.sh: s/destkop/desktop/ + modular/symlink.sh: Add bitmaps for xeyes, system.xsm for xsm, and + Xvidtune.cpp for xvidtune. Also comment out non-existing mga_bios.h + Check in buildsystems for xsetroot, xsm, xstdcmap, xtrap, and xvinfo + +commit 42f0c4cae76a67e6684b3b3e76d61780a197c798 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Fri Jul 1 16:16:15 2005 +0000 + + spell freedesktop.org correctly + +commit b50e6e06f22d3c653166e1817d75c3f4a98b2748 +Author: Alan Coopersmith <Alan.Coopersmith@sun.com> +Date: Sun May 22 19:37:27 2005 +0000 + + Autotool libXi + +commit c1990aed3deb74e3bec72a99bf43debe53d8506a +Author: Egbert Eich <eich@suse.de> +Date: Fri Apr 23 18:43:44 2004 +0000 + + Merging XORG-CURRENT into trunk + +commit 1ca71687d852a2aba9389f71af0c9df396bbb4b3 +Author: Egbert Eich <eich@suse.de> +Date: Sun Mar 14 08:32:12 2004 +0000 + + Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit e1cf8e198c35b65c95d54a5dfe888e054f4b7056 +Author: Egbert Eich <eich@suse.de> +Date: Wed Mar 3 12:11:28 2004 +0000 + + Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit 07b3ed21a6223e9d913e8222bf3a94174a82383a +Author: Egbert Eich <eich@suse.de> +Date: Thu Feb 26 13:35:33 2004 +0000 + + readding XFree86's cvs IDs + +commit 52336bb78203b3ee478404ba8bf680ae305a0d31 +Author: Egbert Eich <eich@suse.de> +Date: Thu Feb 26 09:22:43 2004 +0000 + + Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit 1b4f7c4f6dbbc62db74f433a73d129ae507642cd +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Tue Nov 25 19:28:15 2003 +0000 + + XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks + +commit 3986f13c9319b4f64c7b2ec56391370735e7d51d +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Nov 14 16:48:49 2003 +0000 + + XFree86 4.3.0.1 + +commit 6b1f87ebe718c9c745d5f4b26343ee3cf34ff5cc +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Nov 14 16:48:49 2003 +0000 + + Initial revision + +commit 981020ce68e4c8d9c0dafba631b0fd3328d7fc59 +Author: Kaleb Keithley <kaleb@freedesktop.org> +Date: Fri Nov 14 15:54:38 2003 +0000 + + R6.6 is the Xorg base-line diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8b82ade --- /dev/null +++ b/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..825861e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = src man specs + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = xi.pc + +MAINTAINERCLEANFILES = ChangeLog INSTALL + +.PHONY: ChangeLog INSTALL + +INSTALL: + $(INSTALL_CMD) + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog INSTALL diff --git a/README b/README new file mode 100644 index 0000000..44c705e --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +libXi - library for the X Input Extension + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +Please submit bug reports to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/lib/libXi + + http://cgit.freedesktop.org/xorg/lib/libXi + +For patch submission instructions, see: + + http://www.x.org/wiki/Development/Documentation/SubmittingPatches + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..2d3a46a --- /dev/null +++ b/configure.ac @@ -0,0 +1,56 @@ + +# Initialize Autoconf +AC_PREREQ([2.60]) +AC_INIT([libXi], [1.6.1], + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXi]) +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS([src/config.h]) + +# Initialize Automake +AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_MAINTAINER_MODE + +# Initialize libtool +AC_PROG_LIBTOOL + +# Require xorg-macros minimum of 1.12 for DocBook external references +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.12) +XORG_DEFAULT_OPTIONS +XORG_ENABLE_DOCS +XORG_ENABLE_SPECS +XORG_WITH_XMLTO(0.0.22) +XORG_WITH_FOP +XORG_WITH_XSLTPROC +XORG_CHECK_SGML_DOCTOOLS(1.8) +XORG_WITH_ASCIIDOC(8.4.5) +XORG_CHECK_MALLOC_ZERO + +# Obtain compiler/linker options for dependencies +PKG_CHECK_MODULES(XI, [xproto >= 7.0.13] [x11 >= 1.4.99.1] [xextproto >= 7.0.3] [xext >= 1.0.99.1] [inputproto >= 2.1.99.6]) + +# Check for xmlto and asciidoc for man page conversion +# (only needed by people building tarballs) +if test "$have_xmlto" = yes && test "$have_asciidoc" = yes; then + have_doctools=yes +else + have_doctools=no +fi +AM_CONDITIONAL([HAVE_DOCTOOLS], [test $have_doctools = yes]) +if test $have_doctools = no; then + AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it]) +fi + +# Determine if the source for man pages is available +# It may already be present (tarball) or can be generated using doctools +AM_CONDITIONAL([INSTALL_MANPAGES], + [test -f "$srcdir/man/XAllowDeviceEvents.man" || \ + test $have_doctools = yes]) + +AC_CONFIG_FILES([Makefile + src/Makefile + man/Makefile + specs/Makefile + xi.pc]) +AC_OUTPUT diff --git a/docbook.am b/docbook.am new file mode 100644 index 0000000..bba4d54 --- /dev/null +++ b/docbook.am @@ -0,0 +1,105 @@ +# +# Generate output formats for a single DocBook/XML with/without chapters +# +# Variables set by the calling Makefile: +# shelfdir: the location where the docs/specs are installed. Typically $(docdir) +# docbook: the main DocBook/XML file, no chapters, appendix or image files +# chapters: all files pulled in by an XInclude statement and images. +# + +# +# This makefile is intended for Users Documentation and Functional Specifications. +# Do not use for Developer Documentation which is not installed and does not require olink. +# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 +# for an explanation on documents classification. +# + +# DocBook/XML generated output formats to be installed +shelf_DATA = + +# DocBook/XML file with chapters, appendix and images it includes +dist_shelf_DATA = $(docbook) $(chapters) + +if HAVE_XMLTO +if HAVE_STYLESHEETS + +XMLTO_SEARCHPATH_FLAGS = \ + --searchpath "$(XORG_SGML_PATH)/X11" \ + --searchpath "$(abs_top_builddir)" +XMLTO_HTML_OLINK_FLAGS = \ + --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \ + --stringparam current.docid="$(<:.xml=)" +XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl +XMLTO_HTML_FLAGS = \ + $(XMLTO_SEARCHPATH_FLAGS) \ + $(XMLTO_HTML_STYLESHEET_FLAGS) \ + $(XMLTO_HTML_OLINK_FLAGS) + +shelf_DATA += $(docbook:.xml=.html) +%.html: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< + +if HAVE_XMLTO_TEXT + +shelf_DATA += $(docbook:.xml=.txt) +%.txt: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< +endif HAVE_XMLTO_TEXT + +if HAVE_FOP +XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/ +XMLTO_PDF_OLINK_FLAGS = \ + --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \ + --stringparam current.docid="$(<:.xml=)" +XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl + +XMLTO_FO_FLAGS = \ + $(XMLTO_SEARCHPATH_FLAGS) \ + $(XMLTO_FO_STYLESHEET_FLAGS) \ + $(XMLTO_FO_IMAGEPATH_FLAGS) \ + $(XMLTO_PDF_OLINK_FLAGS) + +shelf_DATA += $(docbook:.xml=.pdf) +%.pdf: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< + +shelf_DATA += $(docbook:.xml=.ps) +%.ps: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< +endif HAVE_FOP + +# Generate documents cross-reference target databases +if HAVE_XSLTPROC + +XSLT_SEARCHPATH_FLAGS = \ + --path "$(XORG_SGML_PATH)/X11" \ + --path "$(abs_top_builddir)" +XSLT_OLINK_FLAGS = \ + --stringparam targets.filename "$@" \ + --stringparam collect.xref.targets "only" \ + --stringparam olink.base.uri "$(@:.db=)" + +XSLT_HTML_FLAGS = \ + $(XSLT_SEARCHPATH_FLAGS) \ + $(XSLT_OLINK_FLAGS) \ + --nonet --xinclude \ + $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl +XSLT_PDF_FLAGS = \ + $(XSLT_SEARCHPATH_FLAGS) \ + $(XSLT_OLINK_FLAGS) \ + --nonet --xinclude \ + $(STYLESHEET_SRCDIR)/xorg-fo.xsl + +shelf_DATA += $(docbook:.xml=.html.db) +%.html.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $< + +shelf_DATA += $(docbook:.xml=.pdf.db) +%.pdf.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $< + +endif HAVE_XSLTPROC +endif HAVE_STYLESHEETS +endif HAVE_XMLTO + +CLEANFILES = $(shelf_DATA) diff --git a/include/X11/extensions/XInput.h b/include/X11/extensions/XInput.h new file mode 100644 index 0000000..b17f388 --- /dev/null +++ b/include/X11/extensions/XInput.h @@ -0,0 +1,1277 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/* Definitions used by the library and client */ + +#ifndef _XINPUT_H_ +#define _XINPUT_H_ + +#include <X11/Xlib.h> +#include <X11/extensions/XI.h> + +#define _deviceKeyPress 0 +#define _deviceKeyRelease 1 + +#define _deviceButtonPress 0 +#define _deviceButtonRelease 1 + +#define _deviceMotionNotify 0 + +#define _deviceFocusIn 0 +#define _deviceFocusOut 1 + +#define _proximityIn 0 +#define _proximityOut 1 + +#define _deviceStateNotify 0 +#define _deviceMappingNotify 1 +#define _changeDeviceNotify 2 +/* Space of 3 between is necessary! Reserved for DeviceKeyStateNotify, + DeviceButtonStateNotify, DevicePresenceNotify (essentially unused). This + code has to be in sync with FixExtensionEvents() in xserver/Xi/extinit.c */ +#define _propertyNotify 6 + +#define FindTypeAndClass(d,type,_class,classid,offset) \ + { int _i; XInputClassInfo *_ip; \ + type = 0; _class = 0; \ + for (_i=0, _ip= ((XDevice *) d)->classes; \ + _i< ((XDevice *) d)->num_classes; \ + _i++, _ip++) \ + if (_ip->input_class == classid) \ + {type = _ip->event_type_base + offset; \ + _class = ((XDevice *) d)->device_id << 8 | type;}} + +#define DeviceKeyPress(d,type,_class) \ + FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyPress) + +#define DeviceKeyRelease(d,type,_class) \ + FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyRelease) + +#define DeviceButtonPress(d,type,_class) \ + FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonPress) + +#define DeviceButtonRelease(d,type,_class) \ + FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonRelease) + +#define DeviceMotionNotify(d,type,_class) \ + FindTypeAndClass(d, type, _class, ValuatorClass, _deviceMotionNotify) + +#define DeviceFocusIn(d,type,_class) \ + FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusIn) + +#define DeviceFocusOut(d,type,_class) \ + FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusOut) + +#define ProximityIn(d,type,_class) \ + FindTypeAndClass(d, type, _class, ProximityClass, _proximityIn) + +#define ProximityOut(d,type,_class) \ + FindTypeAndClass(d, type, _class, ProximityClass, _proximityOut) + +#define DeviceStateNotify(d,type,_class) \ + FindTypeAndClass(d, type, _class, OtherClass, _deviceStateNotify) + +#define DeviceMappingNotify(d,type,_class) \ + FindTypeAndClass(d, type, _class, OtherClass, _deviceMappingNotify) + +#define ChangeDeviceNotify(d,type,_class) \ + FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify) + +#define DevicePropertyNotify(d, type, _class) \ + FindTypeAndClass(d, type, _class, OtherClass, _propertyNotify) + +#define DevicePointerMotionHint(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;} + +#define DeviceButton1Motion(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;} + +#define DeviceButton2Motion(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;} + +#define DeviceButton3Motion(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;} + +#define DeviceButton4Motion(d,type, _class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;} + +#define DeviceButton5Motion(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;} + +#define DeviceButtonMotion(d,type, _class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;} + +#define DeviceOwnerGrabButton(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;} + +#define DeviceButtonPressGrab(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;} + +#define NoExtensionEvent(d,type,_class) \ + { _class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;} + + +/* We need the declaration for DevicePresence. */ +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + extern int _XiGetDevicePresenceNotifyEvent(Display *); + extern void _xibaddevice( Display *dpy, int *error); + extern void _xibadclass( Display *dpy, int *error); + extern void _xibadevent( Display *dpy, int *error); + extern void _xibadmode( Display *dpy, int *error); + extern void _xidevicebusy( Display *dpy, int *error); +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#define DevicePresence(dpy, type, _class) \ + { \ + type = _XiGetDevicePresenceNotifyEvent(dpy); \ + _class = (0x10000 | _devicePresence); \ + } + +/* Errors */ +#define BadDevice(dpy,error) _xibaddevice(dpy, &error) + +#define BadClass(dpy,error) _xibadclass(dpy, &error) + +#define BadEvent(dpy,error) _xibadevent(dpy, &error) + +#define BadMode(dpy,error) _xibadmode(dpy, &error) + +#define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error) + +typedef struct _XAnyClassinfo *XAnyClassPtr; + +/*************************************************************** + * + * DeviceKey events. These events are sent by input devices that + * support input class Keys. + * The location of the X pointer is reported in the coordinate + * fields of the x,y and x_root,y_root fields. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int keycode; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceKeyEvent; + +typedef XDeviceKeyEvent XDeviceKeyPressedEvent; +typedef XDeviceKeyEvent XDeviceKeyReleasedEvent; + +/******************************************************************* + * + * DeviceButton events. These events are sent by extension devices + * that support input class Buttons. + * + */ + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int button; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceButtonEvent; + +typedef XDeviceButtonEvent XDeviceButtonPressedEvent; +typedef XDeviceButtonEvent XDeviceButtonReleasedEvent; + +/******************************************************************* + * + * DeviceMotionNotify event. These events are sent by extension devices + * that support input class Valuators. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + char is_hint; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceMotionEvent; + +/******************************************************************* + * + * DeviceFocusChange events. These events are sent when the focus + * of an extension device that can be focused is changed. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + */ + Time time; + } XDeviceFocusChangeEvent; + +typedef XDeviceFocusChangeEvent XDeviceFocusInEvent; +typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent; + +/******************************************************************* + * + * ProximityNotify events. These events are sent by those absolute + * positioning devices that are capable of generating proximity information. + * + */ + +typedef struct + { + int type; /* ProximityIn or ProximityOut */ + 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; + XID deviceid; + Window root; + Window subwindow; + Time time; + int x, y; + int x_root, y_root; + unsigned int state; + Bool same_screen; + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XProximityNotifyEvent; +typedef XProximityNotifyEvent XProximityInEvent; +typedef XProximityNotifyEvent XProximityOutEvent; + +/******************************************************************* + * + * DeviceStateNotify events are generated on EnterWindow and FocusIn + * for those clients who have selected DeviceState. + * + */ + +typedef struct + { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + } XInputClass; + +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; + XID deviceid; + Time time; + int num_classes; + char data[64]; +} XDeviceStateNotifyEvent; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int valuators[6]; +} XValuatorStatus; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + short num_keys; + char keys[32]; +} XKeyStatus; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonStatus; + +/******************************************************************* + * + * DeviceMappingNotify event. This event is sent when the key mapping, + * modifier mapping, or button mapping of an extension device is 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 */ + XID deviceid; + Time time; + int request; /* one of MappingModifier, MappingKeyboard, + MappingPointer */ + int first_keycode;/* first keycode */ + int count; /* defines range of change w. first_keycode*/ +} XDeviceMappingEvent; + +/******************************************************************* + * + * ChangeDeviceNotify event. This event is sent when an + * XChangeKeyboard or XChangePointer request is made. + * + */ + +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 */ + XID deviceid; + Time time; + int request; /* NewPointer or NewKeyboard */ +} XChangeDeviceNotifyEvent; + +/******************************************************************* + * + * DevicePresenceNotify event. This event is sent when the list of + * input devices changes, in which case devchange will be false, and + * no information about the change will be contained in the event; + * the client should use XListInputDevices() to learn what has changed. + * + * If devchange is true, an attribute that the server believes is + * important has changed on a device, and the client should use + * XGetDeviceControl to examine the device. If control is non-zero, + * then that control has changed meaningfully. + */ + +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; + Bool devchange; + XID deviceid; + XID control; +} XDevicePresenceNotifyEvent; + +/* + * Notifies the client that a property on a device has changed value. The + * client is expected to query the server for updated value of the property. + */ +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; + XID deviceid; /* id of the device that changed */ + Atom atom; /* the property that changed */ + int state; /* PropertyNewValue or PropertyDeleted */ +} XDevicePropertyNotifyEvent; + + +/******************************************************************* + * + * Control structures for input devices that support input class + * Feedback. These are used by the XGetFeedbackControl and + * XChangeFeedbackControl functions. + * + */ + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; +} XFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKbdFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int resolution; + int minVal; + int maxVal; +} XIntegerFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int max_symbols; + int num_syms_supported; + KeySym *syms_supported; +} XStringFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int led_values; + int led_mask; +} XLedFeedbackState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; +} XFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int led_value; + int key; + int auto_repeat_mode; +} XKbdFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int num_keysyms; + KeySym *syms_to_display; +} XStringFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int int_to_display; +} XIntegerFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackControl; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + XID id; + int led_mask; + int led_values; +} XLedFeedbackControl; + +/******************************************************************* + * + * Device control structures. + * + */ + +typedef struct { + XID control; + int length; +} XDeviceControl; + +typedef struct { + XID control; + int length; + int first_valuator; + int num_valuators; + int *resolutions; +} XDeviceResolutionControl; + +typedef struct { + XID control; + int length; + int num_valuators; + int *resolutions; + int *min_resolutions; + int *max_resolutions; +} XDeviceResolutionState; + +typedef struct { + XID control; + int length; + int min_x; + int max_x; + int min_y; + int max_y; + int flip_x; + int flip_y; + int rotation; + int button_threshold; +} XDeviceAbsCalibControl, XDeviceAbsCalibState; + +typedef struct { + XID control; + int length; + int offset_x; + int offset_y; + int width; + int height; + int screen; + XID following; +} XDeviceAbsAreaControl, XDeviceAbsAreaState; + +typedef struct { + XID control; + int length; + int status; +} XDeviceCoreControl; + +typedef struct { + XID control; + int length; + int status; + int iscore; +} XDeviceCoreState; + +typedef struct { + XID control; + int length; + int enable; +} XDeviceEnableControl, XDeviceEnableState; + +/******************************************************************* + * + * An array of XDeviceList structures is returned by the + * XListInputDevices function. Each entry contains information + * about one input device. Among that information is an array of + * pointers to structures that describe the characteristics of + * the input device. + * + */ + +typedef struct _XAnyClassinfo { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + } XAnyClassInfo; + +typedef struct _XDeviceInfo *XDeviceInfoPtr; + +typedef struct _XDeviceInfo + { + XID id; + Atom type; + char *name; + int num_classes; + int use; + XAnyClassPtr inputclassinfo; + } XDeviceInfo; + +typedef struct _XKeyInfo *XKeyInfoPtr; + +typedef struct _XKeyInfo + { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; + } XKeyInfo; + +typedef struct _XButtonInfo *XButtonInfoPtr; + +typedef struct _XButtonInfo { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + short num_buttons; + } XButtonInfo; + +typedef struct _XAxisInfo *XAxisInfoPtr; + +typedef struct _XAxisInfo { + int resolution; + int min_value; + int max_value; + } XAxisInfo; + +typedef struct _XValuatorInfo *XValuatorInfoPtr; + +typedef struct _XValuatorInfo + { +#if defined(__cplusplus) || defined(c_plusplus) + XID c_class; +#else + XID class; +#endif + int length; + unsigned char num_axes; + unsigned char mode; + unsigned long motion_buffer; + XAxisInfoPtr axes; + } XValuatorInfo; + +/******************************************************************* + * + * An XDevice structure is returned by the XOpenDevice function. + * It contains an array of pointers to XInputClassInfo structures. + * Each contains information about a class of input supported by the + * device, including a pointer to an array of data for each type of event + * the device reports. + * + */ + + +typedef struct { + unsigned char input_class; + unsigned char event_type_base; +} XInputClassInfo; + +typedef struct { + XID device_id; + int num_classes; + XInputClassInfo *classes; +} XDevice; + + +/******************************************************************* + * + * The following structure is used to return information for the + * XGetSelectedExtensionEvents function. + * + */ + +typedef struct { + XEventClass event_type; + XID device; +} XEventList; + +/******************************************************************* + * + * The following structure is used to return motion history data from + * an input device that supports the input class Valuators. + * This information is returned by the XGetDeviceMotionEvents function. + * + */ + +typedef struct { + Time time; + int *data; +} XDeviceTimeCoord; + + +/******************************************************************* + * + * Device state structure. + * This is returned by the XQueryDeviceState request. + * + */ + +typedef struct { + XID device_id; + int num_classes; + XInputClass *data; +} XDeviceState; + +/******************************************************************* + * + * Note that the mode field is a bitfield that reports the Proximity + * status of the device as well as the mode. The mode field should + * be OR'd with the mask DeviceMode and compared with the values + * Absolute and Relative to determine the mode, and should be OR'd + * with the mask ProximityState and compared with the values InProximity + * and OutOfProximity to determine the proximity state. + * + */ + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int *valuators; +} XValuatorState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + short num_keys; + char keys[32]; +} XKeyState; + +typedef struct { +#if defined(__cplusplus) || defined(c_plusplus) + unsigned char c_class; +#else + unsigned char class; +#endif + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonState; + + + +/******************************************************************* + * + * Function definitions. + * + */ + +_XFUNCPROTOBEGIN + +extern int XChangeKeyboardDevice( + Display* /* display */, + XDevice* /* device */ +); + +extern int XChangePointerDevice( + Display* /* display */, + XDevice* /* device */, + int /* xaxis */, + int /* yaxis */ +); + +extern int XGrabDevice( + Display* /* display */, + XDevice* /* device */, + Window /* grab_window */, + Bool /* ownerEvents */, + int /* event count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */, + Time /* time */ +); + +extern int XUngrabDevice( + Display* /* display */, + XDevice* /* device */, + Time /* time */ +); + +extern int XGrabDeviceKey( + Display* /* display */, + XDevice* /* device */, + unsigned int /* key */, + unsigned int /* modifiers */, + XDevice* /* modifier_device */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */ +); + +extern int XUngrabDeviceKey( + Display* /* display */, + XDevice* /* device */, + unsigned int /* key */, + unsigned int /* modifiers */, + XDevice* /* modifier_dev */, + Window /* grab_window */ +); + +extern int XGrabDeviceButton( + Display* /* display */, + XDevice* /* device */, + unsigned int /* button */, + unsigned int /* modifiers */, + XDevice* /* modifier_device */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */ +); + +extern int XUngrabDeviceButton( + Display* /* display */, + XDevice* /* device */, + unsigned int /* button */, + unsigned int /* modifiers */, + XDevice* /* modifier_dev */, + Window /* grab_window */ +); + +extern int XAllowDeviceEvents( + Display* /* display */, + XDevice* /* device */, + int /* event_mode */, + Time /* time */ +); + +extern int XGetDeviceFocus( + Display* /* display */, + XDevice* /* device */, + Window* /* focus */, + int* /* revert_to */, + Time* /* time */ +); + +extern int XSetDeviceFocus( + Display* /* display */, + XDevice* /* device */, + Window /* focus */, + int /* revert_to */, + Time /* time */ +); + +extern XFeedbackState *XGetFeedbackControl( + Display* /* display */, + XDevice* /* device */, + int* /* num_feedbacks */ +); + +extern void XFreeFeedbackList( + XFeedbackState* /* list */ +); + +extern int XChangeFeedbackControl( + Display* /* display */, + XDevice* /* device */, + unsigned long /* mask */, + XFeedbackControl* /* f */ +); + +extern int XDeviceBell( + Display* /* display */, + XDevice* /* device */, + XID /* feedbackclass */, + XID /* feedbackid */, + int /* percent */ +); + +extern KeySym *XGetDeviceKeyMapping( + Display* /* display */, + XDevice* /* device */, +#if NeedWidePrototypes + unsigned int /* first */, +#else + KeyCode /* first */, +#endif + int /* keycount */, + int* /* syms_per_code */ +); + +extern int XChangeDeviceKeyMapping( + Display* /* display */, + XDevice* /* device */, + int /* first */, + int /* syms_per_code */, + KeySym* /* keysyms */, + int /* count */ +); + +extern XModifierKeymap *XGetDeviceModifierMapping( + Display* /* display */, + XDevice* /* device */ +); + +extern int XSetDeviceModifierMapping( + Display* /* display */, + XDevice* /* device */, + XModifierKeymap* /* modmap */ +); + +extern int XSetDeviceButtonMapping( + Display* /* display */, + XDevice* /* device */, + unsigned char* /* map[] */, + int /* nmap */ +); + +extern int XGetDeviceButtonMapping( + Display* /* display */, + XDevice* /* device */, + unsigned char* /* map[] */, + unsigned int /* nmap */ +); + +extern XDeviceState *XQueryDeviceState( + Display* /* display */, + XDevice* /* device */ +); + +extern void XFreeDeviceState( + XDeviceState* /* list */ +); + +extern XExtensionVersion *XGetExtensionVersion( + Display* /* display */, + _Xconst char* /* name */ +); + +extern XDeviceInfo *XListInputDevices( + Display* /* display */, + int* /* ndevices */ +); + +extern void XFreeDeviceList( + XDeviceInfo* /* list */ +); + +extern XDevice *XOpenDevice( + Display* /* display */, + XID /* id */ +); + +extern int XCloseDevice( + Display* /* display */, + XDevice* /* device */ +); + +extern int XSetDeviceMode( + Display* /* display */, + XDevice* /* device */, + int /* mode */ +); + +extern int XSetDeviceValuators( + Display* /* display */, + XDevice* /* device */, + int* /* valuators */, + int /* first_valuator */, + int /* num_valuators */ +); + +extern XDeviceControl *XGetDeviceControl( + Display* /* display */, + XDevice* /* device */, + int /* control */ +); + +extern int XChangeDeviceControl( + Display* /* display */, + XDevice* /* device */, + int /* control */, + XDeviceControl* /* d */ +); + +extern int XSelectExtensionEvent( + Display* /* display */, + Window /* w */, + XEventClass* /* event_list */, + int /* count */ +); + +extern int XGetSelectedExtensionEvents( + Display* /* display */, + Window /* w */, + int* /* this_client_count */, + XEventClass** /* this_client_list */, + int* /* all_clients_count */, + XEventClass** /* all_clients_list */ +); + +extern int XChangeDeviceDontPropagateList( + Display* /* display */, + Window /* window */, + int /* count */, + XEventClass* /* events */, + int /* mode */ +); + +extern XEventClass *XGetDeviceDontPropagateList( + Display* /* display */, + Window /* window */, + int* /* count */ +); + +extern Status XSendExtensionEvent( + Display* /* display */, + XDevice* /* device */, + Window /* dest */, + Bool /* prop */, + int /* count */, + XEventClass* /* list */, + XEvent* /* event */ +); + +extern XDeviceTimeCoord *XGetDeviceMotionEvents( + Display* /* display */, + XDevice* /* device */, + Time /* start */, + Time /* stop */, + int* /* nEvents */, + int* /* mode */, + int* /* axis_count */ +); + +extern void XFreeDeviceMotionEvents( + XDeviceTimeCoord* /* events */ +); + +extern void XFreeDeviceControl( + XDeviceControl* /* control */ +); + +extern Atom* XListDeviceProperties( + Display* /* dpy */, + XDevice* /* dev */, + int* /* nprops_return */ +); + +extern void XChangeDeviceProperty( + Display* /* dpy */, + XDevice* /* dev */, + Atom /* property */, + Atom /* type */, + int /* format */, + int /* mode */, + _Xconst unsigned char * /*data */, + int /* nelements */ +); + +extern void +XDeleteDeviceProperty( + Display* /* dpy */, + XDevice* /* dev */, + Atom /* property */ +); + +extern Status +XGetDeviceProperty( + Display* /* dpy*/, + XDevice* /* dev*/, + Atom /* property*/, + long /* offset*/, + long /* length*/, + Bool /* delete*/, + Atom /* req_type*/, + Atom* /* actual_type*/, + int* /* actual_format*/, + unsigned long* /* nitems*/, + unsigned long* /* bytes_after*/, + unsigned char** /* prop*/ +); + +_XFUNCPROTOEND + +#endif /* _XINPUT_H_ */ diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h new file mode 100644 index 0000000..26de695 --- /dev/null +++ b/include/X11/extensions/XInput2.h @@ -0,0 +1,610 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +/* Definitions used by the library and client */ + +#ifndef _XINPUT2_H_ +#define _XINPUT2_H_ + +#include <X11/Xlib.h> +#include <X11/extensions/XI2.h> +#include <X11/extensions/Xge.h> + +/******************************************************************* + * + */ +typedef struct { + int type; + char* name; + Bool send_core; + Bool enable; +} XIAddMasterInfo; + +typedef struct { + int type; + int deviceid; + int return_mode; /* AttachToMaster, Floating */ + int return_pointer; + int return_keyboard; +} XIRemoveMasterInfo; + +typedef struct { + int type; + int deviceid; + int new_master; +} XIAttachSlaveInfo; + +typedef struct { + int type; + int deviceid; +} XIDetachSlaveInfo; + +typedef union { + int type; /* must be first element */ + XIAddMasterInfo add; + XIRemoveMasterInfo remove; + XIAttachSlaveInfo attach; + XIDetachSlaveInfo detach; +} XIAnyHierarchyChangeInfo; + +typedef struct +{ + int base; + int latched; + int locked; + int effective; +} XIModifierState; + +typedef XIModifierState XIGroupState; + +typedef struct { + int mask_len; + unsigned char *mask; +} XIButtonState; + +typedef struct { + int mask_len; + unsigned char *mask; + double *values; +} XIValuatorState; + + +typedef struct +{ + int deviceid; + int mask_len; + unsigned char* mask; +} XIEventMask; + +typedef struct +{ + int type; + int sourceid; +} XIAnyClassInfo; + +typedef struct +{ + int type; + int sourceid; + int num_buttons; + Atom *labels; + XIButtonState state; +} XIButtonClassInfo; + +typedef struct +{ + int type; + int sourceid; + int num_keycodes; + int *keycodes; +} XIKeyClassInfo; + +typedef struct +{ + int type; + int sourceid; + int number; + Atom label; + double min; + double max; + double value; + int resolution; + int mode; +} XIValuatorClassInfo; + +/* new in XI 2.1 */ +typedef struct +{ + int type; + int sourceid; + int number; + int scroll_type; + double increment; + int flags; +} XIScrollClassInfo; + +typedef struct +{ + int type; + int sourceid; + int mode; + int num_touches; +} XITouchClassInfo; + +typedef struct +{ + int deviceid; + char *name; + int use; + int attachment; + Bool enabled; + int num_classes; + XIAnyClassInfo **classes; +} XIDeviceInfo; + +typedef struct +{ + int modifiers; + int status; +} XIGrabModifiers; + +/** + * Generic XI2 event. All XI2 events have the same header. + */ +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; + Time time; +} XIEvent; + + +typedef struct { + int deviceid; + int attachment; + int use; + Bool enabled; + int flags; +} XIHierarchyInfo; + +/* + * Notifies the client that the device hierarchy has been changed. The client + * is expected to re-query the server for the device hierarchy. + */ +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; /* XI_HierarchyChanged */ + Time time; + int flags; + int num_info; + XIHierarchyInfo *info; +} XIHierarchyEvent; + +/* + * Notifies the client that the classes have been changed. This happens when + * the slave device that sends through the master changes. + */ +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; /* XI_DeviceChanged */ + Time time; + int deviceid; /* id of the device that changed */ + int sourceid; /* Source for the new classes. */ + int reason; /* Reason for the change */ + int num_classes; + XIAnyClassInfo **classes; /* same as in XIDeviceInfo */ +} XIDeviceChangedEvent; + +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; + Time time; + int deviceid; + int sourceid; + int detail; + Window root; + Window event; + Window child; + double root_x; + double root_y; + double event_x; + double event_y; + int flags; + XIButtonState buttons; + XIValuatorState valuators; + XIModifierState mods; + XIGroupState group; +} XIDeviceEvent; + +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; /* XI_RawKeyPress, XI_RawKeyRelease, etc. */ + Time time; + int deviceid; + int sourceid; /* Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 */ + int detail; + int flags; + XIValuatorState valuators; + double *raw_values; +} XIRawEvent; + +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; + Time time; + int deviceid; + int sourceid; + int detail; + Window root; + Window event; + Window child; + double root_x; + double root_y; + double event_x; + double event_y; + int mode; + Bool focus; + Bool same_screen; + XIButtonState buttons; + XIModifierState mods; + XIGroupState group; +} XIEnterEvent; + +typedef XIEnterEvent XILeaveEvent; +typedef XIEnterEvent XIFocusInEvent; +typedef XIEnterEvent XIFocusOutEvent; + +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; /* XI_PropertyEvent */ + Time time; + int deviceid; /* id of the device that changed */ + Atom property; + int what; +} XIPropertyEvent; + +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; + Time time; + int deviceid; + int sourceid; + unsigned int touchid; + Window root; + Window event; + Window child; + int flags; +} XITouchOwnershipEvent; + +_XFUNCPROTOBEGIN + +extern Bool XIQueryPointer( + Display* display, + int deviceid, + Window win, + Window* root, + Window* child, + double* root_x, + double* root_y, + double* win_x, + double* win_y, + XIButtonState *buttons, + XIModifierState *mods, + XIGroupState *group +); + +extern Bool XIWarpPointer( + Display* display, + int deviceid, + Window src_win, + Window dst_win, + double src_x, + double src_y, + unsigned int src_width, + unsigned int src_height, + double dst_x, + double dst_y +); + +extern Status XIDefineCursor( + Display* display, + int deviceid, + Window win, + Cursor cursor +); + +extern Status XIUndefineCursor( + Display* display, + int deviceid, + Window win +); + +extern Status XIChangeHierarchy( + Display* display, + XIAnyHierarchyChangeInfo* changes, + int num_changes +); + +extern Status XISetClientPointer( + Display* dpy, + Window win, + int deviceid +); + +extern Bool XIGetClientPointer( + Display* dpy, + Window win, + int* deviceid +); + +extern int XISelectEvents( + Display* dpy, + Window win, + XIEventMask *masks, + int num_masks +); + +extern XIEventMask *XIGetSelectedEvents( + Display* dpy, + Window win, + int *num_masks_return +); + +extern Status XIQueryVersion( + Display* dpy, + int* major_version_inout, + int* minor_version_inout +); + +extern XIDeviceInfo* XIQueryDevice( + Display* dpy, + int deviceid, + int* ndevices_return +); + +extern Status XISetFocus( + Display* dpy, + int deviceid, + Window focus, + Time time +); + +extern Status XIGetFocus( + Display* dpy, + int deviceid, + Window *focus_return); + +extern Status XIGrabDevice( + Display* dpy, + int deviceid, + Window grab_window, + Time time, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask +); + +extern Status XIUngrabDevice( + Display* dpy, + int deviceid, + Time time +); + +extern Status XIAllowEvents( + Display* display, + int deviceid, + int event_mode, + Time time +); + +extern Status XIAllowTouchEvents( + Display* display, + int deviceid, + unsigned int touchid, + Window grab_window, + int event_mode +); + +extern int XIGrabButton( + Display* display, + int deviceid, + int button, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + int owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout +); + +extern int XIGrabKeycode( + Display* display, + int deviceid, + int keycode, + Window grab_window, + int grab_mode, + int paired_device_mode, + int owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout +); + +extern int XIGrabEnter( + Display* display, + int deviceid, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + int owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout +); + +extern int XIGrabFocusIn( + Display* display, + int deviceid, + Window grab_window, + int grab_mode, + int paired_device_mode, + int owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout +); + +extern int XIGrabTouchBegin( + Display* display, + int deviceid, + Window grab_window, + int owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout +); + +extern Status XIUngrabButton( + Display* display, + int deviceid, + int button, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers +); + +extern Status XIUngrabKeycode( + Display* display, + int deviceid, + int keycode, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers +); + +extern Status XIUngrabEnter( + Display* display, + int deviceid, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers +); + +extern Status XIUngrabFocusIn( + Display* display, + int deviceid, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers +); + +extern Status XIUngrabTouchBegin( + Display* display, + int deviceid, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers +); + +extern Atom *XIListProperties( + Display* display, + int deviceid, + int *num_props_return +); + +extern void XIChangeProperty( + Display* display, + int deviceid, + Atom property, + Atom type, + int format, + int mode, + unsigned char *data, + int num_items +); + +extern void +XIDeleteProperty( + Display* display, + int deviceid, + Atom property +); + +extern Status +XIGetProperty( + Display* display, + int deviceid, + Atom property, + long offset, + long length, + Bool delete_property, + Atom type, + Atom *type_return, + int *format_return, + unsigned long *num_items_return, + unsigned long *bytes_after_return, + unsigned char **data +); + +extern void XIFreeDeviceInfo(XIDeviceInfo *info); + +_XFUNCPROTOEND + +#endif /* XINPUT2_H */ diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..28211a1 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,185 @@ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +libmandir = $(LIB_MAN_DIR) + +# Source files for X Input v2 man pages +XI2_txt = \ + XIChangeHierarchy.txt \ + XIDefineCursor.txt \ + XIGrabButton.txt \ + XIGrabDevice.txt \ + XIGrabEnter.txt \ + XIQueryDevice.txt \ + XIQueryPointer.txt \ + XIQueryVersion.txt \ + XISelectEvents.txt \ + XISetClientPointer.txt \ + XISetFocus.txt \ + XIWarpPointer.txt \ + XIListProperties.txt \ + XIChangeProperty.txt + +# Source files for X Input v1 man pages +libman_txt = \ + XAllowDeviceEvents.txt \ + XChangeDeviceDontPropagateList.txt \ + XChangeKeyboardDevice.txt \ + XChangePointerDevice.txt \ + XDeviceBell.txt \ + XGetDeviceControl.txt \ + XGetDeviceKeyMapping.txt \ + XGetDeviceModifierMapping.txt \ + XGetDeviceMotionEvents.txt \ + XGetDeviceProperty.txt \ + XGetExtensionVersion.txt \ + XGetFeedbackControl.txt \ + XGrabDeviceButton.txt \ + XGrabDeviceKey.txt \ + XGrabDevice.txt \ + XListDeviceProperties.txt \ + XListInputDevices.txt \ + XOpenDevice.txt \ + XQueryDeviceState.txt \ + XSelectExtensionEvent.txt \ + XSendExtensionEvent.txt \ + XSetDeviceButtonMapping.txt \ + XSetDeviceFocus.txt \ + XSetDeviceMode.txt \ + XSetDeviceValuators.txt \ + $(XI2_txt) + +# Name of DocBook XML files generated from .txt files by asciidoc +libman_xml = $(libman_txt:.txt=.xml) + +# Shadow man pages are simply links to a main man page. +# They are created by the xmlto command when generating man pages from DocBook +# The shadow man page contains a gtroff .so request to include the main man page +XI2_shadows = \ + XIUndefineCursor.man \ + XIUngrabButton.man \ + XIGrabKeycode.man \ + XIUngrabKeycode.man \ + XIUngrabDevice.man \ + XIUngrabEnter.man \ + XIGrabFocusIn.man \ + XIUngrabFocusIn.man \ + XIGetClientPointer.man \ + XIGetFocus.man \ + XIGetSelectedEvents.man \ + XIDeleteProperty.man \ + XIGetProperty.man \ + XIFreeDeviceInfo.man + +libman_shadows = \ + XGetDeviceDontPropagateList.man \ + XChangeDeviceControl.man \ + XChangeDeviceKeyMapping.man \ + XSetDeviceModifierMapping.man \ + XChangeFeedbackControl.man \ + XUngrabDeviceButton.man \ + XUngrabDeviceKey.man \ + XUngrabDevice.man \ + XDeviceTimeCoord.man \ + XFreeDeviceList.man \ + XCloseDevice.man \ + XGetSelectedExtensionEvents.man \ + XGetDeviceButtonMapping.man \ + XGetDeviceFocus.man \ + XChangeDeviceProperty.man \ + XDeleteDeviceProperty.man \ + $(XI2_shadows) + +# Name of man page files generated from DocBook XML files by xmlto +libman_PRE = $(libman_txt:.txt=.man) $(libman_shadows) + +if INSTALL_MANPAGES +libman_DATA = $(libman_PRE:.man=.$(LIB_MAN_SUFFIX)) +endif + +EXTRA_DIST = $(libman_txt) $(libman_PRE) +CLEANFILES = $(libman_DATA) *.libmansuffix +MAINTAINERCLEANFILES = $(libman_PRE) *.xml + +# Dependencies for X Input v1 shadow pages +XGetDeviceDontPropagateList.man: XChangeDeviceDontPropagateList.man +XChangeDeviceControl.man: XGetDeviceControl.man +XChangeDeviceKeyMapping.man: XGetDeviceKeyMapping.man +XSetDeviceModifierMapping.man: XGetDeviceModifierMapping.man +XDeviceTimeCoord.man: XGetDeviceMotionEvents.man +XChangeFeedbackControl.man: XGetFeedbackControl.man +XUngrabDeviceButton.man: XGrabDeviceButton.man +XUngrabDeviceKey.man: XGrabDeviceKey.man +XUngrabDevice.man: XGrabDevice.man +XFreeDeviceList.man: XListInputDevices.man +XCloseDevice.man: XOpenDevice.man +XGetSelectedExtensionEvents.man: XSelectExtensionEvent.man +XGetDeviceButtonMapping.man: XSetDeviceButtonMapping.man +XGetDeviceFocus.man: XSetDeviceFocus.man +XChangeDeviceProperty.man: XGetDeviceProperty.man +XDeleteDeviceProperty.man: XGetDeviceProperty.man + +# Dependencies for X Input v2 shadow pages +XIUndefineCursor.man: XIDefineCursor.man +XIUngrabButton.man XIGrabKeycode.man XIUngrabKeycode.man: XIGrabButton.man +XIGetClientPointer.man: XISetClientPointer.man +XIGetFocus.man: XISetFocus.man +XIUngrabDevice.man: XIGrabDevice.man +XIGetProperty.man: XIChangeProperty.man +XIDeleteProperty.man: XIChangeProperty.man +XIUngrabEnter.man XIGrabFocusIn.man XIUngrabFocusIn.man: XIGrabEnter.man +XIGetSelectedEvents.man: XISelectEvents.man +XIFreeDeviceInfo.man: XIQueryDevice.man + +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure +# Unable to use __libmansuffix__ as underscores are lost in txt --> xml conversion +MAN_SUBSTS += -e 's/libmansuffix/$(LIB_MAN_SUFFIX)/g' + +# asciidoc is generating [FIXME...] values in the .TH line we should fix. +MAN_SUBSTS += -e 's/\[FIXME: source\]/$(XORG_MAN_PAGE)/' +MAN_SUBSTS += -e 's/\[FIXME: manual\]/XINPUT FUNCTIONS/' + +# asciidoc generates shadow page references without the man section directory +MAN_SUBSTS += -e 's/^\.so X/.so man$(LIB_MAN_SUFFIX)\/X/' + +SUFFIXES = .man .$(LIB_MAN_SUFFIX) +.man.$(LIB_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# Generate man pages and shadow pages from .txt and then from DocBook XML +if HAVE_DOCTOOLS +SUFFIXES += .txt .xml +.txt.xml: + $(AM_V_GEN)$(ASCIIDOC) -b docbook -d manpage -o $@ $< +.xml.man: + $(AM_V_GEN)$(XMLTO) man $< + $(AM_V_at)mv -f $(@:.man=.libmansuffix) $@ + +# Invoke asciidoc/xmlto main man page generation for shadow pages +$(libman_shadows): + @if test ! -f $(@:.man=.libmansuffix); then \ + rm -f $<; \ + $(MAKE) $(AM_MAKEFLAGS) $< || exit 1; \ + fi + $(AM_V_at)mv -f $(@:.man=.libmansuffix) $@ +endif diff --git a/man/XAllowDeviceEvents.man b/man/XAllowDeviceEvents.man new file mode 100644 index 0000000..58a10de --- /dev/null +++ b/man/XAllowDeviceEvents.man @@ -0,0 +1,178 @@ +'\" t +.\" Title: xallowdeviceevents +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XALLOWDEVICEEVENTS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XAllowDeviceEvents \- release queued events +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XAllowDeviceEvents( Display *display, + XDevice *device, + int event_mode, + Time time); +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device from which events are to be + allowed\&. +.fi +.sp +.nf +event_mode + Specifies the event mode\&.You can pass AsyncThisDevice, + SyncThisDevice, ReplayThisDevice, AsyncOtherDevices, + SyncAll,or AsyncAll\&. +.fi +.sp +.nf +time + Specifies the time\&.You can pass either a timestamp or + CurrentTime\&. +.fi +.SH "DESCRIPTION" +.sp +The XAllowDeviceEvents function releases some queued events if the client has caused a device to freeze\&. It has no effect if the specified time is earlier than the last\-grab time of the most recent active grab for the client and device, or if the specified time is later than the current X server time\&. +.sp +The following describes the processing that occurs depending on what constant you pass to the event_mode argument\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AsyncThisDevice \- If the specified device is frozen by the client, event processing for that device continues as usual\&. If the device is frozen multiple times by the client on behalf of multiple separate grabs, AsyncThisDevice thaws for all\&.AsyncThisDevice has no effect if the specified device is not frozen by the client, but the device need not be grabbed by the client\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SyncThisDevice \- If the specified device is frozen and actively grabbed by the client, event processing for that device continues normally until the next key or button event is reported to the client\&. At this time, the specified device again appears to freeze\&. However, if the reported event causes the grab to be released, the specified device does not freeze\&. SyncThisDevice has no effect if the specified device is not frozen by the client or is not grabbed by the client\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ReplayThisDevice \- If the specified device is actively grabbed by the client and is frozen as the result of an event having been sent to the client (either from the activation of a GrabDeviceButton or from a previous AllowDeviceEvents with mode SyncThisDevice, but not from a GrabDevice), the grab is released and that event is completely reprocessed\&. This time, however, the request ignores any passive grabs at or above (toward the root) that the grab\-window of the grab just released\&. The request has no effect if the specified device is not grabbed by the client or if it is not frozen as the result of an event\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AsyncOtherDevices \- If the remaining devices are frozen by the client, event processing for them continues as usual\&. If the other devices are frozen multiple times by the client on behalf of multiple grabs, AsyncOtherDevices "thaws" for all\&. AsyncOtherDevices has no effect if the devices are not frozen by the client\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SyncAll \- If all devices are frozen by the client, event processing (for all devices) continues normally until the next button or key event is reported to the client for a grabbed device, at which time all devices again appear to freeze\&. However, if the reported event causes the grab to be released, then the devices do not freeze\&. If any device is still grabbed, then a subsequent event for it will still cause all devices to freeze\&. SyncAll has no effect unless all devices are frozen by the client\&. If any device is frozen twice by the client on behalf of two separate grabs, SyncAll thaws for both\&. A subsequent freeze for SyncAll will only freeze each device once\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AsyncAll \- If all devices are frozen by the client, event processing for all devices continues normally\&. If any device is frozen multiple times by the client on behalf of multiple separate grabs, AsyncAll thaws for all\&. AsyncAll has no effect unless all devices are frozen by the client\&. +.RE +.sp +AsyncThisDevice, SyncThisDevice, and ReplayThisDevice have no effect on the processing of events from the remaining devices\&.AsyncOtherDevices has no effect on the processing of events from the specified device\&. When the event_mode is SyncAll or AsyncAll, the device parameter is ignored\&. +.sp +It is possible for several grabs of different devices by the same or different clients to be active simultaneously\&. If a device is frozen on behalf of any grab, no event processing is performed for the device\&. It is possible for a single device to be frozen because of several grabs\&. In this case, the freeze must be released on behalf of each grab before events can again be processed\&. +.sp +XAllowDeviceEvents can generate a BadDevice or BadValue error\&. +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + An invalid mode was specified on the request\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGrabDevice(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XAllowDeviceEvents.txt b/man/XAllowDeviceEvents.txt new file mode 100644 index 0000000..ba7fde3 --- /dev/null +++ b/man/XAllowDeviceEvents.txt @@ -0,0 +1,133 @@ +XALLOWDEVICEEVENTS(libmansuffix) +================================ + +NAME +---- + + XAllowDeviceEvents - release queued events + +SYNOPSIS +------ + + #include <X11/extensions/XInput.h> + + int XAllowDeviceEvents( Display *display, + XDevice *device, + int event_mode, + Time time); + display + Specifies the connection to the X server. + + device + Specifies the device from which events are to be + allowed. + + event_mode + Specifies the event mode.You can pass AsyncThisDevice, + SyncThisDevice, ReplayThisDevice, AsyncOtherDevices, + SyncAll,or AsyncAll. + + time + Specifies the time.You can pass either a timestamp or + CurrentTime. + +DESCRIPTION +----------- + +The XAllowDeviceEvents function releases some queued events if +the client has caused a device to freeze. It has no effect if +the specified time is earlier than the last-grab time of the +most recent active grab for the client and device, or if the +specified time is later than the current X server time. + +The following describes the processing that occurs depending on +what constant you pass to the event_mode argument. + + * AsyncThisDevice - If the specified device is frozen by the + client, event processing for that device continues as usual. If + the device is frozen multiple times by the client on behalf of + multiple separate grabs, AsyncThisDevice thaws for + all.AsyncThisDevice has no effect if the specified device is + not frozen by the client, but the device need not be grabbed by + the client. + + * SyncThisDevice - If the specified device is frozen and actively + grabbed by the client, event processing for that device + continues normally until the next key or button event is + reported to the client. At this time, the specified device + again appears to freeze. However, if the reported event causes + the grab to be released, the specified device does not freeze. + SyncThisDevice has no effect if the specified device is not + frozen by the client or is not grabbed by the client. + + * ReplayThisDevice - If the specified device is actively grabbed by + the client and is frozen as the result of an event having been + sent to the client (either from the activation of a + GrabDeviceButton or from a previous AllowDeviceEvents with mode + SyncThisDevice, but not from a GrabDevice), the grab is + released and that event is completely reprocessed. This time, + however, the request ignores any passive grabs at or above + (toward the root) that the grab-window of the grab just + released. The request has no effect if the specified device is + not grabbed by the client or if it is not frozen as the result + of an event. + + * AsyncOtherDevices - If the remaining devices are frozen by the + client, event processing for them continues as usual. If the + other devices are frozen multiple times by the client on behalf + of multiple grabs, AsyncOtherDevices "thaws" for all. + AsyncOtherDevices has no effect if the devices are not frozen + by the client. + + * SyncAll - If all devices are frozen by the client, event + processing (for all devices) continues normally until the next + button or key event is reported to the client for a grabbed + device, at which time all devices again appear to freeze. + However, if the reported event causes the grab to be released, + then the devices do not freeze. If any device is still grabbed, + then a subsequent event for it will still cause all devices to + freeze. SyncAll has no effect unless all devices are frozen by + the client. If any device is frozen twice by the client on + behalf of two separate grabs, SyncAll thaws for both. A + subsequent freeze for SyncAll will only freeze each device + once. + + * AsyncAll - If all devices are frozen by the client, event + processing for all devices continues normally. If any device is + frozen multiple times by the client on behalf of multiple + separate grabs, AsyncAll thaws for all. AsyncAll has no effect + unless all devices are frozen by the client. + +AsyncThisDevice, SyncThisDevice, and ReplayThisDevice have no +effect on the processing of events from the remaining +devices.AsyncOtherDevices has no effect on the processing of +events from the specified device. When the event_mode is +SyncAll or AsyncAll, the device parameter is ignored. + +It is possible for several grabs of different devices by the +same or different clients to be active simultaneously. If a +device is frozen on behalf of any grab, no event processing is +performed for the device. It is possible for a single device to +be frozen because of several grabs. In this case, the freeze +must be released on behalf of each grab before events can again +be processed. + +XAllowDeviceEvents can generate a BadDevice or BadValue error. + +DIAGNOSTICS +------------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadValue + An invalid mode was specified on the request. + +SEE ALSO +-------- + + XGrabDevice(libmansuffix) + diff --git a/man/XChangeDeviceControl.man b/man/XChangeDeviceControl.man new file mode 100644 index 0000000..9488063 --- /dev/null +++ b/man/XChangeDeviceControl.man @@ -0,0 +1 @@ +.so XGetDeviceControl.libmansuffix diff --git a/man/XChangeDeviceDontPropagateList.man b/man/XChangeDeviceDontPropagateList.man new file mode 100644 index 0000000..d091b61 --- /dev/null +++ b/man/XChangeDeviceDontPropagateList.man @@ -0,0 +1,197 @@ +'\" t +.\" Title: xchangedevicedontpropagatelist +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XCHANGEDEVICEDONTPRO" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XChangeDeviceDontPropagateList, XGetDeviceDontPropagateList \- query or change the dont\-propagate\-list for extension devices +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XChangeDeviceDontPropagateList( Display *display, + Window window, + int count, + XEventClass *event_list, + int mode); +.fi +.sp +.nf +XEventClass* XGetDeviceDontPropagateList( Display *display, + Window window, + int *count); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +window + Specifies the window whose dont\-propagate\-list is to be + queried or modified\&. +.fi +.sp +.nf +event_list + Specifies a pointer to a list of event classes\&. +.fi +.sp +.nf +mode + Specifies the mode\&.You can pass AddToList, or + DeleteFromList\&. +.fi +.sp +.nf +count + Specifies the number of event classes in the list\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XChangeDeviceDontPropagateList request modifies the list of +events that should not be propagated to ancestors of the event +window\&. This request allows extension events to be added to or +deleted from that list\&. By default, all events are propagated +to ancestor windows\&. Once modified, the list remains modified +for the life of the window\&. Events are not removed from the +list because the client that added them has terminated\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Suppression of event propagation is not allowed for all input +extension events\&. If a specified event class is one that cannot +be suppressed, a BadClass error will result\&. Events that can be +suppressed include DeviceKeyPress, DeviceKeyRelease, +DeviceButtonPress, DeviceButtonRelease, DeviceMotionNotify, +ProximityIn, and ProximityOut\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeDeviceDontPropagateList can generate a BadDevice, +BadClass, or BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceDontPropagateList request queries the list of +events that should not be propagated to ancestors of the event +window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceDontPropagateList can generate a BadClass or +BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + An invalid window id was specified\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadClass + An invalid event class was specified\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XChangeDeviceDontPropagateList.txt b/man/XChangeDeviceDontPropagateList.txt new file mode 100644 index 0000000..398ded2 --- /dev/null +++ b/man/XChangeDeviceDontPropagateList.txt @@ -0,0 +1,92 @@ +XCHANGEDEVICEDONTPROPAGATELIST(libmansuffix) +============================================ + +NAME +---- + + XChangeDeviceDontPropagateList, XGetDeviceDontPropagateList - + query or change the dont-propagate-list for extension devices + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XChangeDeviceDontPropagateList( Display *display, + Window window, + int count, + XEventClass *event_list, + int mode); + + XEventClass* XGetDeviceDontPropagateList( Display *display, + Window window, + int *count); + + display + Specifies the connection to the X server. + + window + Specifies the window whose dont-propagate-list is to be + queried or modified. + + event_list + Specifies a pointer to a list of event classes. + + mode + Specifies the mode.You can pass AddToList, or + DeleteFromList. + + count + Specifies the number of event classes in the list. + +DESCRIPTION +----------- + + The XChangeDeviceDontPropagateList request modifies the list of + events that should not be propagated to ancestors of the event + window. This request allows extension events to be added to or + deleted from that list. By default, all events are propagated + to ancestor windows. Once modified, the list remains modified + for the life of the window. Events are not removed from the + list because the client that added them has terminated. + + Suppression of event propagation is not allowed for all input + extension events. If a specified event class is one that cannot + be suppressed, a BadClass error will result. Events that can be + suppressed include DeviceKeyPress, DeviceKeyRelease, + DeviceButtonPress, DeviceButtonRelease, DeviceMotionNotify, + ProximityIn, and ProximityOut. + + XChangeDeviceDontPropagateList can generate a BadDevice, + BadClass, or BadValue error. + + The XGetDeviceDontPropagateList request queries the list of + events that should not be propagated to ancestors of the event + window. + + XGetDeviceDontPropagateList can generate a BadClass or + BadWindow error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + An invalid window id was specified. + + BadClass + An invalid event class was specified. diff --git a/man/XChangeDeviceKeyMapping.man b/man/XChangeDeviceKeyMapping.man new file mode 100644 index 0000000..d786871 --- /dev/null +++ b/man/XChangeDeviceKeyMapping.man @@ -0,0 +1 @@ +.so XGetDeviceKeyMapping.libmansuffix diff --git a/man/XChangeDeviceProperty.man b/man/XChangeDeviceProperty.man new file mode 100644 index 0000000..156dd2c --- /dev/null +++ b/man/XChangeDeviceProperty.man @@ -0,0 +1 @@ +.so XGetDeviceProperty.libmansuffix diff --git a/man/XChangeFeedbackControl.man b/man/XChangeFeedbackControl.man new file mode 100644 index 0000000..dc41a60 --- /dev/null +++ b/man/XChangeFeedbackControl.man @@ -0,0 +1 @@ +.so XGetFeedbackControl.libmansuffix diff --git a/man/XChangeKeyboardDevice.man b/man/XChangeKeyboardDevice.man new file mode 100644 index 0000000..5ea7008 --- /dev/null +++ b/man/XChangeKeyboardDevice.man @@ -0,0 +1,147 @@ +'\" t +.\" Title: xchangekeyboarddevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XCHANGEKEYBOARDDEVIC" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XChangeKeyboardDevice \- change which device is used as the X keyboard +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +Status XChangeKeyboardDevice( Display *display, + XDevice *device); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device to be used as the X keyboard\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XChangeKeyboardDevice request causes the server to use the +specified device as the X keyboard\&. The device must have been +previously opened by the requesting client via XOpenDevice or a +BadDevice error will result\&. The device must support input +class Keys, or a BadMatch error will result\&. If the server +implementation does not support using the requested device as +the X keyboard, a BadDevice error will result\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the specified device is grabbed by another client, +AlreadyGrabbed is returned\&. If the specified device is frozen +by a grab on another device, GrabFrozen is returned\&. If the +request is successful, Success is returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the request succeeds, a ChangeDeviceNotify event is sent to +all clients that have selected that event\&. A MappingNotify +event with request = MappingKeyboard is sent to all clients\&. +The specified device becomes the X keyboard and the old X +keyboard becomes accessible through the input extension +protocol requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeKeyboardDevice can generate a BadDevice or a BadMatch +error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist, has not been opened by this client via + XOpenInputDevice, or is already one of the core X device + (pointer or keyboard)\&. This error may also occur if the + server implementation does not support using the + specified device as the X keyboard\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XChangeKeyboardDevice request + was made specifying a device that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangePointerDevice(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XChangeKeyboardDevice.txt b/man/XChangeKeyboardDevice.txt new file mode 100644 index 0000000..7ad1a23 --- /dev/null +++ b/man/XChangeKeyboardDevice.txt @@ -0,0 +1,68 @@ +XCHANGEKEYBOARDDEVICE(libmansuffix) +=================================== + +NAME +---- + + XChangeKeyboardDevice - change which device is used as the X + keyboard + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + Status XChangeKeyboardDevice( Display *display, + XDevice *device); + + display + Specifies the connection to the X server. + + device + Specifies the device to be used as the X keyboard. + +DESCRIPTION +----------- + + The XChangeKeyboardDevice request causes the server to use the + specified device as the X keyboard. The device must have been + previously opened by the requesting client via XOpenDevice or a + BadDevice error will result. The device must support input + class Keys, or a BadMatch error will result. If the server + implementation does not support using the requested device as + the X keyboard, a BadDevice error will result. + + If the specified device is grabbed by another client, + AlreadyGrabbed is returned. If the specified device is frozen + by a grab on another device, GrabFrozen is returned. If the + request is successful, Success is returned. + + If the request succeeds, a ChangeDeviceNotify event is sent to + all clients that have selected that event. A MappingNotify + event with request = MappingKeyboard is sent to all clients. + The specified device becomes the X keyboard and the old X + keyboard becomes accessible through the input extension + protocol requests. + + XChangeKeyboardDevice can generate a BadDevice or a BadMatch + error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist, has not been opened by this client via + XOpenInputDevice, or is already one of the core X device + (pointer or keyboard). This error may also occur if the + server implementation does not support using the + specified device as the X keyboard. + + BadMatch + This error may occur if an XChangeKeyboardDevice request + was made specifying a device that has no keys. + +SEE ALSO +-------- + + XChangePointerDevice(libmansuffix) diff --git a/man/XChangePointerDevice.man b/man/XChangePointerDevice.man new file mode 100644 index 0000000..f129f8c --- /dev/null +++ b/man/XChangePointerDevice.man @@ -0,0 +1,163 @@ +'\" t +.\" Title: xchangepointerdevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XCHANGEPOINTERDEVICE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XChangePointerDevice \- change which device is the X pointer +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +Status XChangePointerDevice( Display *display, + XDevice *device, + int xaxis, + int yaxis); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device to be used as the X pointer\&. +.fi +.sp +.nf +xaxis + Specifies the axis of the device to be used as the X + pointer x\-axis\&. +.fi +.sp +.nf +yaxis + Specifies the axis of the device to be used as the X + pointer y\-axis\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XChangePointerDevice request causes the server to use the +specified device as the X pointer\&. The device must have been +opened by the client via XOpenDevice or a BadDevice error will +result\&. The device must support input class Valuators or a +BadMatch error will result\&. If the implementation does not +support use of the specified device as the X pointer, a +BadDevice error will result\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the specified device is grabbed by another client, +AlreadyGrabbed is returned\&. If the specified device is frozen +by a grab on another device, GrabFrozen is returned\&. If the +request is successful, Success is returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the request succeeds, a ChangeDeviceNotify event is sent to +all clients that have selected that event\&. A MappingNotify +event with request = MappingPointer is sent to all clients\&. The +specified device becomes the X pointer, and the old X pointer +becomes accessible through the input extension protocol +requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangePointerDevice can generate a BadDevice or a BadMatch +error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist, has not been opened by this client via + XOpenInputDevice, or is already one of the core X input + devices (pointer or keyboard)\&. This error may also occur + if the server implementation does not support using the + specified device as the X pointer\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XChangePointerDevice request + was made specifying a device that has less than two + valuators, or specifying a valuator index beyond the + range supported by the device\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeKeyboardDevice(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XChangePointerDevice.txt b/man/XChangePointerDevice.txt new file mode 100644 index 0000000..606b65e --- /dev/null +++ b/man/XChangePointerDevice.txt @@ -0,0 +1,79 @@ +XCHANGEPOINTERDEVICE(libmansuffix) +================================== + +NAME +---- + + XChangePointerDevice - change which device is the X pointer + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + Status XChangePointerDevice( Display *display, + XDevice *device, + int xaxis, + int yaxis); + + display + Specifies the connection to the X server. + + device + Specifies the device to be used as the X pointer. + + xaxis + Specifies the axis of the device to be used as the X + pointer x-axis. + + yaxis + Specifies the axis of the device to be used as the X + pointer y-axis. + +DESCRIPTION +----------- + + The XChangePointerDevice request causes the server to use the + specified device as the X pointer. The device must have been + opened by the client via XOpenDevice or a BadDevice error will + result. The device must support input class Valuators or a + BadMatch error will result. If the implementation does not + support use of the specified device as the X pointer, a + BadDevice error will result. + + If the specified device is grabbed by another client, + AlreadyGrabbed is returned. If the specified device is frozen + by a grab on another device, GrabFrozen is returned. If the + request is successful, Success is returned. + + If the request succeeds, a ChangeDeviceNotify event is sent to + all clients that have selected that event. A MappingNotify + event with request = MappingPointer is sent to all clients. The + specified device becomes the X pointer, and the old X pointer + becomes accessible through the input extension protocol + requests. + + XChangePointerDevice can generate a BadDevice or a BadMatch + error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist, has not been opened by this client via + XOpenInputDevice, or is already one of the core X input + devices (pointer or keyboard). This error may also occur + if the server implementation does not support using the + specified device as the X pointer. + + BadMatch + This error may occur if an XChangePointerDevice request + was made specifying a device that has less than two + valuators, or specifying a valuator index beyond the + range supported by the device. + +SEE ALSO +-------- + + XChangeKeyboardDevice(libmansuffix) diff --git a/man/XCloseDevice.man b/man/XCloseDevice.man new file mode 100644 index 0000000..79846cc --- /dev/null +++ b/man/XCloseDevice.man @@ -0,0 +1 @@ +.so XOpenDevice.libmansuffix diff --git a/man/XDeleteDeviceProperty.man b/man/XDeleteDeviceProperty.man new file mode 100644 index 0000000..156dd2c --- /dev/null +++ b/man/XDeleteDeviceProperty.man @@ -0,0 +1 @@ +.so XGetDeviceProperty.libmansuffix diff --git a/man/XDeviceBell.man b/man/XDeviceBell.man new file mode 100644 index 0000000..54abc27 --- /dev/null +++ b/man/XDeviceBell.man @@ -0,0 +1,169 @@ +'\" t +.\" Title: xdevicebell +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XDEVICEBELL" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XDeviceBell \- ring a bell on a device supported through the input extension +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +Status XDeviceBell( Display *display, + XDevice *device, + XID feedbackclass, + XID feedbackid, + int percent); +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device with which the bell is associated\&. +.fi +.sp +.nf +feedbackclass + Specifies the class of the feedback with which the bell + is associated\&. +.fi +.sp +.nf +feedbackid + Specifies the id of the feedback with which the bell is + associated\&. +.fi +.sp +.nf +percent + Specifies the volume in the range \-100 to 100 at which + the bell should be rung\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDeviceBell request causes the server to ring a bell on the +specified feedback of the specified device, if possible\&. The +specified volume is relative to the base volume for the bell\&. +If an invalid device is specified, a BadDevice error will be +returned\&. The feedbackclass and feedbackid parameters contain +values returned by an XGetFeedbackControl request and uniquely +identify the bell to ring\&. If a feedbackclass is specified that +does not support a bell, or if a nonexistent feedbackid is +specified, or a percent value is specified that is not in the +range \-100 to 100, a BadValue error will be returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The volume at which the bell is rung when the percent argument +is nonnegative is: base \- [(base * percent) / 100] + percent +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The volume at which the bell rings when the percent argument is +negative is: base + [(base * percent) / 100] +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To change the base volume of the bell, use +XChangeFeedbackControl\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XDeviceBell can generate a BadDevice or a BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist, or has not been opened by this client + via XOpenInputDevice\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + An invalid feedbackclass, feedbackid, or percent value + was specified\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeFeedbackControl(libmansuffix), XBell(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XDeviceBell.txt b/man/XDeviceBell.txt new file mode 100644 index 0000000..75bf652 --- /dev/null +++ b/man/XDeviceBell.txt @@ -0,0 +1,78 @@ +XDEVICEBELL(libmansuffix) +========================= + +NAME +---- + + XDeviceBell - ring a bell on a device supported through the + input extension + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + Status XDeviceBell( Display *display, + XDevice *device, + XID feedbackclass, + XID feedbackid, + int percent); + display + Specifies the connection to the X server. + + device + Specifies the device with which the bell is associated. + + feedbackclass + Specifies the class of the feedback with which the bell + is associated. + + feedbackid + Specifies the id of the feedback with which the bell is + associated. + + percent + Specifies the volume in the range -100 to 100 at which + the bell should be rung. + +DESCRIPTION +----------- + + The XDeviceBell request causes the server to ring a bell on the + specified feedback of the specified device, if possible. The + specified volume is relative to the base volume for the bell. + If an invalid device is specified, a BadDevice error will be + returned. The feedbackclass and feedbackid parameters contain + values returned by an XGetFeedbackControl request and uniquely + identify the bell to ring. If a feedbackclass is specified that + does not support a bell, or if a nonexistent feedbackid is + specified, or a percent value is specified that is not in the + range -100 to 100, a BadValue error will be returned. + + The volume at which the bell is rung when the percent argument + is nonnegative is: base - [(base * percent) / 100] + percent + + The volume at which the bell rings when the percent argument is + negative is: base + [(base * percent) / 100] + + To change the base volume of the bell, use + XChangeFeedbackControl. + + XDeviceBell can generate a BadDevice or a BadValue error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist, or has not been opened by this client + via XOpenInputDevice. + + BadValue + An invalid feedbackclass, feedbackid, or percent value + was specified. + +SEE ALSO +-------- + + XChangeFeedbackControl(libmansuffix), XBell(libmansuffix) diff --git a/man/XDeviceTimeCoord.man b/man/XDeviceTimeCoord.man new file mode 100644 index 0000000..7d0b7dc --- /dev/null +++ b/man/XDeviceTimeCoord.man @@ -0,0 +1 @@ +.so XGetDeviceMotionEvents.libmansuffix diff --git a/man/XFreeDeviceList.man b/man/XFreeDeviceList.man new file mode 100644 index 0000000..1a79ebf --- /dev/null +++ b/man/XFreeDeviceList.man @@ -0,0 +1 @@ +.so XListInputDevices.libmansuffix diff --git a/man/XGetDeviceButtonMapping.man b/man/XGetDeviceButtonMapping.man new file mode 100644 index 0000000..01e0844 --- /dev/null +++ b/man/XGetDeviceButtonMapping.man @@ -0,0 +1 @@ +.so XSetDeviceButtonMapping.libmansuffix diff --git a/man/XGetDeviceControl.man b/man/XGetDeviceControl.man new file mode 100644 index 0000000..e54c894 --- /dev/null +++ b/man/XGetDeviceControl.man @@ -0,0 +1,285 @@ +'\" t +.\" Title: xgetdevicecontrol +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETDEVICECONTROL" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetDeviceControl, XChangeDeviceControl \- query and change input device controls +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XDeviceControl *XGetDeviceControl( Display *display, + XDevice *device, + int *controlType); +.fi +.sp +.nf +int XChangeDeviceControl( Display *display, + XDevice *device, + int controlType, + XDeviceControl *control); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose control is to be interrogated + or modified\&. +.fi +.sp +.nf +controlType + Specifies the type of control to be interrogated or + changed\&. +.fi +.sp +.nf +control + Specifies the address of an XDeviceControl structure + that contains the new values for the Device\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +These requests are provided to manipulate those input devices +that support device control\&. A BadMatch error will be generated +if the requested device does not support any device controls\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Valid device control types that can be used with these requests +include the following: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +DEVICE_RESOLUTION Queries or changes the resolution of +valuators on input devices\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceControl request returns a pointer to an +XDeviceControl structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceControl can generate a BadDevice or BadMatch error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XChangeDeviceControl request modifies the values of one +control on the specified device\&. The control is identified by +the id field of the XDeviceControl structure that is passed +with the request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeDeviceControl can generate a BadDevice, BadMatch, or +BadValue error\&.\&.SH STRUCTURES Each control is described by a +structure specific to that control\&. These structures are +defined in the file XInput\&.h\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XDeviceControl is a generic structure that contains two fields +that are at the beginning of each class of control: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; +} XDeviceControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDeviceResolutionState structure defines the information +that is returned for device resolution for devices with +valuators\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID control; + int length; + int num_valuators; + int* resolutions; + int* min_resolutions; + int* max_resolutions; +} XDeviceResolutionState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDeviceResolutionControl structure defines the attributes +that can be controlled for keyboard Devices\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID control; + int length; + int first_valuator; + int num_valuators; + int* resolutions; +} XDeviceResolutionControl; +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceControl request was + made specifying a device that has no controls or an + XChangeDeviceControl request was made with an + XDeviceControl structure that contains an invalid Device + type\&. It may also occur if an invalid combination of + mask bits is specified ( DvKey but no DvAutoRepeatMode + for keyboard Devices), or if an invalid KeySym is + specified for a string Device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the XChangeDeviceControl request\&. Unless a + specific range is specified for an argument, the full + range defined by the argument\*(Aqs type is accepted\&. Any + argument defined as a set of alternatives can generate + this error\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetDeviceControl.txt b/man/XGetDeviceControl.txt new file mode 100644 index 0000000..09bf065 --- /dev/null +++ b/man/XGetDeviceControl.txt @@ -0,0 +1,126 @@ +XGETDEVICECONTROL(libmansuffix) +=============================== + +NAME +---- + + XGetDeviceControl, XChangeDeviceControl - query and change + input device controls + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XDeviceControl *XGetDeviceControl( Display *display, + XDevice *device, + int *controlType); + + int XChangeDeviceControl( Display *display, + XDevice *device, + int controlType, + XDeviceControl *control); + + display + Specifies the connection to the X server. + + device + Specifies the device whose control is to be interrogated + or modified. + + controlType + Specifies the type of control to be interrogated or + changed. + + control + Specifies the address of an XDeviceControl structure + that contains the new values for the Device. + +DESCRIPTION +----------- + + These requests are provided to manipulate those input devices + that support device control. A BadMatch error will be generated + if the requested device does not support any device controls. + + Valid device control types that can be used with these requests + include the following: + + DEVICE_RESOLUTION Queries or changes the resolution of + valuators on input devices. + + The XGetDeviceControl request returns a pointer to an + XDeviceControl structure. + + XGetDeviceControl can generate a BadDevice or BadMatch error. + + The XChangeDeviceControl request modifies the values of one + control on the specified device. The control is identified by + the id field of the XDeviceControl structure that is passed + with the request. + + XChangeDeviceControl can generate a BadDevice, BadMatch, or + BadValue error..SH STRUCTURES Each control is described by a + structure specific to that control. These structures are + defined in the file XInput.h. + + XDeviceControl is a generic structure that contains two fields + that are at the beginning of each class of control: + + typedef struct { + XID class; + int length; + } XDeviceControl; + + The XDeviceResolutionState structure defines the information + that is returned for device resolution for devices with + valuators. + + typedef struct { + XID control; + int length; + int num_valuators; + int* resolutions; + int* min_resolutions; + int* max_resolutions; + } XDeviceResolutionState; + + The XDeviceResolutionControl structure defines the attributes + that can be controlled for keyboard Devices. + + typedef struct { + XID control; + int length; + int first_valuator; + int num_valuators; + int* resolutions; + } XDeviceResolutionControl; + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests. + + BadMatch + This error may occur if an XGetDeviceControl request was + made specifying a device that has no controls or an + XChangeDeviceControl request was made with an + XDeviceControl structure that contains an invalid Device + type. It may also occur if an invalid combination of + mask bits is specified ( DvKey but no DvAutoRepeatMode + for keyboard Devices), or if an invalid KeySym is + specified for a string Device. + + BadValue + Some numeric value falls outside the range of values + accepted by the XChangeDeviceControl request. Unless a + specific range is specified for an argument, the full + range defined by the argument's type is accepted. Any + argument defined as a set of alternatives can generate + this error. diff --git a/man/XGetDeviceDontPropagateList.man b/man/XGetDeviceDontPropagateList.man new file mode 100644 index 0000000..a691a8b --- /dev/null +++ b/man/XGetDeviceDontPropagateList.man @@ -0,0 +1 @@ +.so XChangeDeviceDontPropagateList.libmansuffix diff --git a/man/XGetDeviceFocus.man b/man/XGetDeviceFocus.man new file mode 100644 index 0000000..54b7e13 --- /dev/null +++ b/man/XGetDeviceFocus.man @@ -0,0 +1 @@ +.so XSetDeviceFocus.libmansuffix diff --git a/man/XGetDeviceKeyMapping.man b/man/XGetDeviceKeyMapping.man new file mode 100644 index 0000000..0520ba8 --- /dev/null +++ b/man/XGetDeviceKeyMapping.man @@ -0,0 +1,361 @@ +'\" t +.\" Title: xgetdevicekeymapping +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETDEVICEKEYMAPPING" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetDeviceKeyMapping, XChangeDeviceKeyMapping \- query or change device key mappings +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +KeySym *XGetDeviceKeyMapping( Display *display, + XDevice *device, + KeyCode first_keycode, + int keycode_count, + int *keysyms_per_keycode_return); +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose key mapping is to be queried + or modified\&. +.fi +.sp +.nf +first_keycode + Specifies the first KeyCode to be returned\&. +.fi +.sp +.nf +keycode_count + Specifies the number of KeyCodes to be returned or + modified\&. +.fi +.sp +.nf +keysyms_per_keycode + Specifies the number of KeySyms per KeyCode\&. +.fi +.sp +.nf +keysyms_per_keycode_return + Specifies the address of a variable into which the + number of KeySyms per KeyCodewill be returned\&. +.fi +.sp +.nf +keysyms + Specifies the address of an array of KeySyms\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +For the specified device, the XGetDeviceKeyMapping request +returns the symbols for the specified number of KeyCodes +starting with first_keycode\&. The value specified in +first_keycode must be greater than or equal to min_keycode as +returned by XListInputDevices, or a BadValue error results\&. In +addition, the following expression must be less than or equal +to max_keycode as returned by XListInputDevices: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +first_keycode + keycode_count \- 1 +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If this is not the case, a BadValue error results\&. The number +of elements in the KeySyms list is: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +keycode_count * keysyms_per_keycode_return +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +KeySym number N, counting from zero, for KeyCode K has the +following index in the list, counting from zero: (K \- +first_code) * keysyms_per_code_return + N +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The X server arbitrarily chooses the keysyms_per_keycode_return +value to be large enough to report all requested symbols\&. A +special KeySym value of NoSymbol is used to fill in unused +elements for individual KeyCodes\&. To free the storage returned +by XGetDeviceKeyMapping, use XFree\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the specified device does not support input class keys, a +BadMatch error will result\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or +BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +For the specified device, the XChangeDeviceKeyMapping request +defines the symbols for the specified number of KeyCodes +starting with first_keycode\&. The symbols for KeyCodes outside +this range remain unchanged\&. The number of elements in keysyms +must be: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +num_codes * keysyms_per_keycode +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The specified first_keycode must be greater than or equal to +min_keycode returned by XListInputDevices, or a BadValue error +results\&. In addition, the following expression must be less +than or equal to max_keycode as returned by XListInputDevices, +or a BadValue error results: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +first_keycode + num_codes \- 1 +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +KeySym number N, counting from zero, for KeyCode K has the +following index in keysyms, counting from zero: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +(K \- first_keycode) * keysyms_per_keycode + N +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The specified keysyms_per_keycode can be chosen arbitrarily by +the client to be large enough to hold all desired symbols\&. A +special KeySym value of NoSymbol should be used to fill in +unused elements for individual KeyCodes\&. It is legal for +NoSymbol to appear in nontrailing positions of the effective +list for a KeyCode\&.XChangeDeviceKeyMapping generates a +DeviceMappingNotify event that is sent to all clients that have +selected that type of event\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +There is no requirement that the X server interpret this +mapping\&. It is merely stored for reading and writing by +clients\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the specified device does not support input class keys, a +BadMatch error results\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeDeviceKeyMapping can generate a BadDevice, BadMatch, +BadAlloc, or BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceKeyMapping or + XChangeDeviceKeyMapping request was made specifying a + device that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadAlloc + The server failed to allocate the requested resource or + server memory\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceButtonMapping(libmansuffix), XSetDeviceModifierMapping(__libmansuffix_) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetDeviceKeyMapping.txt b/man/XGetDeviceKeyMapping.txt new file mode 100644 index 0000000..0c68412 --- /dev/null +++ b/man/XGetDeviceKeyMapping.txt @@ -0,0 +1,146 @@ +XGETDEVICEKEYMAPPING(libmansuffix) +================================== + +NAME +---- + + XGetDeviceKeyMapping, XChangeDeviceKeyMapping - query or change + device key mappings + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + KeySym *XGetDeviceKeyMapping( Display *display, + XDevice *device, + KeyCode first_keycode, + int keycode_count, + int *keysyms_per_keycode_return); + display + Specifies the connection to the X server. + + device + Specifies the device whose key mapping is to be queried + or modified. + + first_keycode + Specifies the first KeyCode to be returned. + + keycode_count + Specifies the number of KeyCodes to be returned or + modified. + + keysyms_per_keycode + Specifies the number of KeySyms per KeyCode. + + keysyms_per_keycode_return + Specifies the address of a variable into which the + number of KeySyms per KeyCodewill be returned. + + keysyms + Specifies the address of an array of KeySyms. + +DESCRIPTION +----------- + + For the specified device, the XGetDeviceKeyMapping request + returns the symbols for the specified number of KeyCodes + starting with first_keycode. The value specified in + first_keycode must be greater than or equal to min_keycode as + returned by XListInputDevices, or a BadValue error results. In + addition, the following expression must be less than or equal + to max_keycode as returned by XListInputDevices: + + first_keycode + keycode_count - 1 + + If this is not the case, a BadValue error results. The number + of elements in the KeySyms list is: + + keycode_count * keysyms_per_keycode_return + + KeySym number N, counting from zero, for KeyCode K has the + following index in the list, counting from zero: (K - + first_code) * keysyms_per_code_return + N + + The X server arbitrarily chooses the keysyms_per_keycode_return + value to be large enough to report all requested symbols. A + special KeySym value of NoSymbol is used to fill in unused + elements for individual KeyCodes. To free the storage returned + by XGetDeviceKeyMapping, use XFree. + + If the specified device does not support input class keys, a + BadMatch error will result. + + XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or + BadValue error. + + For the specified device, the XChangeDeviceKeyMapping request + defines the symbols for the specified number of KeyCodes + starting with first_keycode. The symbols for KeyCodes outside + this range remain unchanged. The number of elements in keysyms + must be: + + num_codes * keysyms_per_keycode + + The specified first_keycode must be greater than or equal to + min_keycode returned by XListInputDevices, or a BadValue error + results. In addition, the following expression must be less + than or equal to max_keycode as returned by XListInputDevices, + or a BadValue error results: + + first_keycode + num_codes - 1 + + KeySym number N, counting from zero, for KeyCode K has the + following index in keysyms, counting from zero: + + (K - first_keycode) * keysyms_per_keycode + N + + The specified keysyms_per_keycode can be chosen arbitrarily by + the client to be large enough to hold all desired symbols. A + special KeySym value of NoSymbol should be used to fill in + unused elements for individual KeyCodes. It is legal for + NoSymbol to appear in nontrailing positions of the effective + list for a KeyCode.XChangeDeviceKeyMapping generates a + DeviceMappingNotify event that is sent to all clients that have + selected that type of event. + + There is no requirement that the X server interpret this + mapping. It is merely stored for reading and writing by + clients. + + If the specified device does not support input class keys, a + BadMatch error results. + + XChangeDeviceKeyMapping can generate a BadDevice, BadMatch, + BadAlloc, or BadValue error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGetDeviceKeyMapping or + XChangeDeviceKeyMapping request was made specifying a + device that has no keys. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadAlloc + The server failed to allocate the requested resource or + server memory. + +SEE ALSO +-------- + + XSetDeviceButtonMapping(libmansuffix), XSetDeviceModifierMapping(__libmansuffix_) diff --git a/man/XGetDeviceModifierMapping.man b/man/XGetDeviceModifierMapping.man new file mode 100644 index 0000000..1b4b4f6 --- /dev/null +++ b/man/XGetDeviceModifierMapping.man @@ -0,0 +1,257 @@ +'\" t +.\" Title: xgetdevicemodifiermapping +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETDEVICEMODIFIERMA" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetDeviceModifierMapping, XSetDeviceModifierMapping \- query or change device modifier mappings +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XSetDeviceModifierMapping( Display *display, + XDevice *device, + XModifierKeymap *modmap); +.fi +.sp +.nf +XModifierKeymap *XGetDeviceModifierMapping( Display *display, + XDevice *device); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose modifier mapping is to be + queried or modified\&. +.fi +.sp +.nf +modmap + Specifies a pointer to the XModifierKeymap structure\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSetDeviceModifierMapping request specifies the KeyCodes of +the keys (if any) that are to be used as modifiers for the +specified device\&. If it succeeds, the X server generates a +DeviceMappingNotify event, and XSetDeviceModifierMapping +returns MappingSuccess\&. X permits at most eight modifier keys\&. +If more than eight are specified in the XModifierKeymap +structure, a BadLength error results\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The modifiermap member of the XModifierKeymap structure +contains eight sets of max_keypermod KeyCodes, one for each +modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3, +Mod4, and Mod5\&. Only nonzero KeyCodes have meaning in each set, +and zero KeyCodes are ignored\&. In addition, all of the nonzero +KeyCodes must be in the range specified by min_keycode and +max_keycode as returned by XListInputDevices, or a BadValue +error results\&. No KeyCode may appear twice in the entire map, +or a BadValue error results\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +An X server can impose restrictions on how modifiers can be +changed, for example, if certain keys do not generate up +transitions in hardware, if auto\-repeat cannot be disabled on +certain keys, or if multiple modifier keys are not supported\&. +If some such restriction is violated, the status reply is +MappingFailed, and none of the modifiers are changed\&. If the +new KeyCodes specified for a modifier differ from those +currently defined and any (current or new) keys for that +modifier are in the logically down state, +XSetDeviceModifierMapping returns MappingBusy, and none of the +modifiers is changed\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceModifierMapping can generate BadLength, BadDevice, +BadMatch, BadAlloc, and BadValue errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceModifierMapping request returns a pointer to a +newly created XModifierKeymap structure that contains the keys +being used as modifiers\&. The structure should be freed after +use by calling XFreeModifierMapping \&. If only zero values +appear in the set for any modifier, that modifier is disabled\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceModifierMapping can generate BadDevice and BadMatch +errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +Structures +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XModifierKeymap structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { +int max_keypermod; +KeyCode *modifiermap; +} XModifierKeymap; +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadLength + More than eight keys were specified in the + XModifierKeymap structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadAlloc + The server failed to allocate the requested resource or + server memory\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceModifierMapping or + XChangeDeviceModifierMapping request was made specifying + a device that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceKeyMapping(libmansuffix), XSetDeviceButtonMapping(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetDeviceModifierMapping.txt b/man/XGetDeviceModifierMapping.txt new file mode 100644 index 0000000..240f93f --- /dev/null +++ b/man/XGetDeviceModifierMapping.txt @@ -0,0 +1,118 @@ +XGETDEVICEMODIFIERMAPPING(libmansuffix) +======================================= + +NAME +---- + + XGetDeviceModifierMapping, XSetDeviceModifierMapping - query or + change device modifier mappings + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XSetDeviceModifierMapping( Display *display, + XDevice *device, + XModifierKeymap *modmap); + + XModifierKeymap *XGetDeviceModifierMapping( Display *display, + XDevice *device); + + display + Specifies the connection to the X server. + + device + Specifies the device whose modifier mapping is to be + queried or modified. + + modmap + Specifies a pointer to the XModifierKeymap structure. + +DESCRIPTION +----------- + + The XSetDeviceModifierMapping request specifies the KeyCodes of + the keys (if any) that are to be used as modifiers for the + specified device. If it succeeds, the X server generates a + DeviceMappingNotify event, and XSetDeviceModifierMapping + returns MappingSuccess. X permits at most eight modifier keys. + If more than eight are specified in the XModifierKeymap + structure, a BadLength error results. + + The modifiermap member of the XModifierKeymap structure + contains eight sets of max_keypermod KeyCodes, one for each + modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3, + Mod4, and Mod5. Only nonzero KeyCodes have meaning in each set, + and zero KeyCodes are ignored. In addition, all of the nonzero + KeyCodes must be in the range specified by min_keycode and + max_keycode as returned by XListInputDevices, or a BadValue + error results. No KeyCode may appear twice in the entire map, + or a BadValue error results. + + An X server can impose restrictions on how modifiers can be + changed, for example, if certain keys do not generate up + transitions in hardware, if auto-repeat cannot be disabled on + certain keys, or if multiple modifier keys are not supported. + If some such restriction is violated, the status reply is + MappingFailed, and none of the modifiers are changed. If the + new KeyCodes specified for a modifier differ from those + currently defined and any (current or new) keys for that + modifier are in the logically down state, + XSetDeviceModifierMapping returns MappingBusy, and none of the + modifiers is changed. + + XSetDeviceModifierMapping can generate BadLength, BadDevice, + BadMatch, BadAlloc, and BadValue errors. + + The XGetDeviceModifierMapping request returns a pointer to a + newly created XModifierKeymap structure that contains the keys + being used as modifiers. The structure should be freed after + use by calling XFreeModifierMapping . If only zero values + appear in the set for any modifier, that modifier is disabled. + + XGetDeviceModifierMapping can generate BadDevice and BadMatch + errors. + +Structures + + The XModifierKeymap structure contains: + + typedef struct { + int max_keypermod; + KeyCode *modifiermap; + } XModifierKeymap; + +DIAGNOSTICS +----------- + + BadLength + More than eight keys were specified in the + XModifierKeymap structure. + + BadAlloc + The server failed to allocate the requested resource or + server memory. + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGetDeviceModifierMapping or + XChangeDeviceModifierMapping request was made specifying + a device that has no keys. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + +SEE ALSO +-------- + + XSetDeviceKeyMapping(libmansuffix), XSetDeviceButtonMapping(libmansuffix) diff --git a/man/XGetDeviceMotionEvents.man b/man/XGetDeviceMotionEvents.man new file mode 100644 index 0000000..7212f19 --- /dev/null +++ b/man/XGetDeviceMotionEvents.man @@ -0,0 +1,230 @@ +'\" t +.\" Title: xgetdevicemotionevents +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETDEVICEMOTIONEVEN" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetDeviceMotionEvents, XDeviceTimeCoord \- get device motion history +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XDeviceTimeCoord *XGetDeviceMotionEvents( Display *display, + XDevice *device, + Time start, + Time stop, + int *nevents_return, + int *mode_return, + int *axis_count_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose motion history is to be + queried\&. +.fi +.sp +.nf +start, stop + Specify the time interval in which the events are + returned from the motionhistory buffer\&.You can pass a + timestamp or CurrentTime\&. +.fi +.sp +.nf +nevents_return + Returns the number of events from the motion history + buffer\&. +.fi +.sp +.nf +mode_return + Returns the mode of the device (Absolute or Relative)\&. +.fi +.sp +.nf +axis_count_return + Returns the count of axes being reported\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The server may retain the recent history of the device motion +and do so to a finer granularity than is reported by +DeviceMotionNotify events\&. The XGetDeviceMotionEvents request +makes this history available\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceMotionEvents request returns all events in the +motion history buffer that fall between the specified start and +stop times, inclusive\&. If the start time is later than the stop +time or if the start time is in the future, no events are +returned\&. If the stop time is in the future, it is equivalent +to specifying CurrentTime\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The mode indicates whether the device is reporting absolute +positional data (mode = Absolute ) or relative motion data +(mode = Relative )\&. Some devices allow their mode to be changed +via the XSetDeviceMode request\&. These constants are defined in +the file XI\&.h\&. The axis_count returns the number of axes or +valuators being reported by the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceMotionEvents can generate a BadDevice, or BadMatch +error\&. +.fi +.if n \{\ +.RE +.\} +.sp +Structures +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDeviceTimeCoord structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + Time time; + int *data; +} XDeviceTimeCoord; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The time member is set to the time, in milliseconds\&. The data +member is a pointer to an array of integers\&. These integers are +set to the values of each valuator or axis reported by the +device\&. There is one element in the array per axis of motion +reported by the device\&. The value of the array elements depends +on the mode of the device\&. If the mode is Absolute, the values +are the raw values generated by the device\&. These may be scaled +by client programs using the maximum values that the device can +generate\&. The maximum value for each axis of the device is +reported in the max_val field of the XAxisInfo returned by the +XListInputDevices request\&. If the mode is Relative, the data +values are the relative values generated by the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +You should use XFreeDeviceMotionEvents to free the data +returned by this request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Errors returned by this request: BadDevice, BadMatch\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceMotionEvents + request is made specifying a device that has no + valuators and reports no axes of motion\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetDeviceMotionEvents.txt b/man/XGetDeviceMotionEvents.txt new file mode 100644 index 0000000..9dfcfed --- /dev/null +++ b/man/XGetDeviceMotionEvents.txt @@ -0,0 +1,109 @@ +XGETDEVICEMOTIONEVENTS(libmansuffix) +==================================== + +NAME +---- + + XGetDeviceMotionEvents, XDeviceTimeCoord - get device motion + history + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XDeviceTimeCoord *XGetDeviceMotionEvents( Display *display, + XDevice *device, + Time start, + Time stop, + int *nevents_return, + int *mode_return, + int *axis_count_return); + + display + Specifies the connection to the X server. + + device + Specifies the device whose motion history is to be + queried. + + start, stop + Specify the time interval in which the events are + returned from the motionhistory buffer.You can pass a + timestamp or CurrentTime. + + nevents_return + Returns the number of events from the motion history + buffer. + + mode_return + Returns the mode of the device (Absolute or Relative). + + axis_count_return + Returns the count of axes being reported. + +DESCRIPTION +----------- + + The server may retain the recent history of the device motion + and do so to a finer granularity than is reported by + DeviceMotionNotify events. The XGetDeviceMotionEvents request + makes this history available. + + The XGetDeviceMotionEvents request returns all events in the + motion history buffer that fall between the specified start and + stop times, inclusive. If the start time is later than the stop + time or if the start time is in the future, no events are + returned. If the stop time is in the future, it is equivalent + to specifying CurrentTime. + + The mode indicates whether the device is reporting absolute + positional data (mode = Absolute ) or relative motion data + (mode = Relative ). Some devices allow their mode to be changed + via the XSetDeviceMode request. These constants are defined in + the file XI.h. The axis_count returns the number of axes or + valuators being reported by the device. + + XGetDeviceMotionEvents can generate a BadDevice, or BadMatch + error. + +Structures + + The XDeviceTimeCoord structure contains: + + typedef struct { + Time time; + int *data; + } XDeviceTimeCoord; + + The time member is set to the time, in milliseconds. The data + member is a pointer to an array of integers. These integers are + set to the values of each valuator or axis reported by the + device. There is one element in the array per axis of motion + reported by the device. The value of the array elements depends + on the mode of the device. If the mode is Absolute, the values + are the raw values generated by the device. These may be scaled + by client programs using the maximum values that the device can + generate. The maximum value for each axis of the device is + reported in the max_val field of the XAxisInfo returned by the + XListInputDevices request. If the mode is Relative, the data + values are the relative values generated by the device. + + You should use XFreeDeviceMotionEvents to free the data + returned by this request. + + Errors returned by this request: BadDevice, BadMatch. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGetDeviceMotionEvents + request is made specifying a device that has no + valuators and reports no axes of motion. diff --git a/man/XGetDeviceProperty.man b/man/XGetDeviceProperty.man new file mode 100644 index 0000000..cebe2f8 --- /dev/null +++ b/man/XGetDeviceProperty.man @@ -0,0 +1,225 @@ +'\" t +.\" Title: xgetdeviceproperty +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETDEVICEPROPERTY" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetDeviceProperty, XChangeDeviceProperty, XDeleteDeviceProperty \- Get, change or delete a device\*(Aqs property\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XGetDeviceProperty( Display *display, + XDevice *device, + Atom property, + long offset, + long length, + Bool delete, + Atom req_type, + Atom *actual_type_return, + int *actual_format_return, + unsigned long *nitems_return, + unsigned long *bytes_after_return, + unsigned char **prop_return) +.fi +.sp +.nf +void XChangeDeviceProperty( Display *display, + XDevice *device, + Atom property, + Atom type, + int format, + int mode, + const char *data, + int nelements) +.fi +.sp +.nf +void XDeleteDeviceProperty( Display *display, + XDevice *device, + Atom property) +.fi +.sp +.nf +actual_type_return + Returns an atom identifier that defines the actual type + of the property\&. +.fi +.sp +.nf +actual_format_return + Returns the actual format of the property\&. +.fi +.sp +.nf +bytes_after_return + Returns the number of bytes remaining to be read in the + property if a partial read was performed\&. +.fi +.sp +.nf +data + Specifies the property data\&. +.fi +.sp +.nf +delete + Specifies a Boolean value that determines whether the + property is deleted\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + The device to grab\&. +.fi +.sp +.nf +format + Specifies whether the data should be viewed as a list of + 8\-bit, 16\-bit, or 32\-bit quantities\&. Possible values are + 8, 16, and 32\&. This information allows the X server to + correctly perform byte\-swap operations as necessary\&. If + the format is 16\-bit or 32\-bit, you must explicitly cast + the data pointer to an (unsigned char*) in the call to + XChangeDeviceProperty\&. +.fi +.sp +.nf +length + Specifies the length in 32\-bit multiplies of the data to + be retrieved\&. +.fi +.sp +.nf +mode + Specifies the mode of operation\&. You can pass + PropModeReplace, PropModePrepend, or PropModeAppend\&. +.fi +.sp +.nf +nelements + Specifies the number of elements in data\&. +.fi +.sp +.nf +nitems_return + Returns the actual number of 8\-bit, 16\-bit, or 32\-bit + items stored in the prop_return array\&. +.fi +.sp +.nf +num_values + Specifies the number of elements in the values list\&. +.fi +.sp +.nf +offset + Specifies the offset in the specified property (in + 32\-bit quantities) where the data is to be retrieved\&. +.fi +.sp +.nf +property + Specifies the property to modify or query\&. +.fi +.sp +.nf +prop_return + Returns the data in the specified format\&. If the + returned format is 8, the returned data is represented + as a char array\&. If the returned format is 16, the + returned data is represented as an array of short int + type and should be cast to that type to obtain the + elements\&. If the returned format is 32, the property + data will be stored as an array of longs (which in a + 64\-bit application will be 64\-bit values that are padded + in the upper 4 bytes)\&. +.fi +.sp +.nf +req_type + Specifies the atom identifier associated with the + property type or AnyPropertyType\&. +.fi +.SH "DESCRIPTION" +.sp +The XGetDeviceProperty function returns the actual type of the property; the actual format of the property; the number of 8\-bit, 16\-bit, or 32\-bit items transferred; the number of bytes remaining to be read in the property; and a pointer to the data actually returned\&. For a detailed description of this function, see the man page to XGetWindowProperty\&. +.sp +The XChangeDeviceProperty function alters the property for the specified device and causes the server to generate a XPropertyNotifyEvent event on that device\&. For a detailed description of this function, see the man page to XChangeProperty\&. +.sp +The XDeleteDeviceProperty function deletes the specified device property\&. Note that a client cannot delete a property created by a driver or the server\&. Attempting to do so will result in a BadAtom error\&. +.sp +XGetDeviceProperty can generate a BadAtom, BadDevice error\&. +.sp +XChangeDeviceProperty can generate a BadDevice, a BadMatch, a BadAtom, and a BadValue error\&. +.sp +XDeleteDeviceProperty can generate a BadDevice, and a BadAtom error\&. +.SH "DIAGNOSIS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadAtom + A value does not describe a valid named identifier or + the client attempted to remove a driver\-allocated + property\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XListDeviceProperties(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetDeviceProperty.txt b/man/XGetDeviceProperty.txt new file mode 100644 index 0000000..403aa96 --- /dev/null +++ b/man/XGetDeviceProperty.txt @@ -0,0 +1,160 @@ +XGETDEVICEPROPERTY(libmansuffix) +================================ + +NAME +---- + + XGetDeviceProperty, XChangeDeviceProperty, + XDeleteDeviceProperty - Get, change or delete a device's + property. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XGetDeviceProperty( Display *display, + XDevice *device, + Atom property, + long offset, + long length, + Bool delete, + Atom req_type, + Atom *actual_type_return, + int *actual_format_return, + unsigned long *nitems_return, + unsigned long *bytes_after_return, + unsigned char **prop_return) + + void XChangeDeviceProperty( Display *display, + XDevice *device, + Atom property, + Atom type, + int format, + int mode, + const char *data, + int nelements) + + void XDeleteDeviceProperty( Display *display, + XDevice *device, + Atom property) + + + actual_type_return + Returns an atom identifier that defines the actual type + of the property. + + actual_format_return + Returns the actual format of the property. + + bytes_after_return + Returns the number of bytes remaining to be read in the + property if a partial read was performed. + + data + Specifies the property data. + + delete + Specifies a Boolean value that determines whether the + property is deleted. + + display + Specifies the connection to the X server. + + device + The device to grab. + + format + Specifies whether the data should be viewed as a list of + 8-bit, 16-bit, or 32-bit quantities. Possible values are + 8, 16, and 32. This information allows the X server to + correctly perform byte-swap operations as necessary. If + the format is 16-bit or 32-bit, you must explicitly cast + the data pointer to an (unsigned char*) in the call to + XChangeDeviceProperty. + + length + Specifies the length in 32-bit multiplies of the data to + be retrieved. + + mode + Specifies the mode of operation. You can pass + PropModeReplace, PropModePrepend, or PropModeAppend. + + nelements + Specifies the number of elements in data. + + nitems_return + Returns the actual number of 8-bit, 16-bit, or 32-bit + items stored in the prop_return array. + + num_values + Specifies the number of elements in the values list. + + offset + Specifies the offset in the specified property (in + 32-bit quantities) where the data is to be retrieved. + + property + Specifies the property to modify or query. + + prop_return + Returns the data in the specified format. If the + returned format is 8, the returned data is represented + as a char array. If the returned format is 16, the + returned data is represented as an array of short int + type and should be cast to that type to obtain the + elements. If the returned format is 32, the property + data will be stored as an array of longs (which in a + 64-bit application will be 64-bit values that are padded + in the upper 4 bytes). + + req_type + Specifies the atom identifier associated with the + property type or AnyPropertyType. + +DESCRIPTION +----------- + +The XGetDeviceProperty function returns the actual type of the +property; the actual format of the property; the number of +8-bit, 16-bit, or 32-bit items transferred; the number of bytes +remaining to be read in the property; and a pointer to the data +actually returned. For a detailed description of this function, +see the man page to XGetWindowProperty. + +The XChangeDeviceProperty function alters the property for the +specified device and causes the server to generate a +XPropertyNotifyEvent event on that device. For a detailed +description of this function, see the man page to +XChangeProperty. + +The XDeleteDeviceProperty function deletes the specified device +property. Note that a client cannot delete a property created +by a driver or the server. Attempting to do so will result in a +BadAtom error. + +XGetDeviceProperty can generate a BadAtom, BadDevice error. + +XChangeDeviceProperty can generate a BadDevice, a BadMatch, a +BadAtom, and a BadValue error. + +XDeleteDeviceProperty can generate a BadDevice, and a BadAtom +error. + +DIAGNOSIS +--------- + + BadAtom + A value does not describe a valid named identifier or + the client attempted to remove a driver-allocated + property. + + BadDevice + An invalid device was specified. The device does not + exist. + +SEE ALSO +-------- + + XListDeviceProperties(libmansuffix) diff --git a/man/XGetExtensionVersion.man b/man/XGetExtensionVersion.man new file mode 100644 index 0000000..a1a926f --- /dev/null +++ b/man/XGetExtensionVersion.man @@ -0,0 +1,117 @@ +'\" t +.\" Title: xgetextensionversion +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETEXTENSIONVERSION" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetExtensionVersion \- query the version of the input extension\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XExtensionVersion *XGetExtensionVersion( Display *display, + char *name); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +name + Specifies the extension to be queried\&. The input + extension name is definedin the header file XI\&.h\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetExtensionVersion request is deprecated and should not +be used in XI2 applications\&. Clients issuing a XGetExtensionVersion +request will not be able to use XI2 features\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetExtensionVersion request queries the version of the input +extension, and returns an XExtensionVersion structure\&. This structure +contains a major_version and minor_version number which can be compared +with constants defined in XI\&.h\&. Support for additional protocol +requests added to the input extension after its initial release +is indicated by a version number corresponding to the added +requests\&. Each version contains all the protocol requests +contained by previous versions\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +You should use XFree to free the XExtensionVersion structure\&. +.fi +.if n \{\ +.RE +.\} +.SH "STRUCTURES" +.sp +.if n \{\ +.RS 4 +.\} +.nf +This request returns an XExtensionVersion structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int present; + short major_version; + short minor_version; +} XExtensionVersion; +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetExtensionVersion.txt b/man/XGetExtensionVersion.txt new file mode 100644 index 0000000..c7d45f4 --- /dev/null +++ b/man/XGetExtensionVersion.txt @@ -0,0 +1,51 @@ +XGETEXTENSIONVERSION(libmansuffix) +================================== + +NAME +---- + + XGetExtensionVersion - query the version of the input extension. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XExtensionVersion *XGetExtensionVersion( Display *display, + char *name); + + display + Specifies the connection to the X server. + + name + Specifies the extension to be queried. The input + extension name is definedin the header file XI.h. + +DESCRIPTION +----------- + + The XGetExtensionVersion request is deprecated and should not + be used in XI2 applications. Clients issuing a XGetExtensionVersion + request will not be able to use XI2 features. + + The XGetExtensionVersion request queries the version of the input + extension, and returns an XExtensionVersion structure. This structure + contains a major_version and minor_version number which can be compared + with constants defined in XI.h. Support for additional protocol + requests added to the input extension after its initial release + is indicated by a version number corresponding to the added + requests. Each version contains all the protocol requests + contained by previous versions. + + You should use XFree to free the XExtensionVersion structure. + +STRUCTURES +---------- + + This request returns an XExtensionVersion structure. + + typedef struct { + int present; + short major_version; + short minor_version; + } XExtensionVersion; diff --git a/man/XGetFeedbackControl.man b/man/XGetFeedbackControl.man new file mode 100644 index 0000000..9ae6e4c --- /dev/null +++ b/man/XGetFeedbackControl.man @@ -0,0 +1,584 @@ +'\" t +.\" Title: xgetfeedbackcontrol +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/16/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGETFEEDBACKCONTROL" "libmansuffix" "12/16/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGetFeedbackControl, XChangeFeedbackControl \- query and change input device feedbacks +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XFeedbackState *XGetFeedbackControl( Display *display, + XDevice *device, + int *num_feedbacks); +.fi +.sp +.nf +int XChangeFeedbackControl( Display *display, + XDevice *device, + Mask mask, + XFeedbackControl *control); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose feedbacks are to be queried + or modified\&. +.fi +.sp +.nf +num_feedbacks + Specifies an address into which the number of feedbacks + supported by thedevice is to be returned\&. +.fi +.sp +.nf +mask + Specifies a mask specific to each type of feedback that + describes howthe feedback is to be modified\&. +.fi +.sp +.nf +control + Specifies the address of an XFeedbackControl structure + that containsthe new values for the feedback\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +These requests are provided to manipulate those input devices +that support feedbacks\&. A BadMatch error will be generated if +the requested device does not support feedbacks\&. Whether or not +a given device supports feedbacks can be determined by +examining the information returned by the XOpenDevice request\&. +For those devices that support feedbacks, XOpenDevice will +return an XInputClassInfo structure with the input_class field +equal to the constant FeedbackClass (defined in the file XI\&.h)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetFeedbackControl request returns a pointer to a list of +XFeedbackState structures\&. Each item in this list describes one +of the feedbacks supported by the device\&. The items are +variable length, so each contains its length to allow traversal +to the next item in the list\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The feedback classes that are currently defined are: +KbdFeedbackClass, PtrFeedbackClass, StringFeedbackClass, +IntegerFeedbackClass, LedFeedbackClass, and BellFeedbackClass\&. +These constants are defined in the file XI\&.h\&. An input device +may support zero or more classes of feedback, and may support +multiple feedbacks of the same class\&. Each feedback contains a +class identifier and an id that is unique within that class for +that input device\&. The id is used to identify the feedback when +making an XChangeFeedbackControl request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetFeedbackControl can generate a BadDevice or BadMatch error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XChangeFeedbackControl request modifies the values of one +feedback on the specified device\&. The feedback is identified by +the id field of the XFeedbackControl structure that is passed +with the request\&. The fields of the feedback that are to be +modified are identified by the bits of the mask that is passed +with the request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeFeedbackControl can generate a BadDevice, BadMatch, or +BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.SS "Structures" +.sp +.if n \{\ +.RS 4 +.\} +.nf +Each class of feedback is described by a structure specific to +that class\&. These structures are defined in the file XInput\&.h\&. +XFeedbackState and XFeedbackControl are generic structures that +contain three fields that are at the beginning of each class of +feedback: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; +} XFeedbackState, XFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XKbdFeedbackState structure defines the attributes that are +returned for feedbacks equivalent to those on the X keyboard\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKbdFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XPtrFeedbackState structure defines the attributes that are +returned for feedbacks equivalent to those on the the X +pointer\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIntegerFeedbackState structure defines attributes that are +returned for integer feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int resolution; + int minVal; + int maxVal; +} XIntegerFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XStringFeedbackState structure defines the attributes that +are returned for string feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int max_symbols; + int num_syms_supported; + KeySym *syms_supported; +} XStringFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XBellFeedbackState structure defines the attributes that +are returned for bell feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XLedFeedbackState structure defines the attributes that are +returned for LED feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int led_values; +} XLedFeedbackState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XPrtFeedbackControl structure defines the attributes that +can be controlled for pointer feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XKbdFeedbackControl structure defines the attributes that +can be controlled for keyboard feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int led_value; + int key; + int auto_repeat_mode; +} XKbdFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XStringFeedbackControl structure defines the attributes +that can be controlled for string feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int num_keysyms; + KeySym *syms_to_display; +} XStringFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIntegerFeedbackControl structure defines the attributes +that can be controlled for integer feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int int_to_display; +} XIntegerFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XBellFeedbackControl structure defines the attributes that +can be controlled for bell feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XLedFeedbackControl structure defines the attributes that +can be controlled for LED feedbacks\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID class; + int length; + XID id; + int led_mask; + int led_values; +} XLedFeedbackControl; +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetFeedbackControl request + was made specifying a device that has no feedbacks, or + an XChangeFeedbackControl request was made with an + XFeedbackControl structure that contains an invalid + feedback type\&. It may also occur if an invalid + combination of mask bits is specified ( DvKey but no + DvAutoRepeatMode for keyboard feedbacks), or if an + invalid KeySym is specified for a string feedback\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the XChangeFeedbackControl request\&. Unless a + specific range is specified for an argument, the full + range defined by the argument\*(Aqs type is accepted\&. Any + argument defined as a set of alternatives can generate + this error\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGetFeedbackControl.txt b/man/XGetFeedbackControl.txt new file mode 100644 index 0000000..820ff96 --- /dev/null +++ b/man/XGetFeedbackControl.txt @@ -0,0 +1,273 @@ +XGETFEEDBACKCONTROL(libmansuffix) +================================= + +NAME +---- + + XGetFeedbackControl, XChangeFeedbackControl - query and change + input device feedbacks + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XFeedbackState *XGetFeedbackControl( Display *display, + XDevice *device, + int *num_feedbacks); + + int XChangeFeedbackControl( Display *display, + XDevice *device, + Mask mask, + XFeedbackControl *control); + + display + Specifies the connection to the X server. + + device + Specifies the device whose feedbacks are to be queried + or modified. + + num_feedbacks + Specifies an address into which the number of feedbacks + supported by thedevice is to be returned. + + mask + Specifies a mask specific to each type of feedback that + describes howthe feedback is to be modified. + + control + Specifies the address of an XFeedbackControl structure + that containsthe new values for the feedback. + +DESCRIPTION +----------- + + These requests are provided to manipulate those input devices + that support feedbacks. A BadMatch error will be generated if + the requested device does not support feedbacks. Whether or not + a given device supports feedbacks can be determined by + examining the information returned by the XOpenDevice request. + For those devices that support feedbacks, XOpenDevice will + return an XInputClassInfo structure with the input_class field + equal to the constant FeedbackClass (defined in the file XI.h). + + The XGetFeedbackControl request returns a pointer to a list of + XFeedbackState structures. Each item in this list describes one + of the feedbacks supported by the device. The items are + variable length, so each contains its length to allow traversal + to the next item in the list. + + The feedback classes that are currently defined are: + KbdFeedbackClass, PtrFeedbackClass, StringFeedbackClass, + IntegerFeedbackClass, LedFeedbackClass, and BellFeedbackClass. + These constants are defined in the file XI.h. An input device + may support zero or more classes of feedback, and may support + multiple feedbacks of the same class. Each feedback contains a + class identifier and an id that is unique within that class for + that input device. The id is used to identify the feedback when + making an XChangeFeedbackControl request. + + XGetFeedbackControl can generate a BadDevice or BadMatch error. + + The XChangeFeedbackControl request modifies the values of one + feedback on the specified device. The feedback is identified by + the id field of the XFeedbackControl structure that is passed + with the request. The fields of the feedback that are to be + modified are identified by the bits of the mask that is passed + with the request. + + XChangeFeedbackControl can generate a BadDevice, BadMatch, or + BadValue error. + +Structures +~~~~~~~~~~ + + Each class of feedback is described by a structure specific to + that class. These structures are defined in the file XInput.h. + XFeedbackState and XFeedbackControl are generic structures that + contain three fields that are at the beginning of each class of + feedback: + + typedef struct { + XID class; + int length; + XID id; + } XFeedbackState, XFeedbackControl; + + The XKbdFeedbackState structure defines the attributes that are + returned for feedbacks equivalent to those on the X keyboard. + + typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int global_auto_repeat; + char auto_repeats[32]; + } XKbdFeedbackState; + + The XPtrFeedbackState structure defines the attributes that are + returned for feedbacks equivalent to those on the the X + pointer. + + typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; + } XPtrFeedbackState; + + The XIntegerFeedbackState structure defines attributes that are + returned for integer feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int resolution; + int minVal; + int maxVal; + } XIntegerFeedbackState; + + The XStringFeedbackState structure defines the attributes that + are returned for string feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int max_symbols; + int num_syms_supported; + KeySym *syms_supported; + } XStringFeedbackState; + + The XBellFeedbackState structure defines the attributes that + are returned for bell feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; + } XBellFeedbackState; + + The XLedFeedbackState structure defines the attributes that are + returned for LED feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int led_values; + } XLedFeedbackState; + + The XPrtFeedbackControl structure defines the attributes that + can be controlled for pointer feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; + } XPtrFeedbackControl; + + The XKbdFeedbackControl structure defines the attributes that + can be controlled for keyboard feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int led_value; + int key; + int auto_repeat_mode; + } XKbdFeedbackControl; + + The XStringFeedbackControl structure defines the attributes + that can be controlled for string feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int num_keysyms; + KeySym *syms_to_display; + } XStringFeedbackControl; + + The XIntegerFeedbackControl structure defines the attributes + that can be controlled for integer feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int int_to_display; + } XIntegerFeedbackControl; + + The XBellFeedbackControl structure defines the attributes that + can be controlled for bell feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; + } XBellFeedbackControl; + + The XLedFeedbackControl structure defines the attributes that + can be controlled for LED feedbacks. + + typedef struct { + XID class; + int length; + XID id; + int led_mask; + int led_values; + } XLedFeedbackControl; + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests. + + BadMatch + This error may occur if an XGetFeedbackControl request + was made specifying a device that has no feedbacks, or + an XChangeFeedbackControl request was made with an + XFeedbackControl structure that contains an invalid + feedback type. It may also occur if an invalid + combination of mask bits is specified ( DvKey but no + DvAutoRepeatMode for keyboard feedbacks), or if an + invalid KeySym is specified for a string feedback. + + BadValue + Some numeric value falls outside the range of values + accepted by the XChangeFeedbackControl request. Unless a + specific range is specified for an argument, the full + range defined by the argument's type is accepted. Any + argument defined as a set of alternatives can generate + this error. diff --git a/man/XGetSelectedExtensionEvents.man b/man/XGetSelectedExtensionEvents.man new file mode 100644 index 0000000..ea49cf1 --- /dev/null +++ b/man/XGetSelectedExtensionEvents.man @@ -0,0 +1 @@ +.so XSelectExtensionEvent.libmansuffix diff --git a/man/XGrabDevice.man b/man/XGrabDevice.man new file mode 100644 index 0000000..cc36476 --- /dev/null +++ b/man/XGrabDevice.man @@ -0,0 +1,294 @@ +'\" t +.\" Title: xgrabdevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGRABDEVICE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGrabDevice, XUngrabDevice \- grab/release the specified extension device +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XGrabDevice( Display *display, + XDevice* device, + Window grab_window, + Bool owner_events, + int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode, + Time time); +.fi +.sp +.nf +int XUngrabDevice( Display *display, + XDevice *device, + Time time); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device to be grabbed or released\&. +.fi +.sp +.nf +grab_window + Specifies the id of a window to be associated with the + device\&. +.fi +.sp +.nf +owner_events + Specifies a Boolean value that indicates whether + theevents from the deviceare to be reported as usual or + reported with respect to the grab windowif selected by + the event list\&. +.fi +.sp +.nf +event_count + Specifies the number of elements in the event_list + array\&. +.fi +.sp +.nf +event_list + Specifies a pointer to a list of event classes that + indicates which eventsthe client wishes to receive\&. + These event classes must have beenobtained specifying + the device being grabbed\&. +.fi +.sp +.nf +this_device_mode + Specifies further processing of events from this + device\&.You can pass GrabModeSyncor GrabModeAsync\&. +.fi +.sp +.nf +other_devices_mode + Specifies further processing of events from other + devices\&.You can pass GrabModeSyncor GrabModeAsync\&. +.fi +.sp +.nf +time + Specifies the time\&.You can pass either a timestamp or + CurrentTime\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGrabDevice request actively grabs control of the device +and generates DeviceFocusIn and DeviceFocusOut events\&. Further +device events are reported only to the grabbing +client\&.XGrabDevice overrides any active device grab by this +client\&. event_list is a pointer to a list of event classes\&. +This list indicates which events the client wishes to receive +while the grab is active\&. If owner_events is False, all +generated device events are reported with respect to +grab_window if selected\&. If owner_events is True and if a +generated device event would normally be reported to this +client, it is reported normally; otherwise, the event is +reported with respect to the grab_window, and is only reported +if specified in the event_list\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the this_device_mode argument is GrabModeAsync, device event +processing continues as usual\&. If the device is currently +frozen by this client, then processing of device events is +resumed\&. If the this_device_mode argument is GrabModeSync, the +state of the device (as seen by client applications) appears to +freeze, and the X server generates no further device events +until the grabbing client issues a releasing XAllowDeviceEvents +call or until the device grab is released\&. Actual device +changes are not lost while the device is frozen; they are +simply queued in the server for later processing\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If other_devices_mode is GrabModeAsync, processing of events +from other devices is unaffected by activation of the grab\&. If +other_devices_mode is GrabModeSync, the state of all devices +except the grabbed device (as seen by client applications) +appears to freeze, and the X server generates no further events +from those devices until the grabbing client issues a releasing +XAllowDeviceEvents call or until the device grab is released\&. +Actual events are not lost while the devices are frozen; they +are simply queued in the server for later processing\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is actively grabbed by some other client, +XGrabDevice fails and returns AlreadyGrabbed\&. If grab_window is +not viewable, it fails and returns GrabNotViewable\&. If the +device is frozen by an active grab of another client, it fails +and returns GrabFrozen\&. If the specified time is earlier than +the last\-device\-grab time or later than the current X server +time, it fails and returns GrabInvalidTime\&. Otherwise, the +last\-device\-grab time is set to the specified time ( +CurrentTime is replaced by the current X server time)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If a grabbed device is closed by a client while an active grab +by that client is in effect, the active grab is released\&. If +the device is frozen only by an active grab of the requesting +client, it is thawed\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGrabDevice can generate BadClass, BadDevice, BadValue, and +BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XUngrabDevice request releases the device and any queued +events if this client has it actively grabbed from either +XGrabDevice or XGrabDeviceKey\&. If other devices are frozen by +the grab, XUngrabDevice thaws them\&.XUngrabDevice does not +release the device and any queued events if the specified time +is earlier than the last\-device\-grab time or is later than the +current X server time\&. It also generates DeviceFocusIn and +DeviceFocusOut events\&. The X server automatically performs an +UngrabDevice request if the event window for an active device +grab becomes not viewable\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XUngrabDevice can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XAllowDeviceEvents(libmansuffix), XGrabDeviceButton(libmansuffix), XGrabDeviceKey(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGrabDevice.txt b/man/XGrabDevice.txt new file mode 100644 index 0000000..443e6ac --- /dev/null +++ b/man/XGrabDevice.txt @@ -0,0 +1,159 @@ +XGRABDEVICE(libmansuffix) +========================= + +NAME +---- + + XGrabDevice, XUngrabDevice - grab/release the specified + extension device + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XGrabDevice( Display *display, + XDevice* device, + Window grab_window, + Bool owner_events, + int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode, + Time time); + + int XUngrabDevice( Display *display, + XDevice *device, + Time time); + + display + Specifies the connection to the X server. + + device + Specifies the device to be grabbed or released. + + grab_window + Specifies the id of a window to be associated with the + device. + + owner_events + Specifies a Boolean value that indicates whether + theevents from the deviceare to be reported as usual or + reported with respect to the grab windowif selected by + the event list. + + event_count + Specifies the number of elements in the event_list + array. + + event_list + Specifies a pointer to a list of event classes that + indicates which eventsthe client wishes to receive. + These event classes must have beenobtained specifying + the device being grabbed. + + this_device_mode + Specifies further processing of events from this + device.You can pass GrabModeSyncor GrabModeAsync. + + other_devices_mode + Specifies further processing of events from other + devices.You can pass GrabModeSyncor GrabModeAsync. + + time + Specifies the time.You can pass either a timestamp or + CurrentTime. + +DESCRIPTION +----------- + + The XGrabDevice request actively grabs control of the device + and generates DeviceFocusIn and DeviceFocusOut events. Further + device events are reported only to the grabbing + client.XGrabDevice overrides any active device grab by this + client. event_list is a pointer to a list of event classes. + This list indicates which events the client wishes to receive + while the grab is active. If owner_events is False, all + generated device events are reported with respect to + grab_window if selected. If owner_events is True and if a + generated device event would normally be reported to this + client, it is reported normally; otherwise, the event is + reported with respect to the grab_window, and is only reported + if specified in the event_list. + + If the this_device_mode argument is GrabModeAsync, device event + processing continues as usual. If the device is currently + frozen by this client, then processing of device events is + resumed. If the this_device_mode argument is GrabModeSync, the + state of the device (as seen by client applications) appears to + freeze, and the X server generates no further device events + until the grabbing client issues a releasing XAllowDeviceEvents + call or until the device grab is released. Actual device + changes are not lost while the device is frozen; they are + simply queued in the server for later processing. + + If other_devices_mode is GrabModeAsync, processing of events + from other devices is unaffected by activation of the grab. If + other_devices_mode is GrabModeSync, the state of all devices + except the grabbed device (as seen by client applications) + appears to freeze, and the X server generates no further events + from those devices until the grabbing client issues a releasing + XAllowDeviceEvents call or until the device grab is released. + Actual events are not lost while the devices are frozen; they + are simply queued in the server for later processing. + + If the device is actively grabbed by some other client, + XGrabDevice fails and returns AlreadyGrabbed. If grab_window is + not viewable, it fails and returns GrabNotViewable. If the + device is frozen by an active grab of another client, it fails + and returns GrabFrozen. If the specified time is earlier than + the last-device-grab time or later than the current X server + time, it fails and returns GrabInvalidTime. Otherwise, the + last-device-grab time is set to the specified time ( + CurrentTime is replaced by the current X server time). + + If a grabbed device is closed by a client while an active grab + by that client is in effect, the active grab is released. If + the device is frozen only by an active grab of the requesting + client, it is thawed. + + XGrabDevice can generate BadClass, BadDevice, BadValue, and + BadWindow errors. + + The XUngrabDevice request releases the device and any queued + events if this client has it actively grabbed from either + XGrabDevice or XGrabDeviceKey. If other devices are frozen by + the grab, XUngrabDevice thaws them.XUngrabDevice does not + release the device and any queued events if the specified time + is earlier than the last-device-grab time or is later than the + current X server time. It also generates DeviceFocusIn and + DeviceFocusOut events. The X server automatically performs an + UngrabDevice request if the event window for an active device + grab becomes not viewable. + + XUngrabDevice can generate a BadDevice error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + +SEE ALSO +-------- + + XAllowDeviceEvents(libmansuffix), XGrabDeviceButton(libmansuffix), XGrabDeviceKey(libmansuffix) diff --git a/man/XGrabDeviceButton.man b/man/XGrabDeviceButton.man new file mode 100644 index 0000000..87501bc --- /dev/null +++ b/man/XGrabDeviceButton.man @@ -0,0 +1,325 @@ +'\" t +.\" Title: xgrabdevicebutton +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGRABDEVICEBUTTON" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGrabDeviceButton, XUngrabDeviceButton \- grab/ungrab extension input device buttons +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XGrabDeviceButton( Display *display, + XDevice *device, + unsigned int button, + unsigned int modifiers, + XDevice* modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode); +.fi +.sp +.nf +int XUngrabDeviceButton( Display *display, + XDevice *device, + unsigned int button, + unsigned int modifiers, + XDevice* modifier_device, + Window grab_window); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device that is to be grabbed or released +.fi +.sp +.nf +button + Specifies the device button that is to be grabbed or + released or AnyButton\&. +.fi +.sp +.nf +modifiers + Specifies the set of keymasks or AnyModifier\&.The mask is + the bitwise inclusive OR of the valid keymask bits\&. + Valid bits are: Shiftmask, LockMask, ControlMask, + Mod1Mask, Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask\&. +.fi +.sp +.nf +modifier_device + specifies the device whose modifiers are to be used\&. If + the modifier_devicespecified is NULL, the X keyboard + will be used as the modifier_device\&. +.fi +.sp +.nf +grab_window + Specifies the grab window\&. +.fi +.sp +.nf +owner_events + Specifies a Boolean value that indicates whether the + deviceevents are to be reported as usual or reported + with respect to the grab windowif selected by the event + list\&. +.fi +.sp +.nf +event_count + Specifies the number of event classes in the event list\&. +.fi +.sp +.nf +event_list + Specifies which events are reported to the client\&. +.fi +.sp +.nf +this_device_mode + Specifies further processing of events from this + device\&.You can pass GrabModeSync or GrabModeAsync\&. +.fi +.sp +.nf +other_devices_mode + Specifies further processing of events from all other + devices\&.You can pass GrabModeSync or GrabModeAsync\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGrabDeviceButton request establishes a passive grab\&. In +the future, the device is actively grabbed (as for XGrabDevice, +the last\-grab time is set to the time at which the button was +pressed (as transmitted in the DeviceButtonPress event), and +the DeviceButtonPress event is reported if all of the following +conditions are true: + * The device is not grabbed, and the specified button is + logically pressed when the specified modifier keys are + logically down on the specified modifier device and no + other buttons or modifier keys are logically down\&. + * Either the grab window is an ancestor of (or is) the focus + window, OR the grab window is a descendent of the focus + window and contains the device\&. + * A passive grab on the same button/modifier combination does + not exist on any ancestor of grab_window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The interpretation of the remaining arguments is as for +XGrabDevice\&. The active grab is terminated automatically when +the logical state of the device has all buttons released +(independent of the logical state of the modifier keys)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Note that the logical state of a device (as seen by client +applications) may lag the physical state if device event +processing is frozen\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This request overrides all previous grabs by the same client on +the same button/modifier combinations on the same window\&. A +modifiers of AnyModifier is equivalent to issuing the grab +request for all possible modifier combinations (including the +combination of no modifiers)\&. It is not required that all +modifiers specified have currently assigned KeyCodes\&. A button +of AnyButton is equivalent to issuing the request for all +possible buttons\&. Otherwise, it is not required that the +specified button currently be assigned to a physical button\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A modifier_device of NULL indicates that the X keyboard is to +be used as the modifier_device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If some other client has already issued a XGrabDeviceButton +with the same button/modifier combination on the same window, a +BadAccess error results\&. When using AnyModifier or AnyButton , +the request fails completely, and a BadAccess error results (no +grabs are established) if there is a conflicting grab for any +combination\&. XGrabDeviceButton has no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGrabDeviceButton can generate BadClass, BadDevice, BadMatch, +BadValue, and BadWindow errors\&.\&.P The XUngrabDeviceButton +request releases the passive grab for a button/modifier +combination on the specified window if it was grabbed by this +client\&. A modifier of AnyModifier is equivalent to issuing the +ungrab request for all possible modifier combinations, +including the combination of no modifiers\&. A button of +AnyButton is equivalent to issuing the request for all possible +buttons\&. XUngrabDeviceButton has no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A modifier_device of NULL indicates that the X keyboard should +be used as the modifier_device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XUngrabDeviceButton can generate BadDevice, BadMatch, BadValue +and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGrabDeviceButton request was + made specifying a device that has no buttons, or + specifying a modifier device that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceKey(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGrabDeviceButton.txt b/man/XGrabDeviceButton.txt new file mode 100644 index 0000000..aae0245 --- /dev/null +++ b/man/XGrabDeviceButton.txt @@ -0,0 +1,170 @@ +XGRABDEVICEBUTTON(libmansuffix) +=============================== + +NAME +---- + + XGrabDeviceButton, XUngrabDeviceButton - grab/ungrab extension + input device buttons + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XGrabDeviceButton( Display *display, + XDevice *device, + unsigned int button, + unsigned int modifiers, + XDevice* modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode); + + int XUngrabDeviceButton( Display *display, + XDevice *device, + unsigned int button, + unsigned int modifiers, + XDevice* modifier_device, + Window grab_window); + + display + Specifies the connection to the X server. + + device + Specifies the device that is to be grabbed or released + + button + Specifies the device button that is to be grabbed or + released or AnyButton. + + modifiers + Specifies the set of keymasks or AnyModifier.The mask is + the bitwise inclusive OR of the valid keymask bits. + Valid bits are: Shiftmask, LockMask, ControlMask, + Mod1Mask, Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask. + + modifier_device + specifies the device whose modifiers are to be used. If + the modifier_devicespecified is NULL, the X keyboard + will be used as the modifier_device. + + grab_window + Specifies the grab window. + + owner_events + Specifies a Boolean value that indicates whether the + deviceevents are to be reported as usual or reported + with respect to the grab windowif selected by the event + list. + + event_count + Specifies the number of event classes in the event list. + + event_list + Specifies which events are reported to the client. + + this_device_mode + Specifies further processing of events from this + device.You can pass GrabModeSync or GrabModeAsync. + + other_devices_mode + Specifies further processing of events from all other + devices.You can pass GrabModeSync or GrabModeAsync. + +DESCRIPTION +----------- + + The XGrabDeviceButton request establishes a passive grab. In + the future, the device is actively grabbed (as for XGrabDevice, + the last-grab time is set to the time at which the button was + pressed (as transmitted in the DeviceButtonPress event), and + the DeviceButtonPress event is reported if all of the following + conditions are true: + * The device is not grabbed, and the specified button is + logically pressed when the specified modifier keys are + logically down on the specified modifier device and no + other buttons or modifier keys are logically down. + * Either the grab window is an ancestor of (or is) the focus + window, OR the grab window is a descendent of the focus + window and contains the device. + * A passive grab on the same button/modifier combination does + not exist on any ancestor of grab_window. + + The interpretation of the remaining arguments is as for + XGrabDevice. The active grab is terminated automatically when + the logical state of the device has all buttons released + (independent of the logical state of the modifier keys). + + Note that the logical state of a device (as seen by client + applications) may lag the physical state if device event + processing is frozen. + + This request overrides all previous grabs by the same client on + the same button/modifier combinations on the same window. A + modifiers of AnyModifier is equivalent to issuing the grab + request for all possible modifier combinations (including the + combination of no modifiers). It is not required that all + modifiers specified have currently assigned KeyCodes. A button + of AnyButton is equivalent to issuing the request for all + possible buttons. Otherwise, it is not required that the + specified button currently be assigned to a physical button. + + A modifier_device of NULL indicates that the X keyboard is to + be used as the modifier_device. + + If some other client has already issued a XGrabDeviceButton + with the same button/modifier combination on the same window, a + BadAccess error results. When using AnyModifier or AnyButton , + the request fails completely, and a BadAccess error results (no + grabs are established) if there is a conflicting grab for any + combination. XGrabDeviceButton has no effect on an active grab. + + XGrabDeviceButton can generate BadClass, BadDevice, BadMatch, + BadValue, and BadWindow errors..P The XUngrabDeviceButton + request releases the passive grab for a button/modifier + combination on the specified window if it was grabbed by this + client. A modifier of AnyModifier is equivalent to issuing the + ungrab request for all possible modifier combinations, + including the combination of no modifiers. A button of + AnyButton is equivalent to issuing the request for all possible + buttons. XUngrabDeviceButton has no effect on an active grab. + + A modifier_device of NULL indicates that the X keyboard should + be used as the modifier_device. + + XUngrabDeviceButton can generate BadDevice, BadMatch, BadValue + and BadWindow errors. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGrabDeviceButton request was + made specifying a device that has no buttons, or + specifying a modifier device that has no keys. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + +SEE ALSO +-------- + + XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceKey(libmansuffix) diff --git a/man/XGrabDeviceKey.man b/man/XGrabDeviceKey.man new file mode 100644 index 0000000..4fefaaa --- /dev/null +++ b/man/XGrabDeviceKey.man @@ -0,0 +1,348 @@ +'\" t +.\" Title: xgrabdevicekey +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XGRABDEVICEKEY" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XGrabDeviceKey, XUngrabDeviceKey \- grab/ungrab extension input device Keys +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XGrabDeviceKey( Display *display, + XDevice *device, + unsigned int key, + unsigned int modifiers, + XDevice *modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode); +.fi +.sp +.nf +int XUngrabDeviceKey( Display *display, + XDevice *device, + unsigned int key, + unsigned int modifiers, + XDevice *modifier_device, + Window grab_window); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device that is to be grabbed or released\&. +.fi +.sp +.nf +Key + Specifies the device Key that is to be grabbed released + or AnyKey\&. +.fi +.sp +.nf +modifiers + Specifies the set of keymasks or AnyModifier\&.The mask is + the bitwise inclusive OR of the valid keymask bits\&.Valid + bits are: ShiftMask, LockMask, ControlMask, Mod1Mask, + Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask\&. +.fi +.sp +.nf +modifier_device + Specifies the device whose modifiers are to be used\&. If + a modifier_device ofNULL is specified, the X keyboard + will be used as the modifier_device\&. +.fi +.sp +.nf +grab_window + Specifies the grab window\&. +.fi +.sp +.nf +owner_events + Specifies a Boolean value that indicates whether the + deviceevents are to be reported as usual or reported + with respect to the grab windowif selected by the event + list\&. +.fi +.sp +.nf +event_count + Specifies the number of event classes in the event list\&. +.fi +.sp +.nf +event_list + Specifies which device events are reported to the + client\&. +.fi +.sp +.nf +this_device_mode + Specifies further processing of events from this + device\&.You can pass GrabModeSync or GrabModeAsync\&. +.fi +.sp +.nf +other_devices_mode + Specifies further processing of events from other + devices\&.You can pass GrabModeSyncor GrabModeAsync\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGrabDeviceKey request establishes a passive grab\&. In the +future, the device is actively grabbed (as for XGrabDevice, the +last\-device\-grab time is set to the time at which the Key was +pressed (as transmitted in the DeviceKeyPress event), and the +DeviceKeyPress event is reported if all of the following +conditions are true: + * The device is not grabbed, and the specified key is + logically pressed when the specified modifier keys are + logically down, and no other keys or modifier keys are + logically down\&. + * The grab_window is an ancestor (or is) the focus window OR + the grab window is a descendant of the focus window and + contains the device\&. + * The confine_to window (if any) is viewable\&. + * A passive grab on the same key/modifier combination does + not exist on any ancestor of grab_window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The interpretation of the remaining arguments is as for +XGrabDevice\&. The active grab is terminated automatically when +the logical state of the device has the specified key released\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Note that the logical state of a device (as seen by means of +the X protocol ) may lag the physical state if device event +processing is frozen\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the key is not AnyKey, it must be in the range specified by +min_keycode and max_keycode as returned by the +XListInputDevices request\&. Otherwise, a BadValue error results\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This request overrides all previous grabs by the same client on +the same Key/modifier combinations on the same window\&. A +modifier of AnyModifier is equivalent to issuing the grab +request for all possible modifier combinations (including the +combination of no modifiers)\&. It is not required that all +modifiers specified have currently assigned KeyCodes\&. A key of +AnyKey is equivalent to issuing the request for all possible +keys\&. Otherwise, it is not required that the specified key +currently be assigned to a physical Key\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If a modifier_device of NULL is specified, the X keyboard will +be used as the modifier_device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If some other client has already issued a XGrabDeviceKey with +the same Key/modifier combination on the same window, a +BadAccess error results\&. When using AnyModifier or AnyKey, the +request fails completely, and a BadAccess error results (no +grabs are established) if there is a conflicting grab for any +combination\&.XGrabDeviceKey has no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGrabDeviceKey can generate BadAccess, BadClass, BadDevice, +BadMatch, BadValue, and BadWindow errors\&. It returns Success on +successful completion of the request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XUngrabDeviceKey request releases the passive grab for a +key/modifier combination on the specified window if it was +grabbed by this client\&. A modifier of AnyModifier is equivalent +to issuing the ungrab request for all possible modifier +combinations, including the combination of no modifiers\&. A Key +of AnyKey is equivalent to issuing the request for all possible +Keys\&.XUngrabDeviceKey has no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If a modifier_device of NULL is specified, the X keyboard will +be used as the modifier_device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XUngrabDeviceKey can generate BadDevice, BadMatch, BadValue and +BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGrabDeviceKey request was + made specifying a device that has no keys, or a modifier + device that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceButton(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XGrabDeviceKey.txt b/man/XGrabDeviceKey.txt new file mode 100644 index 0000000..bee4c47 --- /dev/null +++ b/man/XGrabDeviceKey.txt @@ -0,0 +1,177 @@ +XGRABDEVICEKEY(libmansuffix) +============================ + +NAME +---- + + XGrabDeviceKey, XUngrabDeviceKey - grab/ungrab extension input + device Keys + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XGrabDeviceKey( Display *display, + XDevice *device, + unsigned int key, + unsigned int modifiers, + XDevice *modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode); + + int XUngrabDeviceKey( Display *display, + XDevice *device, + unsigned int key, + unsigned int modifiers, + XDevice *modifier_device, + Window grab_window); + + display + Specifies the connection to the X server. + + device + Specifies the device that is to be grabbed or released. + + Key + Specifies the device Key that is to be grabbed released + or AnyKey. + + modifiers + Specifies the set of keymasks or AnyModifier.The mask is + the bitwise inclusive OR of the valid keymask bits.Valid + bits are: ShiftMask, LockMask, ControlMask, Mod1Mask, + Mod2Mask,Mod3Mask, Mod4Mask, Mod5Mask. + + modifier_device + Specifies the device whose modifiers are to be used. If + a modifier_device ofNULL is specified, the X keyboard + will be used as the modifier_device. + + grab_window + Specifies the grab window. + + owner_events + Specifies a Boolean value that indicates whether the + deviceevents are to be reported as usual or reported + with respect to the grab windowif selected by the event + list. + + event_count + Specifies the number of event classes in the event list. + + event_list + Specifies which device events are reported to the + client. + + this_device_mode + Specifies further processing of events from this + device.You can pass GrabModeSync or GrabModeAsync. + + other_devices_mode + Specifies further processing of events from other + devices.You can pass GrabModeSyncor GrabModeAsync. + +DESCRIPTION +----------- + + The XGrabDeviceKey request establishes a passive grab. In the + future, the device is actively grabbed (as for XGrabDevice, the + last-device-grab time is set to the time at which the Key was + pressed (as transmitted in the DeviceKeyPress event), and the + DeviceKeyPress event is reported if all of the following + conditions are true: + * The device is not grabbed, and the specified key is + logically pressed when the specified modifier keys are + logically down, and no other keys or modifier keys are + logically down. + * The grab_window is an ancestor (or is) the focus window OR + the grab window is a descendant of the focus window and + contains the device. + * The confine_to window (if any) is viewable. + * A passive grab on the same key/modifier combination does + not exist on any ancestor of grab_window. + + The interpretation of the remaining arguments is as for + XGrabDevice. The active grab is terminated automatically when + the logical state of the device has the specified key released. + + Note that the logical state of a device (as seen by means of + the X protocol ) may lag the physical state if device event + processing is frozen. + + If the key is not AnyKey, it must be in the range specified by + min_keycode and max_keycode as returned by the + XListInputDevices request. Otherwise, a BadValue error results. + + This request overrides all previous grabs by the same client on + the same Key/modifier combinations on the same window. A + modifier of AnyModifier is equivalent to issuing the grab + request for all possible modifier combinations (including the + combination of no modifiers). It is not required that all + modifiers specified have currently assigned KeyCodes. A key of + AnyKey is equivalent to issuing the request for all possible + keys. Otherwise, it is not required that the specified key + currently be assigned to a physical Key. + + If a modifier_device of NULL is specified, the X keyboard will + be used as the modifier_device. + + If some other client has already issued a XGrabDeviceKey with + the same Key/modifier combination on the same window, a + BadAccess error results. When using AnyModifier or AnyKey, the + request fails completely, and a BadAccess error results (no + grabs are established) if there is a conflicting grab for any + combination.XGrabDeviceKey has no effect on an active grab. + + XGrabDeviceKey can generate BadAccess, BadClass, BadDevice, + BadMatch, BadValue, and BadWindow errors. It returns Success on + successful completion of the request. + + The XUngrabDeviceKey request releases the passive grab for a + key/modifier combination on the specified window if it was + grabbed by this client. A modifier of AnyModifier is equivalent + to issuing the ungrab request for all possible modifier + combinations, including the combination of no modifiers. A Key + of AnyKey is equivalent to issuing the request for all possible + Keys.XUngrabDeviceKey has no effect on an active grab. + + If a modifier_device of NULL is specified, the X keyboard will + be used as the modifier_device. + + XUngrabDeviceKey can generate BadDevice, BadMatch, BadValue and + BadWindow errors. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGrabDeviceKey request was + made specifying a device that has no keys, or a modifier + device that has no keys. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + +SEE ALSO +-------- + + XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceButton(libmansuffix) diff --git a/man/XIChangeHierarchy.man b/man/XIChangeHierarchy.man new file mode 100644 index 0000000..6b16e5e --- /dev/null +++ b/man/XIChangeHierarchy.man @@ -0,0 +1,299 @@ +'\" t +.\" Title: xichangehierarchy +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XICHANGEHIERARCHY" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIChangeHierarchy \- change the device hierarchy\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Status XIChangeHierarchy( Display *display, + XIAnyHierarchyChangeInfo *changes, + int num_changes); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +num_changes + Specifies the number of elements in changes\&. +.fi +.sp +.nf +changes + Specifies the changes to be made\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIChangeHierarchy modifies the device hierarchy by creating or +removing master devices or changing the attachment of slave +devices\&. If num_changes is non\-zero, changes is an array of +XIAnyHierarchyChangeInfo structures\&. If num_changes is equal or less than +zero, XIChangeHierarchy does nothing\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIChangeHierarchy processes changes in order, effective +immediately\&. If an error occurs, processing is aborted and the +error is reported to the client\&. Changes already made remain +effective\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The list of changes is any combination of +XIAnyHierarchyChangeInfo\&. The type of a hierarchy change can be +XIAddMaster, XIRemoveMaster, XIAttachSlave or XIDetachSlave\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef union { + int type; + XIAddMasterInfo add; + XIRemoveMasterInfo remove; + XIAttachSlave attach; + XIDetachSlave detach; +} XIAnyHierarchyChangeInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int type; /* XIAddMaster */ + char* name; + Bool send_core; + Bool enable; +} XIAddMasterInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int type; /* XIRemoveMaster */ + int deviceid; + int return_mode; + int return_pointer; + int return_keyboard; +} XIRemoveMasterInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int type; /* XIAttachSlave */ + int deviceid; + int new_master; +} XIAttachSlaveInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int type; /* XIDetachSlave */ + int deviceid; +} XIDetachSlaveInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAddMasterInfo creates a new master pointer and a new +master keyboard labelled "name pointer" and "name keyboard" +respectively\&. If sendCore is True, the devices will send core +events\&. If enable is True, the device is enabled immediately\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAddMasterInfo can generate a BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIRemoveMasterInfo removes device and its paired master device\&. +If returnMode is XIAttachToMaster, all pointers attached to +device or its paired master device are attached to +returnPointer\&. Likewise, all keyboards are attached to +returnKeyboard\&. If returnMode is XIFloating, all attached +devices are set to floating\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIRemoveMasterInfo can generate a BadValue and a BadDevice +error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAttachSlaveInfo attaches device to newMaster\&. If the device +is currently attached to a master device, it is detached from +the master device and attached to the new master device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAttachSlaveInfo can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIDettachSlaveInfo deattaches device from the current master +device and sets it floating\&. If the device is already floating, +no changes are made\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIDetachSlaveInfo can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIChangeHierarchy generates an XIHierarchyEvent if any +modifications were successful\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a appropriate for the type of change\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls out of the allowed range\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIChangeHierarchy.txt b/man/XIChangeHierarchy.txt new file mode 100644 index 0000000..205f40f --- /dev/null +++ b/man/XIChangeHierarchy.txt @@ -0,0 +1,120 @@ +XICHANGEHIERARCHY(libmansuffix) +=============================== + +NAME +---- + + XIChangeHierarchy - change the device hierarchy. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Status XIChangeHierarchy( Display *display, + XIAnyHierarchyChangeInfo *changes, + int num_changes); + + display + Specifies the connection to the X server. + + num_changes + Specifies the number of elements in changes. + + changes + Specifies the changes to be made. + +DESCRIPTION +----------- + + XIChangeHierarchy modifies the device hierarchy by creating or + removing master devices or changing the attachment of slave + devices. If num_changes is non-zero, changes is an array of + XIAnyHierarchyChangeInfo structures. If num_changes is equal or less than + zero, XIChangeHierarchy does nothing. + + XIChangeHierarchy processes changes in order, effective + immediately. If an error occurs, processing is aborted and the + error is reported to the client. Changes already made remain + effective. + + The list of changes is any combination of + XIAnyHierarchyChangeInfo. The type of a hierarchy change can be + XIAddMaster, XIRemoveMaster, XIAttachSlave or XIDetachSlave. + + typedef union { + int type; + XIAddMasterInfo add; + XIRemoveMasterInfo remove; + XIAttachSlave attach; + XIDetachSlave detach; + } XIAnyHierarchyChangeInfo; + + typedef struct { + int type; /* XIAddMaster */ + char* name; + Bool send_core; + Bool enable; + } XIAddMasterInfo; + + typedef struct { + int type; /* XIRemoveMaster */ + int deviceid; + int return_mode; + int return_pointer; + int return_keyboard; + } XIRemoveMasterInfo; + + typedef struct { + int type; /* XIAttachSlave */ + int deviceid; + int new_master; + } XIAttachSlaveInfo; + + typedef struct { + int type; /* XIDetachSlave */ + int deviceid; + } XIDetachSlaveInfo; + + XIAddMasterInfo creates a new master pointer and a new + master keyboard labelled "name pointer" and "name keyboard" + respectively. If sendCore is True, the devices will send core + events. If enable is True, the device is enabled immediately. + + XIAddMasterInfo can generate a BadValue error. + + XIRemoveMasterInfo removes device and its paired master device. + If returnMode is XIAttachToMaster, all pointers attached to + device or its paired master device are attached to + returnPointer. Likewise, all keyboards are attached to + returnKeyboard. If returnMode is XIFloating, all attached + devices are set to floating. + + XIRemoveMasterInfo can generate a BadValue and a BadDevice + error. + + XIAttachSlaveInfo attaches device to newMaster. If the device + is currently attached to a master device, it is detached from + the master device and attached to the new master device. + + XIAttachSlaveInfo can generate a BadDevice error. + + XIDettachSlaveInfo deattaches device from the current master + device and sets it floating. If the device is already floating, + no changes are made. + + XIDetachSlaveInfo can generate a BadDevice error. + + XIChangeHierarchy generates an XIHierarchyEvent if any + modifications were successful. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist or is not a appropriate for the type of change. + + BadValue + Some numeric value falls out of the allowed range. + diff --git a/man/XIChangeProperty.man b/man/XIChangeProperty.man new file mode 100644 index 0000000..25406b7 --- /dev/null +++ b/man/XIChangeProperty.man @@ -0,0 +1,281 @@ +'\" t +.\" Title: xichangeproperty +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/21/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XICHANGEPROPERTY" "libmansuffix" "12/21/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIChangeProperty, XIGetProperty, XIDeleteProperty \- change, retrieve or delete a device\*(Aqs property\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +void XIChangeProperty( Display* dpy, + int deviceid, + Atom property, + Atom type, + int format, + int mode, + unsigned char *data, + int num_items) +.fi +.sp +.nf +void XIDeleteProperty( Display *dpy, + int deviceid, + Atom property) +.fi +.sp +.nf +Status XIGetProperty( Display *dpy, + int deviceid, + Atom property, + long offset, + long length, + Bool delete_property, + Atom type, + Atom *type_return, + int *format_return, + unsigned long *num_items_return, + unsigned long *bytes_after_return, + unsigned char **data) +.fi +.sp +.nf +bytes_after_return + Returns the number of bytes remaining to be read in the prop\- + erty if a partial read was performed\&. +.fi +.sp +.nf +data + Specifies the property data\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +delete_property + Specifies a Boolean value that determines whether the property + is to be deleted\&. +.fi +.sp +.nf +deviceid + The device to list the properties for\&. +.fi +.sp +.nf +format + Specifies whether the data should be viewed as a list of + 8\-bit, 16\-bit, or 32\-bit quantities\&. Possible values are 8, + 16, and 32\&. This information allows the X server to correctly + perform byte\-swap operations as necessary\&. If the + format is 16\-bit or 32\-bit, you must explicitly cast your + data pointer to an (unsigned char *) in the call to + XIChangeProperty\&. +.fi +.sp +.nf +format_return + Returns the actual format of the property\&. +.fi +.sp +.nf +length + Specifies the length in 32\-bit multiples of the data to be + retrieved\&. +.fi +.sp +.nf +offset + Specifies the offset in the specified property (in 32\-bit + quantities) where the data is to be retrieved\&. +.fi +.sp +.nf +mode + One of XIPropModeAppend, XIPropModePrepend or XIPropModeReplace\&. +.fi +.sp +.nf +num_items + Number of items in data in the format specified\&. +.fi +.sp +.nf +nitems_return + Returns the actual number of 8\-bit, 16\-bit, or 32\-bit items + stored in data\&. +.fi +.sp +.nf +property + Specifies the property name\&. +.fi +.sp +.nf +type + Specifies the type of the property\&. The X server does not + interpret the type but simply passes it back to an application + that later calls XIGetProperty\&. +.fi +.sp +.nf +type_return + Returns the atom identifier that defines the actual type of + the property\&. +.fi +.SH "DESCRIPTION" +.sp +The XIGetProperty function returns the actual type of the property; the actual format of the property; the number of 8\-bit, 16\-bit, or 32\-bit items transferred; the number of bytes remaining to be read in the property; and a pointer to the data actually returned\&. XIGetProperty sets the return arguments as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If the specified property does not exist for the specified device, XIGetProperty returns None to actual_type_return and the value zero to actual_format_return and bytes_after_return\&. The nitems_return argument is empty\&. In this case, the delete argument is ignored\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If the specified property exists but its type does not match the specified type, XIGetProperty returns the actual property type to actual_type_return, the actual property format (never zero) to actual_format_return, and the property length in bytes (even if the actual_format_return is 16 or 32) to bytes_after_return\&. It also ignores the delete argument\&. The nitems_return argument is empty\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If the specified property exists and either you assign XIAnyPropertyType to the req_type argument or the specified type matches the actual property type, XIGetProperty returns the actual property type to actual_type_return and the actual property format (never zero) to actual_format_return\&. It also returns a value to bytes_after_return and nitems_return, by defining the following values: +.sp +.if n \{\ +.RS 4 +.\} +.nf +N = length of the stored property in bytes +I = 4 * offset +T = N \- I +L = MINIMUM(T, 4 * length) +A = N \- (I + L) +.fi +.if n \{\ +.RE +.\} +.RE +.sp +The returned value starts at byte index I in the property (indexing from zero), and its length in bytes is L\&. If the value for long_offset causes L to be negative, a BadValue error results\&. The value of bytes_after_return is A, giving the number of trailing unread bytes in the stored property\&. +.sp +If the returned format is 8, the returned data is represented as a char array\&. If the returned format is 16, the returned data is represented as a uint16_t array and should be cast to that type to obtain the ele\- ments\&. If the returned format is 32, the returned data is represented as a uint32_t array and should be cast to that type to obtain the elements\&. +.sp +XIGetProperty always allocates one extra byte in prop_return (even if the property is zero length) and sets it to zero so that simple properties consisting of characters do not have to be copied into yet another string before use\&. +.sp +If delete is True and bytes_after_return is zero, XIGetProperty deletes the property from the window and generates an XIPropertyNotify event on the window\&. +.sp +The function returns Success if it executes successfully\&. To free the resulting data, use XFree\&. +.sp +XIGetProperty can generate BadAtom, BadValue, and BadWindow errors\&. +.sp +The XIChangeProperty function alters the property for the specified device and causes the X server to generate a XIPropertyNotify event for that device\&. XIChangeProperty performs the following: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If mode is XIPropModeReplace, XIChangeProperty discards the previous property value and stores the new data\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If mode is XIPropModePrepend or XIPropModeAppend, XIChangeProperty inserts the specified data before the beginning of the existing data or onto the end of the existing data, respectively\&. The type and format must match the existing property value, or a BadMatch error results\&. If the property is undefined, it is treated as defined with the correct type and format with zero\-length data\&. +.RE +.sp +If the specified format is 8, the property data must be a char array\&. If the specified format is 16, the property data must be a uint16_t array\&. If the specified format is 32, the property data must be a uint32_t array\&. +.sp +The lifetime of a property is not tied to the storing client\&. Properties remain until explicitly deleted, until the device is removed, or until the server resets\&. The maximum size of a property is server dependent and can vary dynamically depending on the amount of memory the server has available\&. (If there is insufficient space, a BadAlloc error results\&.) +.sp +XIChangeProperty can generate BadAlloc, BadAtom, BadMatch, BadValue, and BadDevice errors\&. +.sp +The XIDeleteProperty function deletes the specified property only if the property was defined on the specified device and causes the X server to generate a XIPropertyNotify event for the device unless the property does not exist\&. +.sp +XIDeleteProperty can generate BadAtom and BadDevice errors\&. +.SH "DIAGNOSTICS" +.sp +BadAlloc The server failed to allocate the requested resource or server memory\&. +.sp +BadAtom A value for an Atom argument does not name a defined Atom\&. +.sp +BadValue Some numeric value falls outside the range of values accepted by the request\&. Unless a specific range is specified for an argument, the full range defined by the argument\(cqs type is accepted\&. Any argument defined as a set of alternatives can generate this error\&. +.sp +BadDevice An invalid device was specified\&. The device does not exist\&. +.sp +BadAtom An invalid property was specified\&. The property does not exist\&. +.SH "BUGS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The protocol headers for XI 2\&.0 did not provide +XIAnyPropertyType, XIPropModeReplace, XIPropModePrepend or +XIPropModeAppend\&. Use AnyPropertyType, PropModeReplace, +PropModePrepend and PropModeAppend instead, respectively\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +XIListProperties(libmansuffix) diff --git a/man/XIChangeProperty.txt b/man/XIChangeProperty.txt new file mode 100644 index 0000000..b35d90f --- /dev/null +++ b/man/XIChangeProperty.txt @@ -0,0 +1,235 @@ +XICHANGEPROPERTY(libmansuffix) +============================== + +NAME +---- + + XIChangeProperty, XIGetProperty, XIDeleteProperty - change, retrieve + or delete a device's property. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + void XIChangeProperty( Display* dpy, + int deviceid, + Atom property, + Atom type, + int format, + int mode, + unsigned char *data, + int num_items) + + void XIDeleteProperty( Display *dpy, + int deviceid, + Atom property) + + Status XIGetProperty( Display *dpy, + int deviceid, + Atom property, + long offset, + long length, + Bool delete_property, + Atom type, + Atom *type_return, + int *format_return, + unsigned long *num_items_return, + unsigned long *bytes_after_return, + unsigned char **data) + + bytes_after_return + Returns the number of bytes remaining to be read in the prop- + erty if a partial read was performed. + + data + Specifies the property data. + + display + Specifies the connection to the X server. + + delete_property + Specifies a Boolean value that determines whether the property + is to be deleted. + + deviceid + The device to list the properties for. + + format + Specifies whether the data should be viewed as a list of + 8-bit, 16-bit, or 32-bit quantities. Possible values are 8, + 16, and 32. This information allows the X server to correctly + perform byte-swap operations as necessary. If the + format is 16-bit or 32-bit, you must explicitly cast your + data pointer to an (unsigned char *) in the call to + XIChangeProperty. + + format_return + Returns the actual format of the property. + + length + Specifies the length in 32-bit multiples of the data to be + retrieved. + + offset + Specifies the offset in the specified property (in 32-bit + quantities) where the data is to be retrieved. + + mode + One of XIPropModeAppend, XIPropModePrepend or XIPropModeReplace. + + num_items + Number of items in data in the format specified. + + nitems_return + Returns the actual number of 8-bit, 16-bit, or 32-bit items + stored in data. + + property + Specifies the property name. + + type + Specifies the type of the property. The X server does not + interpret the type but simply passes it back to an application + that later calls XIGetProperty. + + type_return + Returns the atom identifier that defines the actual type of + the property. + +DESCRIPTION +----------- + +The XIGetProperty function returns the actual type of the property; +the actual format of the property; the number of 8-bit, 16-bit, +or 32-bit items transferred; the number of bytes remaining to be read +in the property; and a pointer to the data actually returned. +XIGetProperty sets the return arguments as follows: + + - If the specified property does not exist for the specified device, + XIGetProperty returns None to actual_type_return and the + value zero to actual_format_return and bytes_after_return. The + nitems_return argument is empty. In this case, the delete argument + is ignored. + + - If the specified property exists but its type does not match the + specified type, XIGetProperty returns the actual property + type to actual_type_return, the actual property format (never + zero) to actual_format_return, and the property length in bytes + (even if the actual_format_return is 16 or 32) to + bytes_after_return. It also ignores the delete argument. The + nitems_return argument is empty. + + - If the specified property exists and either you assign + XIAnyPropertyType to the req_type argument or the specified type + matches the actual property type, XIGetProperty returns the + actual property type to actual_type_return and the actual property + format (never zero) to actual_format_return. It also returns a value + to bytes_after_return and nitems_return, by defining the following + values: + + N = length of the stored property in bytes + I = 4 * offset + T = N - I + L = MINIMUM(T, 4 * length) + A = N - (I + L) + +The returned value starts at byte index I in the property +(indexing from zero), and its length in bytes is L. If the value +for long_offset causes L to be negative, a BadValue error results. +The value of bytes_after_return is A, giving the number of trailing +unread bytes in the stored property. + +If the returned format is 8, the returned data is represented as a char +array. If the returned format is 16, the returned data is represented +as a uint16_t array and should be cast to that type to obtain the ele- +ments. If the returned format is 32, the returned data is represented +as a uint32_t array and should be cast to that type to obtain the elements. + +XIGetProperty always allocates one extra byte in prop_return (even +if the property is zero length) and sets it to zero so that simple +properties consisting of characters do not have to be copied into yet +another string before use. + +If delete is True and bytes_after_return is zero, XIGetProperty +deletes the property from the window and generates an XIPropertyNotify +event on the window. + +The function returns Success if it executes successfully. To free the +resulting data, use XFree. + +XIGetProperty can generate BadAtom, BadValue, and BadWindow +errors. + +The XIChangeProperty function alters the property for the specified device +and causes the X server to generate a XIPropertyNotify event for that +device. XIChangeProperty performs the following: + +- If mode is XIPropModeReplace, XIChangeProperty discards the previous + property value and stores the new data. + +- If mode is XIPropModePrepend or XIPropModeAppend, XIChangeProperty + inserts the specified data before the beginning of the existing + data or onto the end of the existing data, respectively. The type + and format must match the existing property value, or a BadMatch + error results. If the property is undefined, it is treated as + defined with the correct type and format with zero-length data. + +If the specified format is 8, the property data must be a char array. +If the specified format is 16, the property data must be a uint16_t array. +If the specified format is 32, the property data must be a uint32_t array. + +The lifetime of a property is not tied to the storing client. +Properties remain until explicitly deleted, until the device is removed, +or until the server resets. The maximum size of a property is server +dependent and can vary dynamically depending on the amount of memory +the server has available. (If there is insufficient space, a BadAlloc +error results.) + +XIChangeProperty can generate BadAlloc, BadAtom, BadMatch, BadValue, and +BadDevice errors. + +The XIDeleteProperty function deletes the specified property only if the +property was defined on the specified device and causes the X server to +generate a XIPropertyNotify event for the device unless the property does +not exist. + +XIDeleteProperty can generate BadAtom and BadDevice errors. + + +DIAGNOSTICS +----------- +BadAlloc + The server failed to allocate the requested resource or + server memory. + +BadAtom + A value for an Atom argument does not name a defined Atom. + +BadValue + Some numeric value falls outside the range of values accepted + by the request. Unless a specific range is specified for an + argument, the full range defined by the argument’s type is + accepted. Any argument defined as a set of alternatives can + generate this error. + +BadDevice + An invalid device was specified. The device does not + exist. + +BadAtom + An invalid property was specified. The property does not + exist. + +BUGS +---- + + The protocol headers for XI 2.0 did not provide + XIAnyPropertyType, XIPropModeReplace, XIPropModePrepend or + XIPropModeAppend. Use AnyPropertyType, PropModeReplace, + PropModePrepend and PropModeAppend instead, respectively. + +SEE ALSO +-------- + +XIListProperties(libmansuffix) diff --git a/man/XIDefineCursor.man b/man/XIDefineCursor.man new file mode 100644 index 0000000..9cfff6a --- /dev/null +++ b/man/XIDefineCursor.man @@ -0,0 +1,190 @@ +'\" t +.\" Title: xidefinecursor +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIDEFINECURSOR" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIDefineCursor, XIUndefineCursor \- define device cursors\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +int XIDefineCursor( Display *display, + int deviceid, + Window win, + Cursor cursor); +.fi +.sp +.nf +int XIUndefineCursor( Display *display, + int deviceid, + Window win); +.fi +.sp +.nf +cursor + Specifies the cursor that is to be displayed or None\&. +.fi +.sp +.nf +deviceid + Specifies the device whose cursor is to change\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +win + Specifies the window\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +If a cursor is set, it will be used when the device\*(Aqs pointer +is in the window\&. If the cursor is None, it is equivalent to +XIUndefineCursor\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The deviceid must be a master pointer device or a BadDevice error is +returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIDefineCursor can generate BadDevice, BadCursor and BadWindow\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIUndefineCursor function undoes the effect of a previous +XIDefineCursor for this window\&. When the pointer is in the +window, the window\*(Aqs default cursor will now be used\&. If no +default cursor is defined, the parent\*(Aqs cursor for this device +will be used (if defined) or the parent\*(Aqs default cursor will +be used\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIDefineCursor and XIUndefineCursor are identical to +XDefineCursor and XUndefineCursor but specify the device +explicitly\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUndefineCursor can generate a BadDevice and a BadWindow +error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadCursor + A value for a cursor argument does not name a defined + cursor\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} +.sp +See also +.sp +.if n \{\ +.RS 4 +.\} +.nf +XDefineCursor, XUndefineCursor +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIDefineCursor.txt b/man/XIDefineCursor.txt new file mode 100644 index 0000000..992aeaa --- /dev/null +++ b/man/XIDefineCursor.txt @@ -0,0 +1,79 @@ +XIDEFINECURSOR(libmansuffix) +============================ + +NAME +---- + + XIDefineCursor, XIUndefineCursor - define device cursors. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + int XIDefineCursor( Display *display, + int deviceid, + Window win, + Cursor cursor); + + int XIUndefineCursor( Display *display, + int deviceid, + Window win); + + cursor + Specifies the cursor that is to be displayed or None. + + deviceid + Specifies the device whose cursor is to change. + + display + Specifies the connection to the X server. + + win + Specifies the window. + +DESCRIPTION +----------- + + If a cursor is set, it will be used when the device's pointer + is in the window. If the cursor is None, it is equivalent to + XIUndefineCursor. + + The deviceid must be a master pointer device or a BadDevice error is + returned. + + XIDefineCursor can generate BadDevice, BadCursor and BadWindow. + + The XIUndefineCursor function undoes the effect of a previous + XIDefineCursor for this window. When the pointer is in the + window, the window's default cursor will now be used. If no + default cursor is defined, the parent's cursor for this device + will be used (if defined) or the parent's default cursor will + be used. + + XIDefineCursor and XIUndefineCursor are identical to + XDefineCursor and XUndefineCursor but specify the device + explicitly. + + XIUndefineCursor can generate a BadDevice and a BadWindow + error. + +DIAGNOSTICS +----------- + + BadCursor + A value for a cursor argument does not name a defined + cursor. + + BadDevice + An invalid device was specified. The device does not + exist or is not a pointer device. + + BadWindow + A value for a Window argument does not name a defined + window. + +See also + + XDefineCursor, XUndefineCursor + diff --git a/man/XIDeleteProperty.man b/man/XIDeleteProperty.man new file mode 100644 index 0000000..849e4f6 --- /dev/null +++ b/man/XIDeleteProperty.man @@ -0,0 +1 @@ +.so XIChangeProperty.libmansuffix diff --git a/man/XIFreeDeviceInfo.man b/man/XIFreeDeviceInfo.man new file mode 100644 index 0000000..5f4f992 --- /dev/null +++ b/man/XIFreeDeviceInfo.man @@ -0,0 +1 @@ +.so XIQueryDevice.libmansuffix diff --git a/man/XIGetClientPointer.man b/man/XIGetClientPointer.man new file mode 100644 index 0000000..9230bef --- /dev/null +++ b/man/XIGetClientPointer.man @@ -0,0 +1 @@ +.so XISetClientPointer.libmansuffix diff --git a/man/XIGetFocus.man b/man/XIGetFocus.man new file mode 100644 index 0000000..c5f54ca --- /dev/null +++ b/man/XIGetFocus.man @@ -0,0 +1 @@ +.so XISetFocus.libmansuffix diff --git a/man/XIGetProperty.man b/man/XIGetProperty.man new file mode 100644 index 0000000..849e4f6 --- /dev/null +++ b/man/XIGetProperty.man @@ -0,0 +1 @@ +.so XIChangeProperty.libmansuffix diff --git a/man/XIGetSelectedEvents.man b/man/XIGetSelectedEvents.man new file mode 100644 index 0000000..60b61fd --- /dev/null +++ b/man/XIGetSelectedEvents.man @@ -0,0 +1 @@ +.so XISelectEvents.libmansuffix diff --git a/man/XIGrabButton.man b/man/XIGrabButton.man new file mode 100644 index 0000000..adeda6d --- /dev/null +++ b/man/XIGrabButton.man @@ -0,0 +1,423 @@ +'\" t +.\" Title: xigrabbutton +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/22/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIGRABBUTTON" "libmansuffix" "12/22/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode \- grab/ungrab buttons or keys +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +int XIGrabButton( Display *display, + int deviceid, + int button, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); +.fi +.sp +.nf +int XIUngrabButton( Display *display, + int deviceid, + int button, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); +.fi +.sp +.nf +int XIGrabKeycode( Display *display, + int deviceid, + int keycode, + Window grab_window, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); +.fi +.sp +.nf +int XIUngrabKeycode( Display *display, + int deviceid, + int keycode, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); +.fi +.sp +.nf +int XIGrabTouchBegin( Display *display, + int deviceid, + Window grab_window, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); +.fi +.sp +.nf +int XIUngrabTouchBegin( Display *display, + int deviceid, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device that is to be grabbed or released +.fi +.sp +.nf +button + Specifies the device button that is to be grabbed or + released or XIAnyButton\&. +.fi +.sp +.nf +keycode + Specifies the keycode that is to be grabbed or released + or XIAnyKeycode\&. +.fi +.sp +.nf +num_modifiers + Number of elements in modifiers or modifiers_inout\&. +.fi +.sp +.nf +modifiers + Specifies the set of latched and base modifiers or + XIAnyModifier to ungrab\&. The data type is for + consistency with the respective grab request and the + status code of the XIGrabModifiers struct is ignored\&. +.fi +.sp +.nf +modifiers_inout + Specifies the set of latched and base modifiers or + XIAnyModifier to grab\&. Returns the modifiers that could + not be grabbed and their error code\&. +.fi +.sp +.nf +grab_window + Specifies the grab window\&. +.fi +.sp +.nf +owner_events + Specifies a Boolean value that indicates whether the are + to be reported as usual or reported with respect to the + grab window\&. +.fi +.sp +.nf +mask + Specifies the event mask\&. +.fi +.sp +.nf +grab_mode + Specifies further processing of events from this device\&. + You can pass XIGrabModeSync or XIGrabModeAsync\&. +.fi +.sp +.nf +paired_device_mode + Specifies further processing of events from the paired + master device\&. You can pass XIGrabModeSync or + XIGrabModeAsync\&. If deviceid specifies a floating slave + device, this parameter is ignored\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabButton, XIGrabKeycode and XIGrabTouchBegin establish a passive +grab\&. The modifier device for a button grab is the paired master device +if deviceid specifies a master pointer\&. Otherwise, the modifier +device is the device specified with deviceid\&. In the future, +the device is actively grabbed (as for XIGrabDevice, the +last\-grab time is set to the time at which the button or keycode +was pressed and the XI_ButtonPress or XI_KeyPress event is +reported if all of the following conditions are true: + * The device is not grabbed, and the specified button or + keycode is logically pressed or a touch event occurs when the + specified modifier keys are logically down on the modifier device + and no other buttons or modifier keys are logically down\&. + * Either the grab window is an ancestor of (or is) the focus + window, OR the grab window is a descendent of the focus + window and contains the device\&. + * A passive grab on the same button/modifier combination does + not exist on any ancestor of grab_window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The interpretation of the remaining arguments is as for +XIGrabDevice\&. The active grab is terminated automatically when +the logical state of the device has all buttons or keys +released (independent of the logical state of the modifier +keys)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is an attached slave device, the device is +automatically detached from the master device when the grab +activates and reattached to the same master device when the +grab deactivates\&. If the master device is removed while the +device is floating as a result of a grab, the device remains +floating once the grab deactivates\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Note that the logical state of a device (as seen by client +applications) may lag the physical state if device event +processing is frozen\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This request overrides all previous grabs by the same client on +the same button/modifier or keycode/modifier combinations on the +same window\&. A modifiers of XIAnyModifier is equivalent to +issuing the grab request for all possible modifier combinations +(including the combination of no modifiers)\&. It is not required +that all modifiers specified have currently assigned KeyCodes\&. +A button of XIAnyButton is equivalent to issuing the request +for all possible buttons\&. Otherwise, it is not required that +the specified button currently be assigned to a physical +button\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If some other client has already issued a XIGrabButton or +XIGrabKeycode with the same button/modifier or keycode/modifier +combination on the same window, a BadAccess error results\&. When +using XIAnyModifier or XIAnyButton , the request fails +completely, and a XIBadAccess error results (no grabs are +established) if there is a conflicting grab for any +combination\&. XIGrabButton and XIGrabKeycode have no effect on an +active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +On success, XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return 0; +If one or more modifier combinations could not be grabbed, +XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of +failed combinations and modifiers_inout contains the failed combinations +and their respective error codes\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabButton, XIGrabKeycode and XIGrabTouchBegin can generate BadClass, +BadDevice, BadMatch, BadValue, and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin release the +passive grab for a button/modifier, keycode/modifier or touch/modifier +combination on the specified window if it was grabbed by this client\&. A +modifier of XIAnyModifier is equivalent to issuing the ungrab request +for all possible modifier combinations, including the +combination of no modifiers\&. A button of XIAnyButton is +equivalent to issuing the request for all possible buttons\&. +XIUngrabButton and XIUngrabKeycode have no effect on an active +grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin can generate +BadDevice, BadMatch, BadValue and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "RETURN VALUE" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of +modifier combination that could not establish a passive grab\&. The +modifiers are returned in modifiers_inout, along with the respective +error for this modifier combination\&. If XIGrabButton, XIGrabKeycode +or XIGrabTouchBegin return zero, passive grabs with all requested +modifier combinations were established successfully\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid deviceid was specified\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if XIGrabButton specified a device + that has no buttons, or XIGrabKeycode specified a device + that has no keys, or XIGrabTouchBegin specified a device + that is not touch\-capable\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "BUGS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The protocol headers for XI 2\&.0 did not provide +XIGrabModeAsync or XIGrabModeSync\&. Use GrabModeSync and +GrabModeAsync instead, respectively\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAllowEvents(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIGrabButton.txt b/man/XIGrabButton.txt new file mode 100644 index 0000000..a046ac7 --- /dev/null +++ b/man/XIGrabButton.txt @@ -0,0 +1,238 @@ +XIGRABBUTTON(libmansuffix) +========================== + +NAME +---- + + XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode - + grab/ungrab buttons or keys + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + int XIGrabButton( Display *display, + int deviceid, + int button, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); + + int XIUngrabButton( Display *display, + int deviceid, + int button, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); + + int XIGrabKeycode( Display *display, + int deviceid, + int keycode, + Window grab_window, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); + + int XIUngrabKeycode( Display *display, + int deviceid, + int keycode, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); + + int XIGrabTouchBegin( Display *display, + int deviceid, + Window grab_window, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); + + int XIUngrabTouchBegin( Display *display, + int deviceid, + Window grab_window, + int num_modifiers, + XIGrabModifiers *modifiers); + + display + Specifies the connection to the X server. + + device + Specifies the device that is to be grabbed or released + + button + Specifies the device button that is to be grabbed or + released or XIAnyButton. + + keycode + Specifies the keycode that is to be grabbed or released + or XIAnyKeycode. + + num_modifiers + Number of elements in modifiers or modifiers_inout. + + modifiers + Specifies the set of latched and base modifiers or + XIAnyModifier to ungrab. The data type is for + consistency with the respective grab request and the + status code of the XIGrabModifiers struct is ignored. + + modifiers_inout + Specifies the set of latched and base modifiers or + XIAnyModifier to grab. Returns the modifiers that could + not be grabbed and their error code. + + grab_window + Specifies the grab window. + + owner_events + Specifies a Boolean value that indicates whether the are + to be reported as usual or reported with respect to the + grab window. + + mask + Specifies the event mask. + + grab_mode + Specifies further processing of events from this device. + You can pass XIGrabModeSync or XIGrabModeAsync. + + paired_device_mode + Specifies further processing of events from the paired + master device. You can pass XIGrabModeSync or + XIGrabModeAsync. If deviceid specifies a floating slave + device, this parameter is ignored. + +DESCRIPTION +----------- + + XIGrabButton, XIGrabKeycode and XIGrabTouchBegin establish a passive + grab. The modifier device for a button grab is the paired master device + if deviceid specifies a master pointer. Otherwise, the modifier + device is the device specified with deviceid. In the future, + the device is actively grabbed (as for XIGrabDevice, the + last-grab time is set to the time at which the button or keycode + was pressed and the XI_ButtonPress or XI_KeyPress event is + reported if all of the following conditions are true: + * The device is not grabbed, and the specified button or + keycode is logically pressed or a touch event occurs when the + specified modifier keys are logically down on the modifier device + and no other buttons or modifier keys are logically down. + * Either the grab window is an ancestor of (or is) the focus + window, OR the grab window is a descendent of the focus + window and contains the device. + * A passive grab on the same button/modifier combination does + not exist on any ancestor of grab_window. + + The interpretation of the remaining arguments is as for + XIGrabDevice. The active grab is terminated automatically when + the logical state of the device has all buttons or keys + released (independent of the logical state of the modifier + keys). + + If the device is an attached slave device, the device is + automatically detached from the master device when the grab + activates and reattached to the same master device when the + grab deactivates. If the master device is removed while the + device is floating as a result of a grab, the device remains + floating once the grab deactivates. + + Note that the logical state of a device (as seen by client + applications) may lag the physical state if device event + processing is frozen. + + This request overrides all previous grabs by the same client on + the same button/modifier or keycode/modifier combinations on the + same window. A modifiers of XIAnyModifier is equivalent to + issuing the grab request for all possible modifier combinations + (including the combination of no modifiers). It is not required + that all modifiers specified have currently assigned KeyCodes. + A button of XIAnyButton is equivalent to issuing the request + for all possible buttons. Otherwise, it is not required that + the specified button currently be assigned to a physical + button. + + If some other client has already issued a XIGrabButton or + XIGrabKeycode with the same button/modifier or keycode/modifier + combination on the same window, a BadAccess error results. When + using XIAnyModifier or XIAnyButton , the request fails + completely, and a XIBadAccess error results (no grabs are + established) if there is a conflicting grab for any + combination. XIGrabButton and XIGrabKeycode have no effect on an + active grab. + + On success, XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return 0; + If one or more modifier combinations could not be grabbed, + XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of + failed combinations and modifiers_inout contains the failed combinations + and their respective error codes. + + XIGrabButton, XIGrabKeycode and XIGrabTouchBegin can generate BadClass, + BadDevice, BadMatch, BadValue, and BadWindow errors. + + XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin release the + passive grab for a button/modifier, keycode/modifier or touch/modifier + combination on the specified window if it was grabbed by this client. A + modifier of XIAnyModifier is equivalent to issuing the ungrab request + for all possible modifier combinations, including the + combination of no modifiers. A button of XIAnyButton is + equivalent to issuing the request for all possible buttons. + XIUngrabButton and XIUngrabKeycode have no effect on an active + grab. + + XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin can generate + BadDevice, BadMatch, BadValue and BadWindow errors. + +RETURN VALUE +------------ + XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of + modifier combination that could not establish a passive grab. The + modifiers are returned in modifiers_inout, along with the respective + error for this modifier combination. If XIGrabButton, XIGrabKeycode + or XIGrabTouchBegin return zero, passive grabs with all requested + modifier combinations were established successfully. + +DIAGNOSTICS +----------- + + BadDevice + An invalid deviceid was specified. + + BadMatch + This error may occur if XIGrabButton specified a device + that has no buttons, or XIGrabKeycode specified a device + that has no keys, or XIGrabTouchBegin specified a device + that is not touch-capable. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + +BUGS +---- + + The protocol headers for XI 2.0 did not provide + XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and + GrabModeAsync instead, respectively. + +SEE ALSO +-------- + + XIAllowEvents(libmansuffix) + diff --git a/man/XIGrabDevice.man b/man/XIGrabDevice.man new file mode 100644 index 0000000..48c4300 --- /dev/null +++ b/man/XIGrabDevice.man @@ -0,0 +1,318 @@ +'\" t +.\" Title: xigrabdevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/21/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIGRABDEVICE" "libmansuffix" "12/21/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIGrabDevice, XIUngrabDevice \- grab or ungrab the device\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Status XIGrabDevice( Display *display, + int deviceid, + Window grab_window, + Time time, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask); +.fi +.sp +.nf +Status XIUngrabDevice( Display *display, + int deviceid, + Time time); +.fi +.sp +.nf +cursor + Specifies the cursor image to display for the duration + of the grab\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +deviceid + Specifies the device that should be grabbed or + ungrabbed\&. +.fi +.sp +.nf +grab_mode, paired_device_mode + The grab mode for this device and (if applicable) the + paired device\&. +.fi +.sp +.nf +grab_window + The grab window\&. +.fi +.sp +.nf +mask + Event mask\&. +.fi +.sp +.nf +owner_events + True if events are to be reported normally\&. +.fi +.sp +.nf +time + A valid timestamp or CurrentTime\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabDevice actively grabs control of the device\&. Further +device events are reported only to the grabbing client\&. +XIGrabDevice overrides any active device grab by this client\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is an attached slave device, the device is +automatically detached from the master device and reattached to +the same master device when client ungrabs the device\&. If the +master device is removed while the device is floating as a +result of a grab, the device remains floating once the grab +deactivates\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If owner_events is False, all generated device events are +reported with respect to grab_window if selected\&. If +owner_events is True and if a generated device event would +normally be reported to this client, it is reported normally; +otherwise, the event is reported with respect to the +grab_window, and is only reported if specified in the event +mask\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the grab_mode argument is XIGrabModeAsync, device event +processing continues as usual\&. If the device is currently +frozen by this client, then processing of device events is +resumed\&. If the grab_mode argument is XIGrabModeSync, the state +of the device (as seen by client applications) appears to +freeze, and the X server generates no further device events +until the grabbing client issues a releasing XIAllowEvents call +or until the device grab is released\&. Actual device changes are +not lost while the device is frozen; they are simply queued in +the server for later processing\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If paired_device_mode is XIGrabModeAsync, processing of events +from the paired master device is unaffected by activation of +the grab\&. If paired_device_mode is XIGrabModeSync, the state of +the paired master device (as seen by client applications) +appears to freeze, and the X server generates no further events +from this device until the grabbing client issues a releasing +XIAllowEvents call or until the device grab is released\&. Actual +events are not lost while the devices are frozen; they are +simply queued in the server for later processing\&. If the device +is a slave device paired_device_mode is ignored\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is actively grabbed by some other client, +XIGrabDevice fails and returns AlreadyGrabbed\&. If grab_window +is not viewable, it fails and returns GrabNotViewable\&. If the +device is frozen by an active grab of another client, it fails +and returns GrabFrozen\&. If the specified time is earlier than +the last\-device\-grab time or later than the current X server +time, it fails and returns GrabInvalidTime\&. Otherwise, the +last\-device\-grab time is set to the specified time\&. CurrentTime +is replaced by the current X server time\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If cursor is not None this cursor is displayed until the client +calls XIUngrabDevice\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabDevice can generate BadDevice, BadValue, and BadWindow +errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIUngrabDevice request releases the device and any queued +events if this client has it actively grabbed from either +XIGrabDevice or XIGrabKey or XIGrabButton\&. If other devices are +frozen by the grab, XUngrabDevice thaws them\&. XUngrabDevice +does not release the device and any queued events if the +specified time is earlier than the last\-device\-grab time or is +later than the current X server time\&. The X server +automatically performs an XIUngrabDevice request if the event +window for an active device grab becomes not viewable\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUngrabDevice can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + A value is outside of the permitted range\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a appropriate for the type of change\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + The window is not viewable\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "BUGS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The protocol headers for XI 2\&.0 did not provide +XIGrabModeAsync or XIGrabModeSync\&. Use GrabModeSync and +GrabModeAsync instead, respectively\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAllowEvents(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIGrabDevice.txt b/man/XIGrabDevice.txt new file mode 100644 index 0000000..ce33a19 --- /dev/null +++ b/man/XIGrabDevice.txt @@ -0,0 +1,154 @@ +XIGRABDEVICE(libmansuffix) +========================== + +NAME +---- + + XIGrabDevice, XIUngrabDevice - grab or ungrab the device. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Status XIGrabDevice( Display *display, + int deviceid, + Window grab_window, + Time time, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask); + + Status XIUngrabDevice( Display *display, + int deviceid, + Time time); + + cursor + Specifies the cursor image to display for the duration + of the grab. + + display + Specifies the connection to the X server. + + deviceid + Specifies the device that should be grabbed or + ungrabbed. + + grab_mode, paired_device_mode + The grab mode for this device and (if applicable) the + paired device. + + grab_window + The grab window. + + mask + Event mask. + + owner_events + True if events are to be reported normally. + + time + A valid timestamp or CurrentTime. + +DESCRIPTION +----------- + + XIGrabDevice actively grabs control of the device. Further + device events are reported only to the grabbing client. + XIGrabDevice overrides any active device grab by this client. + + If the device is an attached slave device, the device is + automatically detached from the master device and reattached to + the same master device when client ungrabs the device. If the + master device is removed while the device is floating as a + result of a grab, the device remains floating once the grab + deactivates. + + If owner_events is False, all generated device events are + reported with respect to grab_window if selected. If + owner_events is True and if a generated device event would + normally be reported to this client, it is reported normally; + otherwise, the event is reported with respect to the + grab_window, and is only reported if specified in the event + mask. + + If the grab_mode argument is XIGrabModeAsync, device event + processing continues as usual. If the device is currently + frozen by this client, then processing of device events is + resumed. If the grab_mode argument is XIGrabModeSync, the state + of the device (as seen by client applications) appears to + freeze, and the X server generates no further device events + until the grabbing client issues a releasing XIAllowEvents call + or until the device grab is released. Actual device changes are + not lost while the device is frozen; they are simply queued in + the server for later processing. + + If paired_device_mode is XIGrabModeAsync, processing of events + from the paired master device is unaffected by activation of + the grab. If paired_device_mode is XIGrabModeSync, the state of + the paired master device (as seen by client applications) + appears to freeze, and the X server generates no further events + from this device until the grabbing client issues a releasing + XIAllowEvents call or until the device grab is released. Actual + events are not lost while the devices are frozen; they are + simply queued in the server for later processing. If the device + is a slave device paired_device_mode is ignored. + + If the device is actively grabbed by some other client, + XIGrabDevice fails and returns AlreadyGrabbed. If grab_window + is not viewable, it fails and returns GrabNotViewable. If the + device is frozen by an active grab of another client, it fails + and returns GrabFrozen. If the specified time is earlier than + the last-device-grab time or later than the current X server + time, it fails and returns GrabInvalidTime. Otherwise, the + last-device-grab time is set to the specified time. CurrentTime + is replaced by the current X server time. + + If cursor is not None this cursor is displayed until the client + calls XIUngrabDevice. + + XIGrabDevice can generate BadDevice, BadValue, and BadWindow + errors. + + The XIUngrabDevice request releases the device and any queued + events if this client has it actively grabbed from either + XIGrabDevice or XIGrabKey or XIGrabButton. If other devices are + frozen by the grab, XUngrabDevice thaws them. XUngrabDevice + does not release the device and any queued events if the + specified time is earlier than the last-device-grab time or is + later than the current X server time. The X server + automatically performs an XIUngrabDevice request if the event + window for an active device grab becomes not viewable. + + XIUngrabDevice can generate a BadDevice error. + +DIAGNOSTICS +----------- + + BadValue + A value is outside of the permitted range. + + BadDevice + An invalid device was specified. The device does not + exist or is not a appropriate for the type of change. + + BadMatch + The window is not viewable. + + BadWindow + A value for a Window argument does not name a defined + Window. + +BUGS +---- + + The protocol headers for XI 2.0 did not provide + XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and + GrabModeAsync instead, respectively. + +SEE ALSO +-------- + XIAllowEvents(libmansuffix) + diff --git a/man/XIGrabEnter.man b/man/XIGrabEnter.man new file mode 100644 index 0000000..536db6d --- /dev/null +++ b/man/XIGrabEnter.man @@ -0,0 +1,379 @@ +'\" t +.\" Title: xigrabenter +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/21/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIGRABENTER" "libmansuffix" "12/21/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIGrabEnter, XIUngrabEnter, XIGrabFocusIn, XIUngrabFocusIn \- grab/ungrab enter or focus in events\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XIGrabEnter( Display *display, + int deviceid, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); +.fi +.sp +.nf +int XIUngrabEnter( Display *display, + int deviceid, + Window grab_window + int num_modifiers, + XIGrabModifiers *modifiers); +.fi +.sp +.nf +int XIGrabFocusIn ( Display *display, + int deviceid, + Window grab_window + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); +.fi +.sp +.nf +int XIUngrabFocusIn( Display *display, + int deviceid, + Window grab_window + int num_modifiers, + XIGrabModifiers *modifiers); +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device that is to be grabbed or released +.fi +.sp +.nf +num_modifiers + Number of elements in modifiers or modifiers_inout\&. +.fi +.sp +.nf +modifiers + Specifies the set of latched and base modifiers or + XIAnyModifier to ungrab\&. The data type is for + consistency with the respective grab request and the + status code of the XIGrabModifiers struct is ignored\&. +.fi +.sp +.nf +modifiers_inout + Specifies the set of latched and base modifiers or + XIAnyModifier to grab\&. Returns the modifiers that could + not be grabbed and their status code\&. +.fi +.sp +.nf +grab_window + Specifies the grab window\&. +.fi +.sp +.nf +owner_events + Specifies a Boolean value that indicates whether the are + to be reported as usual or reported with respect to the + grab window\&. +.fi +.sp +.nf +mask + Specifies the event mask\&. +.fi +.sp +.nf +grab_mode + Specifies further processing of events from this device\&. + You can pass XIGrabModeSync or XIGrabModeAsync\&. +.fi +.sp +.nf +paired_device_mode + Specifies further processing of events from the paired + master device\&. You can pass XIGrabModeSync or + XIGrabModeAsync\&. If deviceid specifies a floating slave + device, this parameter is ignored\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabEnter and XIGrabFocusIn establish a passive grab\&. The +modifier device for a enter grab is the paired master device if +deviceid specifies a master pointer\&. Otherwise, the modifier +device is the device specified with deviceid\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +For XIGrabEnter and XIGrabFocusIn, in the future, the device is +actively grabbed (as for XIGrabDevice, the last\-grab time is +set to the time at which the pointer/focus entered window) if +the device is not grabbed and the pointer has entered the +grab_window or the focus has been set to the grab_window when +the specified modifier keys are logically down on the modifier +device and no other buttons or modifier keys are logically +down\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The interpretation of the remaining arguments is as for +XIGrabDevice\&. The active grab is terminated automatically when +the pointer leaves the window or the focus is set to a +different window (independent of the logical state of the +modifier keys)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is an attached slave device, the device is +automatically detached from the master device when the grab +activates and reattached to the same master device when the +grab deactivates\&. If the master device is removed while the +device is floating as a result of a grab, the device remains +floating once the grab deactivates\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Note that the logical state of a device (as seen by client +applications) may lag the physical state if device event +processing is frozen\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This request overrides all previous grabs by the same client of +the same type and modifier combinations on the same window\&. A +modifiers of XIAnyModifier is equivalent to issuing the grab +request for all possible modifier combinations (including the +combination of no modifiers)\&. It is not required that all +modifiers specified have currently assigned KeyCodes\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If some other client has already issued a XIGrabEnter or +XIGrabFocusIn on the same window, a BadAccess error results\&. +When using XIAnyModifier, the request fails completely, and a +XIBadAccess error results (no grabs are established) if there +is a conflicting grab for any combination\&. XIGrabEnter and +XIGrabFocusin have no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +On success, XIGrabEnter and XIGrabFocusIn return 0; +If one or more modifier combinations could not be grabbed, +XIGrabEnter and XIGrabFocusIn return the number of failed +combinations and modifiers_inout contains the failed combinations +and their respective status codes\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabEnter and XIGrabFocusIn can generate BadDevice, +BadMatch, BadValue, and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUngrabEnter and XIUngrabFocusIn releases the passive grab on +the specified window if it was grabbed by this client\&. A +modifier of XIAnyModifier is equivalent to issuing the ungrab +request for all possible modifier combinations, including the +combination of no modifiers\&. XIUngrabEnter and XIUngrabFocusIn +have no effect on an active grab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIUngrabEnter and XIUngrabFocusIn can generate BadDevice, +BadMatch, BadValue and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "RETURN VALUE" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGrabEnter and XIGrabFocusIn return the number of modifier combination +that could not establish a passive grab\&. The modifiers are returned in +modifiers_inout, along with the respective error for this modifier +combination\&. If XIGrabEnter or XIGrabFocusIn return zero, passive grabs +with all requested modifier combinations were established successfully\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid deviceid was specified\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if XIGrabEnter specified a device + that has no valuators, or XIGrabFocusIn specified a device + that has no keys\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.SH "BUGS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The protocol headers for XI 2\&.0 did not provide +XIGrabModeAsync or XIGrabModeSync\&. Use GrabModeSync and +GrabModeAsync instead, respectively\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIAllowEvents(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIGrabEnter.txt b/man/XIGrabEnter.txt new file mode 100644 index 0000000..5203f05 --- /dev/null +++ b/man/XIGrabEnter.txt @@ -0,0 +1,197 @@ +XIGRABENTER(libmansuffix) +========================= + +NAME +---- + + XIGrabEnter, XIUngrabEnter, XIGrabFocusIn, XIUngrabFocusIn - + grab/ungrab enter or focus in events. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XIGrabEnter( Display *display, + int deviceid, + Window grab_window, + Cursor cursor, + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); + + int XIUngrabEnter( Display *display, + int deviceid, + Window grab_window + int num_modifiers, + XIGrabModifiers *modifiers); + + int XIGrabFocusIn ( Display *display, + int deviceid, + Window grab_window + int grab_mode, + int paired_device_mode, + Bool owner_events, + XIEventMask *mask, + int num_modifiers, + XIGrabModifiers *modifiers_inout); + + int XIUngrabFocusIn( Display *display, + int deviceid, + Window grab_window + int num_modifiers, + XIGrabModifiers *modifiers); + display + Specifies the connection to the X server. + + device + Specifies the device that is to be grabbed or released + + num_modifiers + Number of elements in modifiers or modifiers_inout. + + modifiers + Specifies the set of latched and base modifiers or + XIAnyModifier to ungrab. The data type is for + consistency with the respective grab request and the + status code of the XIGrabModifiers struct is ignored. + + modifiers_inout + Specifies the set of latched and base modifiers or + XIAnyModifier to grab. Returns the modifiers that could + not be grabbed and their status code. + + grab_window + Specifies the grab window. + + owner_events + Specifies a Boolean value that indicates whether the are + to be reported as usual or reported with respect to the + grab window. + + mask + Specifies the event mask. + + grab_mode + Specifies further processing of events from this device. + You can pass XIGrabModeSync or XIGrabModeAsync. + + paired_device_mode + Specifies further processing of events from the paired + master device. You can pass XIGrabModeSync or + XIGrabModeAsync. If deviceid specifies a floating slave + device, this parameter is ignored. + +DESCRIPTION +----------- + + XIGrabEnter and XIGrabFocusIn establish a passive grab. The + modifier device for a enter grab is the paired master device if + deviceid specifies a master pointer. Otherwise, the modifier + device is the device specified with deviceid. + + For XIGrabEnter and XIGrabFocusIn, in the future, the device is + actively grabbed (as for XIGrabDevice, the last-grab time is + set to the time at which the pointer/focus entered window) if + the device is not grabbed and the pointer has entered the + grab_window or the focus has been set to the grab_window when + the specified modifier keys are logically down on the modifier + device and no other buttons or modifier keys are logically + down. + + The interpretation of the remaining arguments is as for + XIGrabDevice. The active grab is terminated automatically when + the pointer leaves the window or the focus is set to a + different window (independent of the logical state of the + modifier keys). + + If the device is an attached slave device, the device is + automatically detached from the master device when the grab + activates and reattached to the same master device when the + grab deactivates. If the master device is removed while the + device is floating as a result of a grab, the device remains + floating once the grab deactivates. + + Note that the logical state of a device (as seen by client + applications) may lag the physical state if device event + processing is frozen. + + This request overrides all previous grabs by the same client of + the same type and modifier combinations on the same window. A + modifiers of XIAnyModifier is equivalent to issuing the grab + request for all possible modifier combinations (including the + combination of no modifiers). It is not required that all + modifiers specified have currently assigned KeyCodes. + + If some other client has already issued a XIGrabEnter or + XIGrabFocusIn on the same window, a BadAccess error results. + When using XIAnyModifier, the request fails completely, and a + XIBadAccess error results (no grabs are established) if there + is a conflicting grab for any combination. XIGrabEnter and + XIGrabFocusin have no effect on an active grab. + + On success, XIGrabEnter and XIGrabFocusIn return 0; + If one or more modifier combinations could not be grabbed, + XIGrabEnter and XIGrabFocusIn return the number of failed + combinations and modifiers_inout contains the failed combinations + and their respective status codes. + + XIGrabEnter and XIGrabFocusIn can generate BadDevice, + BadMatch, BadValue, and BadWindow errors. + + XIUngrabEnter and XIUngrabFocusIn releases the passive grab on + the specified window if it was grabbed by this client. A + modifier of XIAnyModifier is equivalent to issuing the ungrab + request for all possible modifier combinations, including the + combination of no modifiers. XIUngrabEnter and XIUngrabFocusIn + have no effect on an active grab. + + XIUngrabEnter and XIUngrabFocusIn can generate BadDevice, + BadMatch, BadValue and BadWindow errors. + +RETURN VALUE +------------ + XIGrabEnter and XIGrabFocusIn return the number of modifier combination + that could not establish a passive grab. The modifiers are returned in + modifiers_inout, along with the respective error for this modifier + combination. If XIGrabEnter or XIGrabFocusIn return zero, passive grabs + with all requested modifier combinations were established successfully. + +DIAGNOSTICS +----------- + + BadDevice + An invalid deviceid was specified. + + BadMatch + This error may occur if XIGrabEnter specified a device + that has no valuators, or XIGrabFocusIn specified a device + that has no keys. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + +BUGS +---- + + The protocol headers for XI 2.0 did not provide + XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and + GrabModeAsync instead, respectively. + +SEE ALSO +-------- + + XIAllowEvents(libmansuffix) + + diff --git a/man/XIGrabFocusIn.man b/man/XIGrabFocusIn.man new file mode 100644 index 0000000..0af5699 --- /dev/null +++ b/man/XIGrabFocusIn.man @@ -0,0 +1 @@ +.so XIGrabEnter.libmansuffix diff --git a/man/XIGrabKeycode.man b/man/XIGrabKeycode.man new file mode 100644 index 0000000..d6764b5 --- /dev/null +++ b/man/XIGrabKeycode.man @@ -0,0 +1 @@ +.so XIGrabButton.libmansuffix diff --git a/man/XIListProperties.man b/man/XIListProperties.man new file mode 100644 index 0000000..a3992ab --- /dev/null +++ b/man/XIListProperties.man @@ -0,0 +1,70 @@ +'\" t +.\" Title: xilistproperties +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XILISTPROPERTIES" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIListProperties \- List a device\*(Aqs properties\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Atom* XListProperties( Display *display, + int deviceid, + int *nprops_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +deviceid + The device to list the properties for\&. +.fi +.sp +.nf +nprops_return + Specifies the number of Atoms returned\&. +.fi +.SH "DESCRIPTION" +.sp +The XIListProperties function returns a list of the properties associated with the input device specified with deviceid\&. Each device may have an arbitrary number of properties attached, some of which were created by the driver and/or server, others created by clients at runtime\&. +.sp +The client is expected to free the list of properties using XFree\&. +.sp +XIListProperties can generate a BadDevice error\&. +.SH "DIAGNOSTICS" +.sp +BadDevice An invalid device was specified\&. The device does not exist\&. +.SH "SEE ALSO" +.sp +XIChangeProperty(libmansuffix), XIGetProperty(libmansuffix), XIDeleteProperty(libmansuffix) diff --git a/man/XIListProperties.txt b/man/XIListProperties.txt new file mode 100644 index 0000000..de374cb --- /dev/null +++ b/man/XIListProperties.txt @@ -0,0 +1,54 @@ +XILISTPROPERTIES(libmansuffix) +============================= + +NAME +---- + + XIListProperties - List a device's properties. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Atom* XListProperties( Display *display, + int deviceid, + int *nprops_return); + + display + Specifies the connection to the X server. + + deviceid + The device to list the properties for. + + nprops_return + Specifies the number of Atoms returned. + + +DESCRIPTION +----------- + +The XIListProperties function returns a list of the +properties associated with the input device specified with +deviceid. Each device may have an arbitrary number of properties +attached, some of which were created by the driver and/or +server, others created by clients at runtime. + +The client is expected to free the list of properties using +XFree. + +XIListProperties can generate a BadDevice error. + +DIAGNOSTICS +----------- + +BadDevice + An invalid device was specified. The device does not + exist. + +SEE ALSO +-------- + +XIChangeProperty(libmansuffix), +XIGetProperty(libmansuffix), +XIDeleteProperty(libmansuffix) diff --git a/man/XIQueryDevice.man b/man/XIQueryDevice.man new file mode 100644 index 0000000..2bd1463 --- /dev/null +++ b/man/XIQueryDevice.man @@ -0,0 +1,671 @@ +'\" t +.\" Title: xiquerydevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 12/22/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIQUERYDEVICE" "libmansuffix" "12/22/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIQueryDevice, XIFreeDeviceInfo \- get information about devices\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +XIDeviceInfo* XIQueryDevice( Display *display, + int deviceid, + int *ndevices_return); +.fi +.sp +.nf +XIFreeDeviceInfo( XIDeviceInfo *info); +.fi +.sp +.nf +deviceid + Specifies the device to query or XIAllDevices or + XIAllMasterDevices\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +ndevices_return + Returns the number of devices returned\&. +.fi +.sp +.nf +info + A list of device XIDeviceInfo structs to be freed\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIQueryDevice returns information about one or more input +devices\&. If the deviceid specifies a device, ndevices_return is +1 and the returned information describes only the requested +device\&. If deviceid is XIAllDevices or XIAllMasterDevices, +ndevices_return is the number of devices or master devices, +respectively, and the returned information represents all +devices or all master devices, respectively\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To free the XIDeviceInfo array returned by XIQueryDevice, use +XIFreeDeviceInfo\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +For each input device requested, the XIQueryDevice returns an +XIDeviceInfo structure\&. Each structure contains information +about the capabilities of one input device available to the +server\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int deviceid; + char *name; + int use; + int attachment; + Bool enabled; + int num_classes; + XIAnyClassInfo **classes; +} XIDeviceInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The deviceid is the numeric unique id of the device\&. A deviceid +is unique for the life\-time of a device but a server may re\-use +the id once a device has been removed\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The name points to a null\-terminated string specifying the +identifier of the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The use and attachment fields specify the type of the device +and the current attachment or pairing\&. +\- If use is XIMasterPointer, the device is a master pointer and + attachment specifies the deviceid of the paired master + keyboard\&. +\- If use is XIMasterKeyboard, the device is a master keyboard, + and the attachment field specifies the paired master pointer\&. +\- If use is XISlavePointer, the device is a slave device and + currently attached to the master pointer specified in + attachement\&. +\- If use is XISlaveKeyboard, the device is a slave device an + currently attached to the master keyboard specified in + attachment\&. +\- If use is XIFloatingSlave, the device is a slave device + currently not attached to any master device\&. The value of the + attachment field for floating slave devices is undefined\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The enabled field specifies if the device is currently enabled +and can send events\&. Disabled devices will not send events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The num_classes field specifies the number of input classes +pointed to by classes\&. The first two fields of all input +classes are identical\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; +} XIAnyClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The type field specifies the type of the input class\&. +Currently, the following types are defined: + XIKeyClass, XIButtonClass, XIValuatorClass, XIScrollClass, + XITouchClass +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +In the future, additional types may be added\&. Clients are +required to ignore unknown input classes\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The sourceid is the deviceid this class originated from\&. For +master devices, the sourceid is typically the id of the slave +device currently sending events\&. For slave devices, the +sourceid is typically the device\*(Aqs id\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A device may have zero or one XIButtonClass, denoting the +device\*(Aqs capability to send button events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int mask_len; + unsigned char *mask; +} XIButtonState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; + int num_buttons; + Atom *labels; + XIButtonState state; +} XIButtonClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The num_buttons field specifies the number of buttons available +on this device\&. A device that has an XIButtonClass must have at +least one button\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +labels is a list of num_buttons Atoms specifying the button +labels for this device\&. If the label is not None, then the +label specifies the type of button in physical device order +(i\&.e\&. as the buttons are numbered on the physical input +device)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The state is the current button state as seen by clients (i\&.e\&. +after button mapping is applied)\&. The mask_len field specifies +the length of mask in bytes\&. For each button on the device, the +respective bit in mask is set if the button is currently +logically down\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A device may have zero or one XIKeyClass, denoting the device\*(Aqs +capability to send key events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; + int num_keycodes; + int *keycodes; +} XIKeyClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The num_keycodes field specifies the number of keycodes +available on this device\&. A device that has an XIKeyClass must +have at least one keycode\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +keycodes is a list of num_keycodes keycodes the device may +send\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A device may have zero or more XIValuatorClass, denoting the +device\*(Aqs capability to send coordinates\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; + int number; + Atom label; + double min; + double max; + double value; + int resolution; + int mode; +} XIValuatorClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The number field specifies the number of the axis on the +physical device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the label field is not None, the value of label is an Atom +describing the axis\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +min and max are the minimum and maximum values allowed on this +axis\&. If both are zero, no minumum or maximum values are set on +this device\&. value is the current value of this axis\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The resolution field specifies the resolution of the device in +units/m\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The mode specifies the mode of this axis\&. If the mode is +XIModeAbsolute this axis sends absolute coordinates\&. If the +mode is XIModeRelative, this device sends relative coordinates\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; + int number; + int scroll_type; + double increment; + int flags; +} XIScrollClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This class describes scrolling capability on a valuator\&. For +each XIScrollClassInfo, an XIValuatorClassInfo with the same +number is present on the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The number field specifies the valuator number on the physical +device that this scroll information applies to\&. See the +respective XIValuatorClassInfo for detailed information on this +valuator\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The scroll_type field specifies the type of scrolling, either +XIScrollTypeVertical or XIScrollTypeHorizontal\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The increment specifies the value change considered one unit of +scrolling down\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The flags field specifies flags that apply to this scrolling +information: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If XIScrollFlagNoEmulation is set, the server will not +emulate legacy button events for valuator changes on this +valuator\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If XIScrollFlagPreferred is set, this axis is the +preferred axis for this scroll type and will be used for +the emulation of XI_Motion events when the driver submits +legacy scroll button events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct +{ + int type; + int sourceid; + int mode; + int num_touches; +} XITouchClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A device may have zero or one XITouchClassInfo, denoting +multi\-touch capability on the device\&. A device with a XITouchClassInfo +may send TouchBegin, TouchUpdate, TouchEnd and TouchOwnership events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The mode field is either XIDirectTouch for direct\-input touch devices +such as touchscreens or XIDependentTouch for indirect input devices such +as touchpads\&. For XIDirectTouch devices, touch events are sent to window +at the position the touch occured\&. For XIDependentTouch devices, touch +events are sent to the window at the position of the device\*(Aqs sprite\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The num_touches field defines the maximum number of simultaneous touches +the device supports\&. A num_touches of 0 means the maximum number of +simultaneous touches is undefined or unspecified\&. This field should be +used as a guide only, devices will lie about their capabilities\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A device with an XITouchClassInfo may still send pointer events\&. The +valuators must be defined with the respective XIValuatorClass +classes\&. A valuator may send both pointer and touch\-events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryDevice can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIFreeDeviceInfo frees the information returned by +XIQueryDevice\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a pointer device\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIQueryDevice.txt b/man/XIQueryDevice.txt new file mode 100644 index 0000000..e5e8251 --- /dev/null +++ b/man/XIQueryDevice.txt @@ -0,0 +1,273 @@ +XIQUERYDEVICE(libmansuffix) +============================ + +NAME +---- + + XIQueryDevice, XIFreeDeviceInfo - get information about devices. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + XIDeviceInfo* XIQueryDevice( Display *display, + int deviceid, + int *ndevices_return); + + XIFreeDeviceInfo( XIDeviceInfo *info); + + deviceid + Specifies the device to query or XIAllDevices or + XIAllMasterDevices. + + display + Specifies the connection to the X server. + + ndevices_return + Returns the number of devices returned. + + info + A list of device XIDeviceInfo structs to be freed. + + +DESCRIPTION +----------- + + The XIQueryDevice returns information about one or more input + devices. If the deviceid specifies a device, ndevices_return is + 1 and the returned information describes only the requested + device. If deviceid is XIAllDevices or XIAllMasterDevices, + ndevices_return is the number of devices or master devices, + respectively, and the returned information represents all + devices or all master devices, respectively. + + To free the XIDeviceInfo array returned by XIQueryDevice, use + XIFreeDeviceInfo. + + For each input device requested, the XIQueryDevice returns an + XIDeviceInfo structure. Each structure contains information + about the capabilities of one input device available to the + server. + + typedef struct + { + int deviceid; + char *name; + int use; + int attachment; + Bool enabled; + int num_classes; + XIAnyClassInfo **classes; + } XIDeviceInfo; + + The deviceid is the numeric unique id of the device. A deviceid + is unique for the life-time of a device but a server may re-use + the id once a device has been removed. + + The name points to a null-terminated string specifying the + identifier of the device. + + The use and attachment fields specify the type of the device + and the current attachment or pairing. + - If use is XIMasterPointer, the device is a master pointer and + attachment specifies the deviceid of the paired master + keyboard. + - If use is XIMasterKeyboard, the device is a master keyboard, + and the attachment field specifies the paired master pointer. + - If use is XISlavePointer, the device is a slave device and + currently attached to the master pointer specified in + attachement. + - If use is XISlaveKeyboard, the device is a slave device an + currently attached to the master keyboard specified in + attachment. + - If use is XIFloatingSlave, the device is a slave device + currently not attached to any master device. The value of the + attachment field for floating slave devices is undefined. + + The enabled field specifies if the device is currently enabled + and can send events. Disabled devices will not send events. + + The num_classes field specifies the number of input classes + pointed to by classes. The first two fields of all input + classes are identical. + + typedef struct + { + int type; + int sourceid; + } XIAnyClassInfo; + + The type field specifies the type of the input class. + Currently, the following types are defined: + XIKeyClass, XIButtonClass, XIValuatorClass, XIScrollClass, + XITouchClass + + In the future, additional types may be added. Clients are + required to ignore unknown input classes. + + The sourceid is the deviceid this class originated from. For + master devices, the sourceid is typically the id of the slave + device currently sending events. For slave devices, the + sourceid is typically the device's id. + + A device may have zero or one XIButtonClass, denoting the + device's capability to send button events. + + typedef struct { + int mask_len; + unsigned char *mask; + } XIButtonState; + + typedef struct + { + int type; + int sourceid; + int num_buttons; + Atom *labels; + XIButtonState state; + } XIButtonClassInfo; + + The num_buttons field specifies the number of buttons available + on this device. A device that has an XIButtonClass must have at + least one button. + + labels is a list of num_buttons Atoms specifying the button + labels for this device. If the label is not None, then the + label specifies the type of button in physical device order + (i.e. as the buttons are numbered on the physical input + device). + + The state is the current button state as seen by clients (i.e. + after button mapping is applied). The mask_len field specifies + the length of mask in bytes. For each button on the device, the + respective bit in mask is set if the button is currently + logically down. + + A device may have zero or one XIKeyClass, denoting the device's + capability to send key events. + + typedef struct + { + int type; + int sourceid; + int num_keycodes; + int *keycodes; + } XIKeyClassInfo; + + The num_keycodes field specifies the number of keycodes + available on this device. A device that has an XIKeyClass must + have at least one keycode. + + keycodes is a list of num_keycodes keycodes the device may + send. + + A device may have zero or more XIValuatorClass, denoting the + device's capability to send coordinates. + + typedef struct + { + int type; + int sourceid; + int number; + Atom label; + double min; + double max; + double value; + int resolution; + int mode; + } XIValuatorClassInfo; + + The number field specifies the number of the axis on the + physical device. + + If the label field is not None, the value of label is an Atom + describing the axis. + + min and max are the minimum and maximum values allowed on this + axis. If both are zero, no minumum or maximum values are set on + this device. value is the current value of this axis. + + The resolution field specifies the resolution of the device in + units/m. + + The mode specifies the mode of this axis. If the mode is + XIModeAbsolute this axis sends absolute coordinates. If the + mode is XIModeRelative, this device sends relative coordinates. + + typedef struct + { + int type; + int sourceid; + int number; + int scroll_type; + double increment; + int flags; + } XIScrollClassInfo; + + This class describes scrolling capability on a valuator. For + each XIScrollClassInfo, an XIValuatorClassInfo with the same + number is present on the device. + + The number field specifies the valuator number on the physical + device that this scroll information applies to. See the + respective XIValuatorClassInfo for detailed information on this + valuator. + + The scroll_type field specifies the type of scrolling, either + XIScrollTypeVertical or XIScrollTypeHorizontal. + + The increment specifies the value change considered one unit of + scrolling down. + + The flags field specifies flags that apply to this scrolling + information: + + If XIScrollFlagNoEmulation is set, the server will not + emulate legacy button events for valuator changes on this + valuator. + + If XIScrollFlagPreferred is set, this axis is the + preferred axis for this scroll type and will be used for + the emulation of XI_Motion events when the driver submits + legacy scroll button events. + + typedef struct + { + int type; + int sourceid; + int mode; + int num_touches; + } XITouchClassInfo; + + A device may have zero or one XITouchClassInfo, denoting + multi-touch capability on the device. A device with a XITouchClassInfo + may send TouchBegin, TouchUpdate, TouchEnd and TouchOwnership events. + + The mode field is either XIDirectTouch for direct-input touch devices + such as touchscreens or XIDependentTouch for indirect input devices such + as touchpads. For XIDirectTouch devices, touch events are sent to window + at the position the touch occured. For XIDependentTouch devices, touch + events are sent to the window at the position of the device's sprite. + + The num_touches field defines the maximum number of simultaneous touches + the device supports. A num_touches of 0 means the maximum number of + simultaneous touches is undefined or unspecified. This field should be + used as a guide only, devices will lie about their capabilities. + + A device with an XITouchClassInfo may still send pointer events. The + valuators must be defined with the respective XIValuatorClass + classes. A valuator may send both pointer and touch-events. + + XIQueryDevice can generate a BadDevice error. + + XIFreeDeviceInfo frees the information returned by + XIQueryDevice. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist or is not a pointer device. + diff --git a/man/XIQueryPointer.man b/man/XIQueryPointer.man new file mode 100644 index 0000000..859cdb5 --- /dev/null +++ b/man/XIQueryPointer.man @@ -0,0 +1,205 @@ +'\" t +.\" Title: xiquerypointer +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIQUERYPOINTER" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIQueryPointer \- get device pointer coordinates\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Bool XIQueryPointer( Display *display, + int deviceid, + Window win, + Window *root_return, + Window *child_return, + double *root_x_return, + double *root_y_return, + double *win_x_return, + double *win_y_return, + XIButtonState *buttons_return, + XIModifierState *modifiers_return, + XIGroupState *group_return); +.fi +.sp +.nf +buttons_return + Returns the current button state\&. +.fi +.sp +.nf +child_return + Returns the child window that the pointer is located in, + if any\&. +.fi +.sp +.nf +deviceid + Specifies the device to query\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +group_return + Returns the current group state\&. +.fi +.sp +.nf +modifiers_return + Returns the current state of the modifier keys\&. +.fi +.sp +.nf +root_return + Returns the root window that the pointer is in\&. +.fi +.sp +.nf +root_x_return, root_y_return + Return the pointer coordinates relative to the root + window\*(Aqs origin\&. +.fi +.sp +.nf +win + Specifies the window\&. +.fi +.sp +.nf +win_x_return, win_y_return + Return the pointer coordinates relative to the specified + window\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIQueryPointer function returns the root window the +device\*(Aqs pointer is logically on and the pointer coordinates +relative to the root window\*(Aqs origin\&. If XIQueryPointer returns +False, the pointer is not on the same screen as the specified +window, and XIQueryPointer returns None to child_return and +zero to win_x_return and win_y_return\&. If XIQueryPointer +returns True, the pointer coordinates returned to win_x_return +and win_y_return are relative to the origin of the specified +window\&. In this case, XIQueryPointer returns the child that +contains the pointer, if any, or else None to child_return\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryPointer returns the current logical state of the buttons +buttons_return\&. The keyboard paired with the master pointer is +selected to obtain the data for modifiers_return and +group_return\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The mask field in buttons_return is dynamically allocated and +must be freed by the caller\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryPointer is identical to XQueryPointer but specifies the +device explicitly\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryPointer can generate a BadDevice and a BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XQueryPointer(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIQueryPointer.txt b/man/XIQueryPointer.txt new file mode 100644 index 0000000..73fc11e --- /dev/null +++ b/man/XIQueryPointer.txt @@ -0,0 +1,102 @@ +XIQUERYPOINTER(libmansuffix) +============================ + +NAME +---- + + XIQueryPointer - get device pointer coordinates. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Bool XIQueryPointer( Display *display, + int deviceid, + Window win, + Window *root_return, + Window *child_return, + double *root_x_return, + double *root_y_return, + double *win_x_return, + double *win_y_return, + XIButtonState *buttons_return, + XIModifierState *modifiers_return, + XIGroupState *group_return); + + buttons_return + Returns the current button state. + + child_return + Returns the child window that the pointer is located in, + if any. + + deviceid + Specifies the device to query. + + display + Specifies the connection to the X server. + + group_return + Returns the current group state. + + modifiers_return + Returns the current state of the modifier keys. + + root_return + Returns the root window that the pointer is in. + + root_x_return, root_y_return + Return the pointer coordinates relative to the root + window's origin. + + win + Specifies the window. + + win_x_return, win_y_return + Return the pointer coordinates relative to the specified + window. + +DESCRIPTION +----------- + + The XIQueryPointer function returns the root window the + device's pointer is logically on and the pointer coordinates + relative to the root window's origin. If XIQueryPointer returns + False, the pointer is not on the same screen as the specified + window, and XIQueryPointer returns None to child_return and + zero to win_x_return and win_y_return. If XIQueryPointer + returns True, the pointer coordinates returned to win_x_return + and win_y_return are relative to the origin of the specified + window. In this case, XIQueryPointer returns the child that + contains the pointer, if any, or else None to child_return. + + XIQueryPointer returns the current logical state of the buttons + buttons_return. The keyboard paired with the master pointer is + selected to obtain the data for modifiers_return and + group_return. + + The mask field in buttons_return is dynamically allocated and + must be freed by the caller. + + XIQueryPointer is identical to XQueryPointer but specifies the + device explicitly. + + XIQueryPointer can generate a BadDevice and a BadWindow error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist or is not a pointer device. + + BadWindow + A value for a Window argument does not name a defined + window. + +SEE ALSO +-------- + + XQueryPointer(libmansuffix) + diff --git a/man/XIQueryVersion.man b/man/XIQueryVersion.man new file mode 100644 index 0000000..3187a83 --- /dev/null +++ b/man/XIQueryVersion.man @@ -0,0 +1,153 @@ +'\" t +.\" Title: xiqueryversion +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 04/23/2012 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIQUERYVERSION" "libmansuffix" "04/23/2012" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIQueryVersion \- announce and query the support XI2 version\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Status XIQueryVersion( Display *display, + int *major_version_inout, + int *minor_version_inout); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +major_version_inout + Specifies the client\*(Aqs supported XI2 version, and + returns the server\*(Aqs supported version\&. +.fi +.sp +.nf +minor_version_inout + Specifies the client\*(Aqs supported XI2 version, and + returns the server\*(Aqs supported version\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryVersion announces the client\*(Aqs supported XI2 version to +the server and returns server\*(Aqs supported X Input version\&. Clients +are required to use XIQueryVersion instead of XGetExtensionVersion +if they use XI2 calls\&. The server may treat a client differently +depending on the supported version announced by the client\&. +The major_version_inout must be 2 or greater, otherwise a BadValue +error occurs\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the server does not support XI2, XIQueryVersion returns BadRequest +to the client\&. Otherwise, XIQueryVersion returns Success\&. In both +cases major_version_inout and minor_version_inout are set to the +server\*(Aqs supported version\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Consecutive calls to XIQueryVersion by the same client always return the +first returned major\&.minor version\&. If the client requests a version +lower than the first returned major\&.minor version in a subsequent call, a +BadValue error occurs\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIQueryVersion can generate a BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.SH "EXAMPLES" +.sp +.if n \{\ +.RS 4 +.\} +.nf +int rc; +int major = 2; +int minor = 0; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +rc = XIQueryVersion(dpy, &major, &minor); +if (rc == Success) + printf("XI2 supported\&. (%d\&.%d)\en", major, minor); +else if (rc == BadRequest) + printf("No XI2 support\&. (%d\&.%d only)\en", major, minor); +else + printf("Internal error\en"); +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + A value is outside of the permitted range\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIQueryVersion.txt b/man/XIQueryVersion.txt new file mode 100644 index 0000000..839c18c --- /dev/null +++ b/man/XIQueryVersion.txt @@ -0,0 +1,72 @@ +XIQUERYVERSION(libmansuffix) +============================ + +NAME +---- + + XIQueryVersion - announce and query the support XI2 version. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Status XIQueryVersion( Display *display, + int *major_version_inout, + int *minor_version_inout); + + display + Specifies the connection to the X server. + + major_version_inout + Specifies the client's supported XI2 version, and + returns the server's supported version. + + minor_version_inout + Specifies the client's supported XI2 version, and + returns the server's supported version. + +DESCRIPTION +----------- + + XIQueryVersion announces the client's supported XI2 version to + the server and returns server's supported X Input version. Clients + are required to use XIQueryVersion instead of XGetExtensionVersion + if they use XI2 calls. The server may treat a client differently + depending on the supported version announced by the client. + The major_version_inout must be 2 or greater, otherwise a BadValue + error occurs. + + If the server does not support XI2, XIQueryVersion returns BadRequest + to the client. Otherwise, XIQueryVersion returns Success. In both + cases major_version_inout and minor_version_inout are set to the + server's supported version. + + Consecutive calls to XIQueryVersion by the same client always return the + first returned major.minor version. If the client requests a version + lower than the first returned major.minor version in a subsequent call, a + BadValue error occurs. + + XIQueryVersion can generate a BadValue error. + +EXAMPLES +-------- + + int rc; + int major = 2; + int minor = 0; + + rc = XIQueryVersion(dpy, &major, &minor); + if (rc == Success) + printf("XI2 supported. (%d.%d)\n", major, minor); + else if (rc == BadRequest) + printf("No XI2 support. (%d.%d only)\n", major, minor); + else + printf("Internal error\n"); + +DIAGNOSTICS +----------- + + BadValue + A value is outside of the permitted range. + diff --git a/man/XISelectEvents.man b/man/XISelectEvents.man new file mode 100644 index 0000000..1dfa699 --- /dev/null +++ b/man/XISelectEvents.man @@ -0,0 +1,223 @@ +'\" t +.\" Title: xiselectevents +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XISELECTEVENTS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XISelectEvents, XIGetSelectedEvents \- select for or get selected XI2 events on the window\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Status XISelectEvents( Display *display, + Window win, + XIEventMask *masks, + int num_masks); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +masks + Device event mask\&. +.fi +.sp +.nf +num_masks + Number of masks in masks\&. +.fi +.sp +.nf +win + Specifies the window\&. +.fi +.sp +.nf +XIEventMask *XIGetSelectedEvents( Display *display, + Window win, + int *num_masks_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +num_masks_return + Number of masks in the return value\&. +.fi +.sp +.nf +win + Specifies the window\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XI2 events must be selected using XISelectEvents\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISelectEvents sets the event mask for this client on win\&. +Further events are only reported to this client if the event +type matches the selected event mask\&. The masks overrides the +previously selected event mask for the given device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If deviceid is a valid device, the event mask is selected only +for this device\&. If deviceid is XIAllDevices or +XIAllMasterDevices, the event mask is selected for all devices +or all master devices, respectively\&. The effective event mask +is the bit\-wise OR of the XIAllDevices, XIAllMasterDevices and +the respective device\*(Aqs event mask\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + int deviceid; + int mask_len; + unsigned char* mask; +} XIEventMask; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The mask_len specifies the length of mask in bytes\&. mask is a +binary mask in the form of (1 << event type)\&. deviceid must be +either a device or XIAllDevices or XIAllMasterDevices\&. A client +may submit several masks with the same deviceid in one request +but only the last mask will be effective\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISelectEvents can generate a BadValue, a BadDevice, and a +BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGetSelectedEvents returns the events selected by this client on the given +window\&. If no events were selected on this window, XIGetSelectedEvents +returns NULL and num_masks_return is set to 0\&. If an internal error occurs, +XIGetSelectedEvents returns NULL and num_masks_return is set to \-1\&. +Otherwise, XIGetSelectedEvent returns the selected event masks for all +devices including the masks for XIAllDevices and XIAllMasterDevices +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The caller must free the returned data using XFree()\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + A value is outside of the permitted range\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XISelectEvents.txt b/man/XISelectEvents.txt new file mode 100644 index 0000000..07b3c8e --- /dev/null +++ b/man/XISelectEvents.txt @@ -0,0 +1,98 @@ +XISELECTEVENTS(libmansuffix) +============================ + +NAME +---- + + XISelectEvents, XIGetSelectedEvents - select for or get selected XI2 events on the window. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Status XISelectEvents( Display *display, + Window win, + XIEventMask *masks, + int num_masks); + + display + Specifies the connection to the X server. + + masks + Device event mask. + + num_masks + Number of masks in masks. + + win + Specifies the window. + + XIEventMask *XIGetSelectedEvents( Display *display, + Window win, + int *num_masks_return); + + display + Specifies the connection to the X server. + + num_masks_return + Number of masks in the return value. + + win + Specifies the window. + +DESCRIPTION +----------- + + XI2 events must be selected using XISelectEvents. + + XISelectEvents sets the event mask for this client on win. + Further events are only reported to this client if the event + type matches the selected event mask. The masks overrides the + previously selected event mask for the given device. + + If deviceid is a valid device, the event mask is selected only + for this device. If deviceid is XIAllDevices or + XIAllMasterDevices, the event mask is selected for all devices + or all master devices, respectively. The effective event mask + is the bit-wise OR of the XIAllDevices, XIAllMasterDevices and + the respective device's event mask. + + typedef struct { + int deviceid; + int mask_len; + unsigned char* mask; + } XIEventMask; + + The mask_len specifies the length of mask in bytes. mask is a + binary mask in the form of (1 << event type). deviceid must be + either a device or XIAllDevices or XIAllMasterDevices. A client + may submit several masks with the same deviceid in one request + but only the last mask will be effective. + + XISelectEvents can generate a BadValue, a BadDevice, and a + BadWindow error. + + XIGetSelectedEvents returns the events selected by this client on the given + window. If no events were selected on this window, XIGetSelectedEvents + returns NULL and num_masks_return is set to 0. If an internal error occurs, + XIGetSelectedEvents returns NULL and num_masks_return is set to -1. + Otherwise, XIGetSelectedEvent returns the selected event masks for all + devices including the masks for XIAllDevices and XIAllMasterDevices + + The caller must free the returned data using XFree(). + + +DIAGNOSTICS +----------- + + BadValue + A value is outside of the permitted range. + + BadWindow + A value for a Window argument does not name a defined + window. + + BadDevice + An invalid device was specified. The device does not + exist. diff --git a/man/XISetClientPointer.man b/man/XISetClientPointer.man new file mode 100644 index 0000000..2428276 --- /dev/null +++ b/man/XISetClientPointer.man @@ -0,0 +1,161 @@ +'\" t +.\" Title: xisetclientpointer +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XISETCLIENTPOINTER" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XISetClientPointer, XIGetClientPointer \- set or get the ClientPointer device\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +XISetClientPointer( Display *display, + Window win, + int deviceid); +.fi +.sp +.nf +Bool XIGetClientPointer( Display *display, + Window win, + int *device); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +win + Specifies a window belonging to the client\&. May be None\&. +.fi +.sp +.nf +deviceid + Specifies the ClientPointer device\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The ClientPointer is the device that is percieved to be the +core pointer for non\-XI protocol requests and replies\&. Each +time a protocol message needs device\-dependent data and the +device is not explicitly given, the ClientPointer device is +used to obtain the data\&. For example, a XQueryPointer request +will return the coordinates of the ClientPointer\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISetClientPointer request sets the ClientPointer device for +the client that owns the given window\&. If win is None, the +requesting client\*(Aqs ClientPointer is set to the device +specified with deviceid\&. Only master pointer devices can be set +as ClientPointer\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISetClientPointer and can generate a BadDevice and a BadWindow +error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XIGetClientPointer request returns the ClientPointer\*(Aqs +device ID for the client that owns the given window\&. If win is +None, the requesting client\*(Aqs ClientPointer is returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +win may be a client ID instead of a window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIGetClientPointer can generate a BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a master pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XISetClientPointer.txt b/man/XISetClientPointer.txt new file mode 100644 index 0000000..bb45cdc --- /dev/null +++ b/man/XISetClientPointer.txt @@ -0,0 +1,69 @@ +XISETCLIENTPOINTER(libmansuffix) +================================ + +NAME +---- + + XISetClientPointer, XIGetClientPointer - set or get the + ClientPointer device. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + XISetClientPointer( Display *display, + Window win, + int deviceid); + + Bool XIGetClientPointer( Display *display, + Window win, + int *device); + + display + Specifies the connection to the X server. + + win + Specifies a window belonging to the client. May be None. + + deviceid + Specifies the ClientPointer device. + +DESCRIPTION +----------- + + The ClientPointer is the device that is percieved to be the + core pointer for non-XI protocol requests and replies. Each + time a protocol message needs device-dependent data and the + device is not explicitly given, the ClientPointer device is + used to obtain the data. For example, a XQueryPointer request + will return the coordinates of the ClientPointer. + + XISetClientPointer request sets the ClientPointer device for + the client that owns the given window. If win is None, the + requesting client's ClientPointer is set to the device + specified with deviceid. Only master pointer devices can be set + as ClientPointer. + + XISetClientPointer and can generate a BadDevice and a BadWindow + error. + + The XIGetClientPointer request returns the ClientPointer's + device ID for the client that owns the given window. If win is + None, the requesting client's ClientPointer is returned. + + win may be a client ID instead of a window. + + XIGetClientPointer can generate a BadWindow error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist or is not a master pointer device. + + BadWindow + A value for a Window argument does not name a defined + window. + diff --git a/man/XISetFocus.man b/man/XISetFocus.man new file mode 100644 index 0000000..6d76e21 --- /dev/null +++ b/man/XISetFocus.man @@ -0,0 +1,191 @@ +'\" t +.\" Title: xisetfocus +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XISETFOCUS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XISetFocus, XIGetFocus \- set or get the device\*(Aqs focus\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Status XISetFocus( Display *display, + int deviceid, + Window focus, + Time time); +.fi +.sp +.nf +Status XIGetFocus( Display *display, + Window *focus_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +deviceid + Specifies the device whose focus is to be queried or + changed\&. +.fi +.sp +.nf +focus + The new focus window\&. +.fi +.sp +.nf +focus_return + Returns the current focus window\&. +.fi +.sp +.nf +time + A valid timestamp or CurrentTime\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISetFocus changes the focus of the specified device ans its +last\-focus\-change time\&. It has no effect if the specified time +is earlier than the current last\-focus\-change time or is later +than the current X server time\&. Otherwise, the +last\-focus\-change time is set to the specified time\&. +CurrentTime is replaced by the current X server time)\&. +XISetFocus causes the X server to generate core, XI and XI2 +focus events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the focus window is None all keyboard events by this device +are discarded until a new focus window is set\&. Otherwise, if +focus is a window, it becomes the device\*(Aqs focus window\&. If a +generated device event would normally be reported to this +window or one of its inferiors, the event is reported as usual\&. +Otherwise, the event is reported relative to the focus window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The specified focus window must be viewable at the time +XISetFocus is called, or a BadMatch error results\&. If the focus +window later becomes not viewable, the focus reverts to the +parent (or the closest viewable ancestor\&. When the focus +reverts, the X server generates core, XI and XI2 focus events +but the last\-focus\-change time is not affected\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Attempting to set the focus on a master pointer device or an +attached slave device will result in a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XISetFocus can generate BadDevice, BadMatch, BadValue, and +BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + A value is outside of the permitted range\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a appropriate for the type of change\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + The window is not viewable\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XISetFocus.txt b/man/XISetFocus.txt new file mode 100644 index 0000000..dbfed70 --- /dev/null +++ b/man/XISetFocus.txt @@ -0,0 +1,86 @@ +XISETFOCUS(libmansuffix) +======================== + +NAME +---- + + XISetFocus, XIGetFocus - set or get the device's focus. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Status XISetFocus( Display *display, + int deviceid, + Window focus, + Time time); + + Status XIGetFocus( Display *display, + Window *focus_return); + + display + Specifies the connection to the X server. + + deviceid + Specifies the device whose focus is to be queried or + changed. + + focus + The new focus window. + + focus_return + Returns the current focus window. + + time + A valid timestamp or CurrentTime. + +DESCRIPTION +----------- + + XISetFocus changes the focus of the specified device ans its + last-focus-change time. It has no effect if the specified time + is earlier than the current last-focus-change time or is later + than the current X server time. Otherwise, the + last-focus-change time is set to the specified time. + CurrentTime is replaced by the current X server time). + XISetFocus causes the X server to generate core, XI and XI2 + focus events. + + If the focus window is None all keyboard events by this device + are discarded until a new focus window is set. Otherwise, if + focus is a window, it becomes the device's focus window. If a + generated device event would normally be reported to this + window or one of its inferiors, the event is reported as usual. + Otherwise, the event is reported relative to the focus window. + + The specified focus window must be viewable at the time + XISetFocus is called, or a BadMatch error results. If the focus + window later becomes not viewable, the focus reverts to the + parent (or the closest viewable ancestor. When the focus + reverts, the X server generates core, XI and XI2 focus events + but the last-focus-change time is not affected. + + Attempting to set the focus on a master pointer device or an + attached slave device will result in a BadDevice error. + + XISetFocus can generate BadDevice, BadMatch, BadValue, and + BadWindow errors. + +DIAGNOSTICS +----------- + + BadValue + A value is outside of the permitted range. + + BadDevice + An invalid device was specified. The device does not + exist or is not a appropriate for the type of change. + + BadMatch + The window is not viewable. + + BadWindow + A value for a Window argument does not name a defined + Window. + diff --git a/man/XIUndefineCursor.man b/man/XIUndefineCursor.man new file mode 100644 index 0000000..8afc645 --- /dev/null +++ b/man/XIUndefineCursor.man @@ -0,0 +1 @@ +.so XIDefineCursor.libmansuffix diff --git a/man/XIUngrabButton.man b/man/XIUngrabButton.man new file mode 100644 index 0000000..d6764b5 --- /dev/null +++ b/man/XIUngrabButton.man @@ -0,0 +1 @@ +.so XIGrabButton.libmansuffix diff --git a/man/XIUngrabDevice.man b/man/XIUngrabDevice.man new file mode 100644 index 0000000..8b96d09 --- /dev/null +++ b/man/XIUngrabDevice.man @@ -0,0 +1 @@ +.so XIGrabDevice.libmansuffix diff --git a/man/XIUngrabEnter.man b/man/XIUngrabEnter.man new file mode 100644 index 0000000..0af5699 --- /dev/null +++ b/man/XIUngrabEnter.man @@ -0,0 +1 @@ +.so XIGrabEnter.libmansuffix diff --git a/man/XIUngrabFocusIn.man b/man/XIUngrabFocusIn.man new file mode 100644 index 0000000..0af5699 --- /dev/null +++ b/man/XIUngrabFocusIn.man @@ -0,0 +1 @@ +.so XIGrabEnter.libmansuffix diff --git a/man/XIUngrabKeycode.man b/man/XIUngrabKeycode.man new file mode 100644 index 0000000..d6764b5 --- /dev/null +++ b/man/XIUngrabKeycode.man @@ -0,0 +1 @@ +.so XIGrabButton.libmansuffix diff --git a/man/XIWarpPointer.man b/man/XIWarpPointer.man new file mode 100644 index 0000000..a234a47 --- /dev/null +++ b/man/XIWarpPointer.man @@ -0,0 +1,185 @@ +'\" t +.\" Title: xiwarppointer +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XIWARPPOINTER" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XIWarpPointer \- move a device\*(Aqs pointer\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput2\&.h> +.fi +.sp +.nf +Bool XIWarpPointer( Display *display, + int deviceid, + Window src_w, + Window dest_w, + double src_x, + double src_y, + int src_width, + int src_height, + double dest_x, + double dest_y); +.fi +.sp +.nf +dest_w + Specifies the destination window or None\&. +.fi +.sp +.nf +dest_x, dest_y + Specify the x and y coordinates within the destination + window\&. +.fi +.sp +.nf +deviceid + Specifies the master pointer device or floating slave + device to move\&. +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +src_x, src_y, src_width, src_height + Specify a rectangle in the source window\&. +.fi +.sp +.nf +src_w + Specifies the source window or None\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +If dest_w is None, XIWarpPointer moves the pointer by the +offsets (dest_x, dest_y) relative to the current position of +the pointer\&. If dest_w is a window, XIWarpPointer moves the +pointer to the offsets (dest_x, dest_y) relative to the origin +of dest_w\&. However, if src_w is a window, the move only takes +place if the window src_w contains the pointer and if the +specified rectangle of src_w contains the pointer\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The src_x and src_y coordinates are relative to the origin of +src_w\&. If src_height is zero, it is replaced with the current +height of src_w minus src_y\&. If src_width is zero, it is +replaced with the current width of src_w minus src_x\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +There is seldom any reason for calling this function\&. The +pointer should normally be left to the user\&. If you do use this +function, however, it generates events just as if the user had +instantaneously moved the pointer from one position to another\&. +Note that you cannot use XIWarpPointer to move the pointer +outside the confine_to window of an active pointer grab\&. An +attempt to do so will only move the pointer as far as the +closest edge of the confine_to window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIWarpPointer is identical to XWarpPointer but specifies the +device explicitly\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XIWarpPointer can generate a BadDevice and a BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist or is not a pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XWarpPointer(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XIWarpPointer.txt b/man/XIWarpPointer.txt new file mode 100644 index 0000000..fcf9e69 --- /dev/null +++ b/man/XIWarpPointer.txt @@ -0,0 +1,89 @@ +XIWARPPOINTER(libmansuffix) +=========================== + +NAME +---- + + XIWarpPointer - move a device's pointer. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput2.h> + + Bool XIWarpPointer( Display *display, + int deviceid, + Window src_w, + Window dest_w, + double src_x, + double src_y, + int src_width, + int src_height, + double dest_x, + double dest_y); + + dest_w + Specifies the destination window or None. + + dest_x, dest_y + Specify the x and y coordinates within the destination + window. + + deviceid + Specifies the master pointer device or floating slave + device to move. + + display + Specifies the connection to the X server. + + src_x, src_y, src_width, src_height + Specify a rectangle in the source window. + + src_w + Specifies the source window or None. + +DESCRIPTION +----------- + + If dest_w is None, XIWarpPointer moves the pointer by the + offsets (dest_x, dest_y) relative to the current position of + the pointer. If dest_w is a window, XIWarpPointer moves the + pointer to the offsets (dest_x, dest_y) relative to the origin + of dest_w. However, if src_w is a window, the move only takes + place if the window src_w contains the pointer and if the + specified rectangle of src_w contains the pointer. + + The src_x and src_y coordinates are relative to the origin of + src_w. If src_height is zero, it is replaced with the current + height of src_w minus src_y. If src_width is zero, it is + replaced with the current width of src_w minus src_x. + + There is seldom any reason for calling this function. The + pointer should normally be left to the user. If you do use this + function, however, it generates events just as if the user had + instantaneously moved the pointer from one position to another. + Note that you cannot use XIWarpPointer to move the pointer + outside the confine_to window of an active pointer grab. An + attempt to do so will only move the pointer as far as the + closest edge of the confine_to window. + + XIWarpPointer is identical to XWarpPointer but specifies the + device explicitly. + + XIWarpPointer can generate a BadDevice and a BadWindow error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist or is not a pointer device. + + BadWindow + A value for a Window argument does not name a defined + window. + +SEE ALSO +-------- + + XWarpPointer(libmansuffix) diff --git a/man/XListDeviceProperties.man b/man/XListDeviceProperties.man new file mode 100644 index 0000000..49785d4 --- /dev/null +++ b/man/XListDeviceProperties.man @@ -0,0 +1,119 @@ +'\" t +.\" Title: xlistdeviceproperties +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XLISTDEVICEPROPERTIE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XListDeviceProperties \- List a device\*(Aqs properties\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +Atom* XListDeviceProperties( Display *display, + XDevice *device, + int *nprops_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + The device to list the properties for\&. +.fi +.sp +.nf +nprops_return + Specifies the number of Atoms returned\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XListDeviceProperties function returns a list of the +properties associated with the input device specified in +device\&. Each device may have an arbitrary number of properties +attached, some of which were created by the driver and/or +server, others created by clients at runtime\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The client is expected to free the list of properties using +XFree\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XListDeviceProperties can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The device does not + exist\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeDeviceProperty(libmansuffix), +XGetDeviceProperty(libmansuffix), +XDeleteDeviceProperty(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XListDeviceProperties.txt b/man/XListDeviceProperties.txt new file mode 100644 index 0000000..3a53c89 --- /dev/null +++ b/man/XListDeviceProperties.txt @@ -0,0 +1,53 @@ +XLISTDEVICEPROPERTIES(libmansuffix) +=================================== + +NAME +---- + + XListDeviceProperties - List a device's properties. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + Atom* XListDeviceProperties( Display *display, + XDevice *device, + int *nprops_return); + + display + Specifies the connection to the X server. + + device + The device to list the properties for. + + nprops_return + Specifies the number of Atoms returned. + +DESCRIPTION +----------- + + The XListDeviceProperties function returns a list of the + properties associated with the input device specified in + device. Each device may have an arbitrary number of properties + attached, some of which were created by the driver and/or + server, others created by clients at runtime. + + The client is expected to free the list of properties using + XFree. + + XListDeviceProperties can generate a BadDevice error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The device does not + exist. + +SEE ALSO +-------- + + XChangeDeviceProperty(libmansuffix), + XGetDeviceProperty(libmansuffix), + XDeleteDeviceProperty(libmansuffix) diff --git a/man/XListInputDevices.man b/man/XListInputDevices.man new file mode 100644 index 0000000..94df402 --- /dev/null +++ b/man/XListInputDevices.man @@ -0,0 +1,566 @@ +'\" t +.\" Title: xlistinputdevices +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XLISTINPUTDEVICES" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XListInputDevices, XFreeDeviceList \- list available input devices +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XDeviceInfo *XListInputDevices( Display *display, + int *ndevices_return); +.fi +.sp +.nf +int XFreeDeviceList( XDeviceInfo *list); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +ndevices_return + Specifies a pointer to a variable where the number of + available devices canbe returned\&. +.fi +.sp +.nf +list + Specifies the list of devices to free\&. The + XFreeDeviceList functionfrees the list of available + extension input devices\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XListInputDevices request lists the available input +devices\&. This list includes the core keyboard and any physical +input device currently accessible through the X server, and any +input devices that are not currently accessible through the X +server but could be accessed if requested\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +A master pointer is a virtual pointer device that does not +represent a physical device\&. It is visually represented through +a cursor\&. A master keyboard is a virtual keyboard device that +does not represent a physical device\&. It is virtually +representd through a keyboard focus\&. A master pointer and a +master keyboard are always paired (i\&.e\&. if shift is pressed on +the master keyboard, a pointer click would be a shift\-click)\&. +Multiple master pointer/keyboard pairs can exist\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +X servers supporting the X Input Extension version 2, +XListInputDevices only returns the first master pointer, the +first master keyboard and all slave devices\&. Additional master +devices are not listed\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Physical devices (so\-called slave devices) are attached to +either a master pointer or a master keyboard, depending on +their capabilities\&. If a slave device generates an event, the +event is also generated by the respective master device\&. +Multiple slave devices can be attached to a single master +device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Some server implementations may make all physical input devices +available at the time the server is initialized\&. Others may +wait until requested by a client to access an input device\&. In +the latter case, it is possible that an input device will be +listed as available at one time but not at another\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +For each input device available to the server, the +XListInputDevices request returns an XDeviceInfo structure\&. +That structure contains a pointer to a list of structures, each +of which contains information about one class of input +supported by the device\&. The XDeviceInfo structure is defined +as follows: + typedef struct _XDeviceInfo { + XID id; + Atom type; + char *name; + int num_classes; + int use; + XAnyClassPtr inputclassinfo; + } XDeviceInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The id is a number in the range 0\-128 that uniquely identifies +the device\&. It is assigned to the device when it is initialized +by the server\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The type field is of type Atom and indicates the nature of the +device\&. The type will correspond to one of the following strings +(defined in the header file XI\&.h): +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD +XI_BUTTONBOX XI_BARCODE XI_TRACKBALL XI_QUADRATURE XI_ID_MODULE +XI_ONE_KNOB XI_NINE_KNOB XI_KNOB_BOX XI_SPACEBALL XI_DATAGLOVE +XI_EYETRACKER XI_CURSORKEYS XI_FOOTMOUSE XI_JOYSTICK +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +These strings may be used in an XInternAtom request to return +an atom that can be compared with the type field of the +XDeviceInfo structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The name field contains a pointer to a null\-terminated string +that serves as identifier of the device\&. This identifier may be +user\-configured or automatically assigned by the server\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The num_classes field is a number in the range 0\-255 that +specifies the number of input classes supported by the device +for which information is returned by ListInputDevices\&. Some +input classes, such as class Focus and class Proximity do not +have any information to be returned by ListInputDevices\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +All devices provide an AttachClass\&. This class specifies the +master device a given slave device is attached to\&. For master +devices, the class specifies the respective paired master +device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The use field specifies how the device is currently being used\&. +If the value is IsXKeyboard, the device is a master keyboard\&. +If the value is IsXPointer, the device is a master pointer\&. If +the value is IsXExtensionPointer, the device is a slave +pointer\&. If the value is IsXExtensionKeyboard, the device is a +slave keyboard\&. If the value is IsXExtensionDevice, the device +is available for use as an extension device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The inputclassinfo field contains a pointer to the first +input\-class specific data\&. The first two fields are common to +all classes\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The class field is a number in the range 0\-255\&. It uniquely +identifies the class of input for which information is +returned\&. Currently defined classes are KeyClass, ButtonClass, +and ValuatorClass\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The length field is a number in the range 0\- 255\&. It specifies +the number of bytes of data that are contained in this input +class\&. The length includes the class and length fields\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XKeyInfo structure describes the characteristics of the +keys on the device\&. It is defined as follows: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct _XKeyInfo { +XID class; +int length; +unsigned short min_keycode; +unsigned short max_keycode; +unsigned short num_keys; +} XKeyInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +min_keycode is of type KEYCODE\&. It specifies the minimum +keycode that the device will report\&. The minimum keycode will +not be smaller than 8\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +max_keycode is of type KEYCODE\&. It specifies the maximum +keycode that the device will report\&. The maximum keycode will +not be larger than 255\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +num_keys specifies the number of keys that the device has\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XButtonInfo structure defines the characteristics of the +buttons on the device\&. It is defined as follows: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct _XButtonInfo { +XID class; +int length; +short num_buttons; +} XButtonInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +num_buttons specifies the number of buttons that the device +has\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XValuatorInfo structure defines the characteristics of the +valuators on the device\&. It is defined as follows: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct _XValuatorInfo { +XID class; +int length; +unsigned char num_axes; +unsigned char mode; +unsigned long motion_buffer; +XAxisInfoPtr axes; +} XValuatorInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +num_axes contains the number of axes the device supports\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +mode is a constant that has one of the following values: +Absolute or Relative\&. Some devices allow the mode to be changed +dynamically via the SetDeviceMode request\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +motion_buffer_size is a cardinal number that specifies the +number of elements that can be contained in the motion history +buffer for the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The axes field contains a pointer to an XAxisInfo structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XAxisInfo structure is defined as follows: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct _XAxisInfo { +int resolution; +int min_value; +int max_value; +} XAxisInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The resolution contains a number in counts/meter\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The min_val field contains a number that specifies the minimum +value the device reports for this axis\&. For devices whose mode +is Relative, the min_val field will contain 0\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The max_val field contains a number that specifies the maximum +value the device reports for this axis\&. For devices whose mode +is Relative, the max_val field will contain 0\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XAttachInfo structure is defined as follows: + typedef struct _XAttachInfo { + int attached; + } XAttachInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the device is a slave device, attached specifies the device +ID of the master device this device is attached to\&. If the +device is not attached to a master device, attached is +Floating\&. If the device is a master device, attached specifies +the device ID of the master device this device is paired with\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To free the XDeviceInfo array created by XListInputDevices, use +XFreeDeviceList\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XListInputDevices.txt b/man/XListInputDevices.txt new file mode 100644 index 0000000..276660d --- /dev/null +++ b/man/XListInputDevices.txt @@ -0,0 +1,224 @@ +XLISTINPUTDEVICES(libmansuffix) +=============================== + +NAME +---- + + XListInputDevices, XFreeDeviceList - list available input + devices + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XDeviceInfo *XListInputDevices( Display *display, + int *ndevices_return); + + int XFreeDeviceList( XDeviceInfo *list); + + display + Specifies the connection to the X server. + + ndevices_return + Specifies a pointer to a variable where the number of + available devices canbe returned. + + list + Specifies the list of devices to free. The + XFreeDeviceList functionfrees the list of available + extension input devices. + +DESCRIPTION +----------- + + The XListInputDevices request lists the available input + devices. This list includes the core keyboard and any physical + input device currently accessible through the X server, and any + input devices that are not currently accessible through the X + server but could be accessed if requested. + + A master pointer is a virtual pointer device that does not + represent a physical device. It is visually represented through + a cursor. A master keyboard is a virtual keyboard device that + does not represent a physical device. It is virtually + representd through a keyboard focus. A master pointer and a + master keyboard are always paired (i.e. if shift is pressed on + the master keyboard, a pointer click would be a shift-click). + Multiple master pointer/keyboard pairs can exist. + + X servers supporting the X Input Extension version 2, + XListInputDevices only returns the first master pointer, the + first master keyboard and all slave devices. Additional master + devices are not listed. + + Physical devices (so-called slave devices) are attached to + either a master pointer or a master keyboard, depending on + their capabilities. If a slave device generates an event, the + event is also generated by the respective master device. + Multiple slave devices can be attached to a single master + device. + + Some server implementations may make all physical input devices + available at the time the server is initialized. Others may + wait until requested by a client to access an input device. In + the latter case, it is possible that an input device will be + listed as available at one time but not at another. + + For each input device available to the server, the + XListInputDevices request returns an XDeviceInfo structure. + That structure contains a pointer to a list of structures, each + of which contains information about one class of input + supported by the device. The XDeviceInfo structure is defined + as follows: + typedef struct _XDeviceInfo { + XID id; + Atom type; + char *name; + int num_classes; + int use; + XAnyClassPtr inputclassinfo; + } XDeviceInfo; + + The id is a number in the range 0-128 that uniquely identifies + the device. It is assigned to the device when it is initialized + by the server. + + The type field is of type Atom and indicates the nature of the + device. The type will correspond to one of the following strings + (defined in the header file XI.h): + + XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD + XI_BUTTONBOX XI_BARCODE XI_TRACKBALL XI_QUADRATURE XI_ID_MODULE + XI_ONE_KNOB XI_NINE_KNOB XI_KNOB_BOX XI_SPACEBALL XI_DATAGLOVE + XI_EYETRACKER XI_CURSORKEYS XI_FOOTMOUSE XI_JOYSTICK + + These strings may be used in an XInternAtom request to return + an atom that can be compared with the type field of the + XDeviceInfo structure. + + The name field contains a pointer to a null-terminated string + that serves as identifier of the device. This identifier may be + user-configured or automatically assigned by the server. + + The num_classes field is a number in the range 0-255 that + specifies the number of input classes supported by the device + for which information is returned by ListInputDevices. Some + input classes, such as class Focus and class Proximity do not + have any information to be returned by ListInputDevices. + + All devices provide an AttachClass. This class specifies the + master device a given slave device is attached to. For master + devices, the class specifies the respective paired master + device. + + The use field specifies how the device is currently being used. + If the value is IsXKeyboard, the device is a master keyboard. + If the value is IsXPointer, the device is a master pointer. If + the value is IsXExtensionPointer, the device is a slave + pointer. If the value is IsXExtensionKeyboard, the device is a + slave keyboard. If the value is IsXExtensionDevice, the device + is available for use as an extension device. + + The inputclassinfo field contains a pointer to the first + input-class specific data. The first two fields are common to + all classes. + + The class field is a number in the range 0-255. It uniquely + identifies the class of input for which information is + returned. Currently defined classes are KeyClass, ButtonClass, + and ValuatorClass. + + The length field is a number in the range 0- 255. It specifies + the number of bytes of data that are contained in this input + class. The length includes the class and length fields. + + The XKeyInfo structure describes the characteristics of the + keys on the device. It is defined as follows: + + typedef struct _XKeyInfo { + XID class; + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; + } XKeyInfo; + + + min_keycode is of type KEYCODE. It specifies the minimum + keycode that the device will report. The minimum keycode will + not be smaller than 8. + + max_keycode is of type KEYCODE. It specifies the maximum + keycode that the device will report. The maximum keycode will + not be larger than 255. + + num_keys specifies the number of keys that the device has. + + The XButtonInfo structure defines the characteristics of the + buttons on the device. It is defined as follows: + + typedef struct _XButtonInfo { + XID class; + int length; + short num_buttons; + } XButtonInfo; + + num_buttons specifies the number of buttons that the device + has. + + The XValuatorInfo structure defines the characteristics of the + valuators on the device. It is defined as follows: + + typedef struct _XValuatorInfo { + XID class; + int length; + unsigned char num_axes; + unsigned char mode; + unsigned long motion_buffer; + XAxisInfoPtr axes; + } XValuatorInfo; + + num_axes contains the number of axes the device supports. + + mode is a constant that has one of the following values: + Absolute or Relative. Some devices allow the mode to be changed + dynamically via the SetDeviceMode request. + + motion_buffer_size is a cardinal number that specifies the + number of elements that can be contained in the motion history + buffer for the device. + + The axes field contains a pointer to an XAxisInfo structure. + + The XAxisInfo structure is defined as follows: + + typedef struct _XAxisInfo { + int resolution; + int min_value; + int max_value; + } XAxisInfo; + + The resolution contains a number in counts/meter. + + The min_val field contains a number that specifies the minimum + value the device reports for this axis. For devices whose mode + is Relative, the min_val field will contain 0. + + The max_val field contains a number that specifies the maximum + value the device reports for this axis. For devices whose mode + is Relative, the max_val field will contain 0. + + The XAttachInfo structure is defined as follows: + typedef struct _XAttachInfo { + int attached; + } XAttachInfo; + + If the device is a slave device, attached specifies the device + ID of the master device this device is attached to. If the + device is not attached to a master device, attached is + Floating. If the device is a master device, attached specifies + the device ID of the master device this device is paired with. + + To free the XDeviceInfo array created by XListInputDevices, use + XFreeDeviceList. diff --git a/man/XOpenDevice.man b/man/XOpenDevice.man new file mode 100644 index 0000000..413f2fd --- /dev/null +++ b/man/XOpenDevice.man @@ -0,0 +1,254 @@ +'\" t +.\" Title: xopendevice +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XOPENDEVICE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XOpenDevice, XCloseDevice \- open or close an extension input device +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XDevice *XOpenDevice( Display *display, + XID device_id); +.fi +.sp +.nf +XCloseDevice( Display *display, + XDevice *device); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device_id + Specifies the id of the device to be opened +.fi +.sp +.nf +device + Specifies the device to be closed +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XOpenDevice request makes an input device accessible to a +client through input extension protocol requests\&. If +successful, it returns a pointer to an XDevice structure\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XCloseDevice request makes an input device inaccessible to +a client through input extension protocol requests\&. Before +terminating, and client that has opened input devices through +the input extension should close them via CloseDevice\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +When a client makes an XCloseDevice request, any active grabs +that the client has on the device are released\&. Any event +selections that the client has are deleted, as well as any +passive grabs\&. If the requesting client is the last client +accessing the device, the server may disable all access by X to +the device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XOpenDevice and XCloseDevice can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +Structures +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDevice structure returned by XOpenDevice contains: + typedef struct { + XID device_id; + int num_classes; + XInputClassInfo *classes; + } XDevice; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The classes field is a pointer to an array of XInputClassInfo +structures\&. Each element of this array contains an event type +base for a class of input supported by the specified device\&. +The num_classes field indicates the number of elements in the +classes array\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XInputClassInfo structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + unsigned char input_class; + unsigned char event_type_base; +} XInputClassInfo; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The input_class field identifies one class of input supported +by the device\&. Defined types include KeyClass, ButtonClass, +ValuatorClass, ProximityClass, FeedbackClass, FocusClass, and +OtherClass\&. The event_type_base identifies the event type of +the first event in that class\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The information contained in the XInputClassInfo structure is +used by macros to obtain the event classes that clients use in +making XSelectExtensionEvent requests\&. Currently defined macros +include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, +DeviceButtonRelese, DeviceMotionNotify, DeviceFocusIn, +DeviceFocusOut, ProximityIn, ProximityOut, DeviceStateNotify, +DeviceMappingNotify, ChangeDeviceNotify, +DevicePointerMotionHint, DeviceButton1Motion, +DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion, +DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton, +DeviceButtonPressGrab, and NoExtensionEvent\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To obtain the proper event class for a particular device, one +of the above macros is invoked using the XDevice structure for +that device\&. For example, + DeviceKeyPress (*device, type, eventclass); +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +returns the DeviceKeyPress event type and the eventclass for +DeviceKeyPress events from the specified device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +This eventclass can then be used in an XSelectExtensionEvent +request to ask the server to send DeviceKeyPress events from +this device\&. When a selected event is received via XNextEvent, +the type can be used for comparison with the type in the event\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist, or is the X keyboard or X pointer\&. This + error may also occur if some other client has caused the + specified device to become the X keyboard or X pointer + device via the XChangeKeyboardDevice or + XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XOpenDevice.txt b/man/XOpenDevice.txt new file mode 100644 index 0000000..fbeb5e7 --- /dev/null +++ b/man/XOpenDevice.txt @@ -0,0 +1,113 @@ +XOPENDEVICE(libmansuffix) +========================= + +NAME +---- + + XOpenDevice, XCloseDevice - open or close an extension input + device + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XDevice *XOpenDevice( Display *display, + XID device_id); + + XCloseDevice( Display *display, + XDevice *device); + + display + Specifies the connection to the X server. + + device_id + Specifies the id of the device to be opened + + device + Specifies the device to be closed + +DESCRIPTION +----------- + + The XOpenDevice request makes an input device accessible to a + client through input extension protocol requests. If + successful, it returns a pointer to an XDevice structure. + + The XCloseDevice request makes an input device inaccessible to + a client through input extension protocol requests. Before + terminating, and client that has opened input devices through + the input extension should close them via CloseDevice. + + When a client makes an XCloseDevice request, any active grabs + that the client has on the device are released. Any event + selections that the client has are deleted, as well as any + passive grabs. If the requesting client is the last client + accessing the device, the server may disable all access by X to + the device. + + XOpenDevice and XCloseDevice can generate a BadDevice error. + +Structures + + The XDevice structure returned by XOpenDevice contains: + typedef struct { + XID device_id; + int num_classes; + XInputClassInfo *classes; + } XDevice; + + The classes field is a pointer to an array of XInputClassInfo + structures. Each element of this array contains an event type + base for a class of input supported by the specified device. + The num_classes field indicates the number of elements in the + classes array. + + The XInputClassInfo structure contains: + + typedef struct { + unsigned char input_class; + unsigned char event_type_base; + } XInputClassInfo; + + The input_class field identifies one class of input supported + by the device. Defined types include KeyClass, ButtonClass, + ValuatorClass, ProximityClass, FeedbackClass, FocusClass, and + OtherClass. The event_type_base identifies the event type of + the first event in that class. + + The information contained in the XInputClassInfo structure is + used by macros to obtain the event classes that clients use in + making XSelectExtensionEvent requests. Currently defined macros + include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, + DeviceButtonRelese, DeviceMotionNotify, DeviceFocusIn, + DeviceFocusOut, ProximityIn, ProximityOut, DeviceStateNotify, + DeviceMappingNotify, ChangeDeviceNotify, + DevicePointerMotionHint, DeviceButton1Motion, + DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion, + DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton, + DeviceButtonPressGrab, and NoExtensionEvent. + + To obtain the proper event class for a particular device, one + of the above macros is invoked using the XDevice structure for + that device. For example, + DeviceKeyPress (*device, type, eventclass); + + returns the DeviceKeyPress event type and the eventclass for + DeviceKeyPress events from the specified device. + + This eventclass can then be used in an XSelectExtensionEvent + request to ask the server to send DeviceKeyPress events from + this device. When a selected event is received via XNextEvent, + the type can be used for comparison with the type in the event. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist, or is the X keyboard or X pointer. This + error may also occur if some other client has caused the + specified device to become the X keyboard or X pointer + device via the XChangeKeyboardDevice or + XChangePointerDevice requests. diff --git a/man/XQueryDeviceState.man b/man/XQueryDeviceState.man new file mode 100644 index 0000000..976fc29 --- /dev/null +++ b/man/XQueryDeviceState.man @@ -0,0 +1,205 @@ +'\" t +.\" Title: xquerydevicestate +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XQUERYDEVICESTATE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XQueryDeviceState \- query the state of an extension input device\&. +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XDeviceState* XQueryDeviceState( Display *display, + XDevice *device); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose state is to be queried\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XQueryDeviceState request queries the state of an input +device\&. The current state of keys and buttons (up or down), and +valuators (current value) on the device is reported by this +request\&. Each key or button is represented by a bit in the +XDeviceState structure that is returned\&. Valuators on the +device report 0 if they are reporting relative information, and +the current value if they are reporting absolute information\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XQueryDeviceState can generate a BadDevice error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Structures: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XDeviceState structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + XID device_id; + int num_classes; + XInputClass *data; +} XDeviceState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XValuatorState structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int *valuators; +} XValuatorState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XKeyState structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; +} XKeyState; +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XButtonState structure contains: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonState; +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XQueryDeviceState.txt b/man/XQueryDeviceState.txt new file mode 100644 index 0000000..41cdd2c --- /dev/null +++ b/man/XQueryDeviceState.txt @@ -0,0 +1,84 @@ +XQUERYDEVICESTATE(libmansuffix) +=============================== + +NAME +---- + + XQueryDeviceState - query the state of an extension input + device. + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XDeviceState* XQueryDeviceState( Display *display, + XDevice *device); + + display + Specifies the connection to the X server. + + device + Specifies the device whose state is to be queried. + +DESCRIPTION +----------- + + The XQueryDeviceState request queries the state of an input + device. The current state of keys and buttons (up or down), and + valuators (current value) on the device is reported by this + request. Each key or button is represented by a bit in the + XDeviceState structure that is returned. Valuators on the + device report 0 if they are reporting relative information, and + the current value if they are reporting absolute information. + + XQueryDeviceState can generate a BadDevice error. + + Structures: + + The XDeviceState structure contains: + + typedef struct { + XID device_id; + int num_classes; + XInputClass *data; + } XDeviceState; + + The XValuatorState structure contains: + + typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int *valuators; + } XValuatorState; + + The XKeyState structure contains: + + typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; + } XKeyState; + + The XButtonState structure contains: + + typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; + } XButtonState; + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests. diff --git a/man/XSelectExtensionEvent.man b/man/XSelectExtensionEvent.man new file mode 100644 index 0000000..e79566a --- /dev/null +++ b/man/XSelectExtensionEvent.man @@ -0,0 +1,241 @@ +'\" t +.\" Title: xselectextensionevent +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 01/18/2012 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSELECTEXTENSIONEVEN" "libmansuffix" "01/18/2012" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSelectExtensionEvent, XGetSelectedExtensionEvents \- select extension events, get the list of currently selected extension events +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XSelectExtensionEvent( Display *display, + Window w, + XEventClass *event_list, + int event_count); +.fi +.sp +.nf +XGetSelectedExtensionEvents( Display *display, + Window w, + int *this_client_event_count_return, + XEventClass **this_client_event_list_return, + int *all_clients_event_count_return, + XEventClass **all_clients_event_list_return); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +w + Specifies the window whose events you are interested in\&. +.fi +.sp +.nf +event_list + Specifies the list of event classes that describe the + events you are interested in\&. +.fi +.sp +.nf +event_count + Specifies the count of event classes in the event list\&. +.fi +.sp +.nf +this_client_event_count_return + Returns the count of event classes selected by this + client\&. +.fi +.sp +.nf +this_client_event_list_return + Returns a pointer to the list of event classes selected + by this client\&. +.fi +.sp +.nf +all_clients_event_count_return + Returns the count of event classes selected by all + clients\&. +.fi +.sp +.nf +all_clients_event_list_return + Returns a pointer to the list of event classes selected + by all clients\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSelectExtensionEvent request causes the X server to report +the events associated with the specified list of event classes\&. +Initially, X will not report any of these events\&. Events are +reported relative to a window\&. If a window is not interested in +a device event, it usually propagates to the closest ancestor +that is interested, unless the do_not_propagate mask prohibits +it\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Multiple clients can select for the same events on the same +window with the following restrictions: + * Multiple clients can select events on the same window + because their event masks are disjoint\&. When the X server + generates an event, it reports it to all interested + clients\&. + * Only one client at a time can select a DeviceButtonPress + event with automatic passive grabbing enabled, which is + associated with the event class DeviceButtonPressGrab\&. To + receive DeviceButtonPress events without automatic passive + grabbing, use event class DeviceButtonPress but do not + specify event class DeviceButtonPressGrab\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The server reports the event to all interested clients\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Information contained in the XDevice structure returned by +XOpenDevice is used by macros to obtain the event classes that +clients use in making XSelectExtensionEvent requests\&. Currently +defined macros include DeviceKeyPress, DeviceKeyRelease, +DeviceButtonPress, DeviceButtonRelese, DeviceMotionNotify, +DeviceFocusIn, DeviceFocusOut, ProximityIn, ProximityOut, +DeviceStateNotify, DeviceMappingNotify, ChangeDeviceNotify, +DevicePointerMotionHint, DeviceButton1Motion, +DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion, +DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton, +DeviceButtonPressGrab, and NoExtensionEvent\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To obtain the proper event class for a particular device, one +of the above macros is invoked using the XDevice structure for +that device\&. For example, + DeviceKeyPress (*device, type, eventclass); +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +returns the DeviceKeyPress event type and the eventclass for +selecting DeviceKeyPress events from this device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSelectExtensionEvent can generate a BadWindow or BadClass +error\&. The XGetSelectedExtensionEvents request reports the +extension events selected by this client and all clients for +the specified window\&. This request returns pointers to two +XEventClass arrays\&. One lists the input extension events +selected by this client from the specified window\&. The other +lists the event classes selected by all clients from the +specified window\&. You should use XFree to free these two +arrays\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetSelectedExtensionEvents can generate a BadWindow error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadClass + A value for an XEventClass is invalid\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSelectExtensionEvent.txt b/man/XSelectExtensionEvent.txt new file mode 100644 index 0000000..95e0ac7 --- /dev/null +++ b/man/XSelectExtensionEvent.txt @@ -0,0 +1,123 @@ +XSELECTEXTENSIONEVENT(libmansuffix) +=================================== + +NAME +---- + + XSelectExtensionEvent, XGetSelectedExtensionEvents - select + extension events, get the list of currently selected extension + events + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XSelectExtensionEvent( Display *display, + Window w, + XEventClass *event_list, + int event_count); + + XGetSelectedExtensionEvents( Display *display, + Window w, + int *this_client_event_count_return, + XEventClass **this_client_event_list_return, + int *all_clients_event_count_return, + XEventClass **all_clients_event_list_return); + + display + Specifies the connection to the X server. + + w + Specifies the window whose events you are interested in. + + event_list + Specifies the list of event classes that describe the + events you are interested in. + + event_count + Specifies the count of event classes in the event list. + + this_client_event_count_return + Returns the count of event classes selected by this + client. + + this_client_event_list_return + Returns a pointer to the list of event classes selected + by this client. + + all_clients_event_count_return + Returns the count of event classes selected by all + clients. + + all_clients_event_list_return + Returns a pointer to the list of event classes selected + by all clients. + +DESCRIPTION +----------- + + The XSelectExtensionEvent request causes the X server to report + the events associated with the specified list of event classes. + Initially, X will not report any of these events. Events are + reported relative to a window. If a window is not interested in + a device event, it usually propagates to the closest ancestor + that is interested, unless the do_not_propagate mask prohibits + it. + + Multiple clients can select for the same events on the same + window with the following restrictions: + * Multiple clients can select events on the same window + because their event masks are disjoint. When the X server + generates an event, it reports it to all interested + clients. + * Only one client at a time can select a DeviceButtonPress + event with automatic passive grabbing enabled, which is + associated with the event class DeviceButtonPressGrab. To + receive DeviceButtonPress events without automatic passive + grabbing, use event class DeviceButtonPress but do not + specify event class DeviceButtonPressGrab. + + The server reports the event to all interested clients. + + Information contained in the XDevice structure returned by + XOpenDevice is used by macros to obtain the event classes that + clients use in making XSelectExtensionEvent requests. Currently + defined macros include DeviceKeyPress, DeviceKeyRelease, + DeviceButtonPress, DeviceButtonRelese, DeviceMotionNotify, + DeviceFocusIn, DeviceFocusOut, ProximityIn, ProximityOut, + DeviceStateNotify, DeviceMappingNotify, ChangeDeviceNotify, + DevicePointerMotionHint, DeviceButton1Motion, + DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion, + DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton, + DeviceButtonPressGrab, and NoExtensionEvent. + + To obtain the proper event class for a particular device, one + of the above macros is invoked using the XDevice structure for + that device. For example, + DeviceKeyPress (*device, type, eventclass); + + returns the DeviceKeyPress event type and the eventclass for + selecting DeviceKeyPress events from this device. + + XSelectExtensionEvent can generate a BadWindow or BadClass + error. The XGetSelectedExtensionEvents request reports the + extension events selected by this client and all clients for + the specified window. This request returns pointers to two + XEventClass arrays. One lists the input extension events + selected by this client from the specified window. The other + lists the event classes selected by all clients from the + specified window. You should use XFree to free these two + arrays. + + XGetSelectedExtensionEvents can generate a BadWindow error. + +DIAGNOSTICS +----------- + + BadWindow + A value for a Window argument does not name a defined + window. + + BadClass + A value for an XEventClass is invalid. diff --git a/man/XSendExtensionEvent.man b/man/XSendExtensionEvent.man new file mode 100644 index 0000000..4d298a5 --- /dev/null +++ b/man/XSendExtensionEvent.man @@ -0,0 +1,206 @@ +'\" t +.\" Title: xsendextensionevent +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSENDEXTENSIONEVENT" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSendExtensionEvent \- send input extension events to a client +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +Status XSendExtensionEvent( Display *display, + XDevice *device, + Window destination, + Bool propagate, + int event_count, + XEventClass *event_list, + XEvent *event_send); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device from which the events are to be + sent\&. +.fi +.sp +.nf +destination + Specifies the window the event is to be sent to\&. You can + pass window id, PointerWindow,or InputFocus\&. +.fi +.sp +.nf +propagate + Specifies a Boolean value that is either True or False\&. +.fi +.sp +.nf +event_count + Specifies the count of XEventClasses in event_list\&. +.fi +.sp +.nf +event_list + Specifies the list of event selections to be used\&. +.fi +.sp +.nf +event_send + Specifies a pointer to the event that is to be sent\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSendExtensionEvent request identifies the destination +window, determines which clients should receive the specified +events, and ignores any active grabs\&. This request requires you +to pass an event class list\&. For a discussion of the valid +event class names, see XOpenDevice(libmansuffix) This +request uses the w argument to identify the destination window +as follows: + * If w is PointerWindow,the destination window is the window + that contains the pointer\&. + * If w is InputFocusand if the focus window contains the + pointer,the destination window is the window that contains + the pointer; otherwise, the destination window is the focus + window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +To determine which clients should receive the specified events, +XSendExtensionEventuses the propagate argument as follows: + * If event_list is the empty set,the event is sent to the + client that created the destination window\&. If that client + no longer exists,no event is sent\&. + * If propagate is False,the event is sent to every client + selecting on destination any of the eventtypes specified by + the event_list array\&. + * If propagate is Trueand no clients have selected on + destination any ofthe events specified by the event_list + array,the destination is replaced with theclosest ancestor + of destination for which some client has selected atype + specified by the event\-list array and for which no + interveningwindow has that type in + itsdo\-not\-propagate\-mask\&. If no such window exists or if + the window isan ancestor of the focus window and + InputFocuswas originally specifiedas the destination, the + event is not sent to any clients\&. Otherwise, the event is + reported to every client selecting on the finaldestination + any of the events specified in the event_list array\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The event in the XEventstructure must be one of the events +defined by the input extension (or a BadValueerror results) so +that the X server can correctly byte\-swapthe contents as +necessary\&. The contents of the event areotherwise unaltered and +unchecked by the X server except to force send_event to Truein +the forwarded event and to set the serial number in the event +correctly\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSendExtensionEventreturns zero if the conversion to wire +protocol format failedand returns nonzero +otherwise\&.XSendExtensionEventcan generate BadClass, BadDevice, +BadValue, and BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + window\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSendExtensionEvent.txt b/man/XSendExtensionEvent.txt new file mode 100644 index 0000000..77051a5 --- /dev/null +++ b/man/XSendExtensionEvent.txt @@ -0,0 +1,114 @@ +XSENDEXTENSIONEVENT(libmansuffix) +================================= + +NAME +---- + + XSendExtensionEvent - send input extension events to a client + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + Status XSendExtensionEvent( Display *display, + XDevice *device, + Window destination, + Bool propagate, + int event_count, + XEventClass *event_list, + XEvent *event_send); + + display + Specifies the connection to the X server. + + device + Specifies the device from which the events are to be + sent. + + destination + Specifies the window the event is to be sent to. You can + pass window id, PointerWindow,or InputFocus. + + propagate + Specifies a Boolean value that is either True or False. + + event_count + Specifies the count of XEventClasses in event_list. + + event_list + Specifies the list of event selections to be used. + + event_send + Specifies a pointer to the event that is to be sent. + +DESCRIPTION +----------- + + The XSendExtensionEvent request identifies the destination + window, determines which clients should receive the specified + events, and ignores any active grabs. This request requires you + to pass an event class list. For a discussion of the valid + event class names, see XOpenDevice(libmansuffix) This + request uses the w argument to identify the destination window + as follows: + * If w is PointerWindow,the destination window is the window + that contains the pointer. + * If w is InputFocusand if the focus window contains the + pointer,the destination window is the window that contains + the pointer; otherwise, the destination window is the focus + window. + + To determine which clients should receive the specified events, + XSendExtensionEventuses the propagate argument as follows: + * If event_list is the empty set,the event is sent to the + client that created the destination window. If that client + no longer exists,no event is sent. + * If propagate is False,the event is sent to every client + selecting on destination any of the eventtypes specified by + the event_list array. + * If propagate is Trueand no clients have selected on + destination any ofthe events specified by the event_list + array,the destination is replaced with theclosest ancestor + of destination for which some client has selected atype + specified by the event-list array and for which no + interveningwindow has that type in + itsdo-not-propagate-mask. If no such window exists or if + the window isan ancestor of the focus window and + InputFocuswas originally specifiedas the destination, the + event is not sent to any clients. Otherwise, the event is + reported to every client selecting on the finaldestination + any of the events specified in the event_list array. + + The event in the XEventstructure must be one of the events + defined by the input extension (or a BadValueerror results) so + that the X server can correctly byte-swapthe contents as + necessary. The contents of the event areotherwise unaltered and + unchecked by the X server except to force send_event to Truein + the forwarded event and to set the serial number in the event + correctly. + + XSendExtensionEventreturns zero if the conversion to wire + protocol format failedand returns nonzero + otherwise.XSendExtensionEventcan generate BadClass, BadDevice, + BadValue, and BadWindow errors. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + window. diff --git a/man/XSetDeviceButtonMapping.man b/man/XSetDeviceButtonMapping.man new file mode 100644 index 0000000..223b6d7 --- /dev/null +++ b/man/XSetDeviceButtonMapping.man @@ -0,0 +1,192 @@ +'\" t +.\" Title: xsetdevicebuttonmapping +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSETDEVICEBUTTONMAPP" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSetDeviceButtonMapping, XGetDeviceButtonMapping \- query or change device button mappings +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +int XSetDeviceButtonMapping( Display *display, + XDevice *device, + unsigned char map[], + int nmap); +.fi +.sp +.nf +int XGetDeviceButtonMapping( Display *display, + XDevice *device, + unsigned char map_return[], + int nmap); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose button mapping is to be + queried or changed\&. +.fi +.sp +.nf +map + Specifies the mapping list\&. +.fi +.sp +.nf +map_return + Returns the mapping list\&. +.fi +.sp +.nf +nmap + Specifies the number of items in the mapping list\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSetDeviceButtonMapping request sets the mapping of the +specified device\&. If it succeeds, the X server generates a +DeviceMappingNotify event, and XSetDeviceButtonMapping returns +MappingSuccess\&. Element map[i] defines the logical button +number for the physical button i+1\&. The length of the list must +be the same as XGetDeviceButtonMapping would return, or a +BadValue error results\&. A zero element disables a button, and +elements are not restricted in value by the number of physical +buttons\&. However, no two elements can have the same nonzero +value, or a BadValue error results\&. If any of the buttons to be +altered are logically in the down state, +XSetDeviceButtonMapping returns MappingBusy, and the mapping is +not changed\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceButtonMapping can generate BadDevice, BadMatch, and +BadValue errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceButtonMapping request returns the current mapping +of the specified device\&. Buttons are numbered starting from +one\&.XGetDeviceButtonMapping returns the number of physical +buttons actually on the device\&. The nominal mapping for a +device is map[i]=i+1\&. The nmap argument specifies the length of +the array where the device mapping is returned, and only the +first nmap elements are returned in map_return\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceButtonMapping can generate BadDevice or BadMatch +errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceButtonMapping or + XSetDeviceButtonMapping request was made specifying a + device that has no buttons\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.sp +.if n \{\ +.RS 4 +.\} +.nf +XChangeDeviceKeyboardControl(libmansuffix), XChangeDeviceKeyMapping(libmansuffix), +XChangeDeviceModifierMapping(libmansuffix) +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSetDeviceButtonMapping.txt b/man/XSetDeviceButtonMapping.txt new file mode 100644 index 0000000..4c1251c --- /dev/null +++ b/man/XSetDeviceButtonMapping.txt @@ -0,0 +1,97 @@ +XSETDEVICEBUTTONMAPPING(libmansuffix) +===================================== + +NAME +---- + + XSetDeviceButtonMapping, XGetDeviceButtonMapping - query or + change device button mappings + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + int XSetDeviceButtonMapping( Display *display, + XDevice *device, + unsigned char map[], + int nmap); + + int XGetDeviceButtonMapping( Display *display, + XDevice *device, + unsigned char map_return[], + int nmap); + + display + Specifies the connection to the X server. + + device + Specifies the device whose button mapping is to be + queried or changed. + + map + Specifies the mapping list. + + map_return + Returns the mapping list. + + nmap + Specifies the number of items in the mapping list. + +DESCRIPTION +----------- + + The XSetDeviceButtonMapping request sets the mapping of the + specified device. If it succeeds, the X server generates a + DeviceMappingNotify event, and XSetDeviceButtonMapping returns + MappingSuccess. Element map[i] defines the logical button + number for the physical button i+1. The length of the list must + be the same as XGetDeviceButtonMapping would return, or a + BadValue error results. A zero element disables a button, and + elements are not restricted in value by the number of physical + buttons. However, no two elements can have the same nonzero + value, or a BadValue error results. If any of the buttons to be + altered are logically in the down state, + XSetDeviceButtonMapping returns MappingBusy, and the mapping is + not changed. + + XSetDeviceButtonMapping can generate BadDevice, BadMatch, and + BadValue errors. + + The XGetDeviceButtonMapping request returns the current mapping + of the specified device. Buttons are numbered starting from + one.XGetDeviceButtonMapping returns the number of physical + buttons actually on the device. The nominal mapping for a + device is map[i]=i+1. The nmap argument specifies the length of + the array where the device mapping is returned, and only the + first nmap elements are returned in map_return. + + XGetDeviceButtonMapping can generate BadDevice or BadMatch + errors. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadMatch + This error may occur if an XGetDeviceButtonMapping or + XSetDeviceButtonMapping request was made specifying a + device that has no buttons. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + +SEE ALSO +-------- + + XChangeDeviceKeyboardControl(libmansuffix), XChangeDeviceKeyMapping(libmansuffix), + XChangeDeviceModifierMapping(libmansuffix) diff --git a/man/XSetDeviceFocus.man b/man/XSetDeviceFocus.man new file mode 100644 index 0000000..850802b --- /dev/null +++ b/man/XSetDeviceFocus.man @@ -0,0 +1,297 @@ +'\" t +.\" Title: xsetdevicefocus +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSETDEVICEFOCUS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSetDeviceFocus, XGetDeviceFocus \- control extension input device focus +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XSetDeviceFocus( Display *display, + XDevice *device, + Window focus, + int revert_to, + Time time); +.fi +.sp +.nf +XGetDeviceFocus( Display *display, + XDevice *device, + Window *focus_return, + int *revert_to_return, + int * time_return); +.fi +.sp +Arguments +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose focus is to be queried or + changed\&. +.fi +.sp +.nf +focus + Specifies the window, PointerRoot, FollowKeyboard,or + None\&. +.fi +.sp +.nf +focus_return + Returns the focus window, PointerRoot, FollowKeyboard,or + None\&. +.fi +.sp +.nf +revert_to + Specifies where the input focus reverts to if the window + becomes notviewable\&.You can pass RevertToParent, + RevertToPointerRoot, RevertToFollowKeyboard,or + RevertToNone\&. +.fi +.sp +.nf +revert_to_return + Returns the current focus state RevertToParent, + RevertToPointerRoot, RevertToFollowKeyboard,or + RevertToNone\&. +.fi +.sp +.nf +time_return + Returns the last_focus_time for the device\&. +.fi +.sp +.nf +time + Specifies the time\&.You can pass either a timestamp or + CurrentTime\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSetDeviceFocus request changes the focus of the specified +device and its last\-focus\-change time\&. It has no effect if the +specified time is earlier than the current last\-focus\-change +time or is later than the current X server time\&. Otherwise, the +last\-focus\-change time is set to the specified time CurrentTime +is replaced by the current X server time)\&. XSetDeviceFocus +causes the X server to generate DeviceFocusIn and +DeviceFocusOut events\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Depending on the focus argument, the following occurs: + * If focus is None , all device events are discarded until a + new focus window is set, and the revert_to argument is + ignored\&. + * If focus is a window, it becomes the device\*(Aqs focus window\&. + If a generated device event would normally be reported to + this window or one of its inferiors, the event is reported + as usual\&. Otherwise, the event is reported relative to the + focus window\&. + * If focus is PointerRoot, the focus window is dynamically + taken to be the root window of whatever screen the pointer + is on at each event from the specified device\&. In this + case, the revert_to argument is ignored\&. + * If focus is FollowKeyboard, the focus window is dynamically + taken to be the window to which the X keyboard focus is set + at each input event\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The specified focus window must be viewable at the time +XSetDeviceFocus is called, or a BadMatch error results\&. If the +focus window later becomes not viewable, the X server evaluates +the revert_to argument to determine the new focus window as +follows: + * If revert_to is RevertToParent, the focus reverts to the + parent (or the closest viewable ancestor), and the new + revert_to value is taken to be RevertToNone\&. + * If revert_to is RevertToPointerRoot, + RevertToFollowKeyboard, or RevertToNone, the focus reverts + to PointerRoot, FollowKeyboard, or None, respectively\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +When the focus reverts, the X server generates DeviceFocusIn +and DeviceFocusOut events, but the last\-focus\-change time is +not affected\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Input extension devices are not required to support the ability +to be focused\&. Attempting to set the focus of a device that +does not support this request will result in a BadMatch error\&. +Whether or not given device can support this request can be +determined by the information returned by XOpenDevice\&. For +those devices that support focus, XOpenDevice will return an +XInputClassInfo structure with the input_class field equal to +the constant FocusClass (defined in the file XI\&.h)\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and +BadWindow errors\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XGetDeviceFocus request returns the focus window and the +current focus state\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +Not all input extension devices can be focused\&. Attempting to +query the focus state of a device that can\*(Aqt be focused results +in a BadMatch error\&. A device that can be focused returns +information for input Class Focus when an XOpenDevice request +is made\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XGetDeviceFocus can generate BadDevice, and BadMatch errors\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if the + specified device is the X keyboard or X pointer device\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + Some numeric value falls outside the range of values + accepted by the request\&. Unless a specific range is + specified for an argument, the full range defined by the + argument\*(Aqs type is accepted\&. Any argument defined as a + set of alternatives can generate this error\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadWindow + A value for a Window argument does not name a defined + Window\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XGetDeviceFocus or + XSetDeviceFocus request was made specifying a device + that the server implementation does not allow to be + focused\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSetDeviceFocus.txt b/man/XSetDeviceFocus.txt new file mode 100644 index 0000000..2d92a9f --- /dev/null +++ b/man/XSetDeviceFocus.txt @@ -0,0 +1,154 @@ +XSETDEVICEFOCUS(libmansuffix) +============================= + +NAME +---- + + XSetDeviceFocus, XGetDeviceFocus - control extension input + device focus + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XSetDeviceFocus( Display *display, + XDevice *device, + Window focus, + int revert_to, + Time time); + + XGetDeviceFocus( Display *display, + XDevice *device, + Window *focus_return, + int *revert_to_return, + int * time_return); + +Arguments + + display + Specifies the connection to the X server. + + device + Specifies the device whose focus is to be queried or + changed. + + focus + Specifies the window, PointerRoot, FollowKeyboard,or + None. + + focus_return + Returns the focus window, PointerRoot, FollowKeyboard,or + None. + + revert_to + Specifies where the input focus reverts to if the window + becomes notviewable.You can pass RevertToParent, + RevertToPointerRoot, RevertToFollowKeyboard,or + RevertToNone. + + revert_to_return + Returns the current focus state RevertToParent, + RevertToPointerRoot, RevertToFollowKeyboard,or + RevertToNone. + + time_return + Returns the last_focus_time for the device. + + time + Specifies the time.You can pass either a timestamp or + CurrentTime. + +DESCRIPTION +----------- + + The XSetDeviceFocus request changes the focus of the specified + device and its last-focus-change time. It has no effect if the + specified time is earlier than the current last-focus-change + time or is later than the current X server time. Otherwise, the + last-focus-change time is set to the specified time CurrentTime + is replaced by the current X server time). XSetDeviceFocus + causes the X server to generate DeviceFocusIn and + DeviceFocusOut events. + + Depending on the focus argument, the following occurs: + * If focus is None , all device events are discarded until a + new focus window is set, and the revert_to argument is + ignored. + * If focus is a window, it becomes the device's focus window. + If a generated device event would normally be reported to + this window or one of its inferiors, the event is reported + as usual. Otherwise, the event is reported relative to the + focus window. + * If focus is PointerRoot, the focus window is dynamically + taken to be the root window of whatever screen the pointer + is on at each event from the specified device. In this + case, the revert_to argument is ignored. + * If focus is FollowKeyboard, the focus window is dynamically + taken to be the window to which the X keyboard focus is set + at each input event. + + The specified focus window must be viewable at the time + XSetDeviceFocus is called, or a BadMatch error results. If the + focus window later becomes not viewable, the X server evaluates + the revert_to argument to determine the new focus window as + follows: + * If revert_to is RevertToParent, the focus reverts to the + parent (or the closest viewable ancestor), and the new + revert_to value is taken to be RevertToNone. + * If revert_to is RevertToPointerRoot, + RevertToFollowKeyboard, or RevertToNone, the focus reverts + to PointerRoot, FollowKeyboard, or None, respectively. + + When the focus reverts, the X server generates DeviceFocusIn + and DeviceFocusOut events, but the last-focus-change time is + not affected. + + Input extension devices are not required to support the ability + to be focused. Attempting to set the focus of a device that + does not support this request will result in a BadMatch error. + Whether or not given device can support this request can be + determined by the information returned by XOpenDevice. For + those devices that support focus, XOpenDevice will return an + XInputClassInfo structure with the input_class field equal to + the constant FocusClass (defined in the file XI.h). + + XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and + BadWindow errors. + + The XGetDeviceFocus request returns the focus window and the + current focus state. + + Not all input extension devices can be focused. Attempting to + query the focus state of a device that can't be focused results + in a BadMatch error. A device that can be focused returns + information for input Class Focus when an XOpenDevice request + is made. + + XGetDeviceFocus can generate BadDevice, and BadMatch errors. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if the + specified device is the X keyboard or X pointer device. + + BadValue + Some numeric value falls outside the range of values + accepted by the request. Unless a specific range is + specified for an argument, the full range defined by the + argument's type is accepted. Any argument defined as a + set of alternatives can generate this error. + + BadWindow + A value for a Window argument does not name a defined + Window. + + BadMatch + This error may occur if an XGetDeviceFocus or + XSetDeviceFocus request was made specifying a device + that the server implementation does not allow to be + focused. diff --git a/man/XSetDeviceMode.man b/man/XSetDeviceMode.man new file mode 100644 index 0000000..0679271 --- /dev/null +++ b/man/XSetDeviceMode.man @@ -0,0 +1,125 @@ +'\" t +.\" Title: xsetdevicemode +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSETDEVICEMODE" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSetDeviceMode \- change the mode of a device +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XSetDeviceMode( Display *display, + XDevice *device, + int mode); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose mode is to be changed\&. +.fi +.sp +.nf +mode + Specifies the mode\&.You can pass Absolute,or Relative\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSetDeviceMode request changes the mode of an input device +that is capable of reporting either absolute positional +information or relative motion information\&. Not all input +devices are capable of reporting motion data, and not all are +capable of changing modes from Absolute to Relative\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceMode can generate a BadDevice or BadMode error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XSetDeviceMode request is + made specifying a device that has no valuators and + reports no axes of motion\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMode + An invalid mode was specified\&. This error will also be + returned if the specified device is not capable of + supporting the XSetDeviceMode request\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSetDeviceMode.txt b/man/XSetDeviceMode.txt new file mode 100644 index 0000000..947ccfc --- /dev/null +++ b/man/XSetDeviceMode.txt @@ -0,0 +1,57 @@ +XSETDEVICEMODE(libmansuffix) +============================ + +NAME +---- + + XSetDeviceMode - change the mode of a device + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XSetDeviceMode( Display *display, + XDevice *device, + int mode); + + display + Specifies the connection to the X server. + + device + Specifies the device whose mode is to be changed. + + mode + Specifies the mode.You can pass Absolute,or Relative. + +DESCRIPTION +----------- + + The XSetDeviceMode request changes the mode of an input device + that is capable of reporting either absolute positional + information or relative motion information. Not all input + devices are capable of reporting motion data, and not all are + capable of changing modes from Absolute to Relative. + + XSetDeviceMode can generate a BadDevice or BadMode error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. This error may also occur if some + other client has caused the specified device to become + the X keyboard or X pointer device via the + XChangeKeyboardDevice or XChangePointerDevice requests. + + BadMatch + This error may occur if an XSetDeviceMode request is + made specifying a device that has no valuators and + reports no axes of motion. + + BadMode + An invalid mode was specified. This error will also be + returned if the specified device is not capable of + supporting the XSetDeviceMode request. diff --git a/man/XSetDeviceModifierMapping.man b/man/XSetDeviceModifierMapping.man new file mode 100644 index 0000000..3362ea9 --- /dev/null +++ b/man/XSetDeviceModifierMapping.man @@ -0,0 +1 @@ +.so XGetDeviceModifierMapping.libmansuffix diff --git a/man/XSetDeviceValuators.man b/man/XSetDeviceValuators.man new file mode 100644 index 0000000..d24326e --- /dev/null +++ b/man/XSetDeviceValuators.man @@ -0,0 +1,153 @@ +'\" t +.\" Title: xsetdevicevaluators +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/23/2011 +.\" Manual: [FIXME: manual] +.\" Source: [FIXME: source] +.\" Language: English +.\" +.TH "XSETDEVICEVALUATORS" "libmansuffix" "09/23/2011" "[FIXME: source]" "[FIXME: manual]" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +XSetDeviceValuators \- initialize the valuators on an extension input device +.SH "SYNOPSIS" +.sp +.nf +#include <X11/extensions/XInput\&.h> +.fi +.sp +.nf +XSetDeviceValuators( Display *display, + XDevice *device, + int *valuators, + int first_valuator, + int num_valuators); +.fi +.sp +.nf +display + Specifies the connection to the X server\&. +.fi +.sp +.nf +device + Specifies the device whose valuators are to be + initialized\&. +.fi +.sp +.nf +valuators + Specifies a pointer to an array of integer values to be + used to initialize thedevice valuators\&. +.fi +.sp +.nf +first_valuator + Specifies the first valuator to be set\&. Valuators are + numbered beginning withzero\&. +.fi +.sp +.nf +num_valuators + Specifies the number of valuators to be set\&. +.fi +.SH "DESCRIPTION" +.sp +.if n \{\ +.RS 4 +.\} +.nf +The XSetDeviceValuators request sets the current values of the +valuators of an input device\&. The valuators in the range +first_valuator to (first_valuator + num_valuators) are set to +the specified values\&. Valuators are numbered beginning with 0\&. +Not all input devices support initialization of valuator +values\&. If this request is made to a device that does not +support valuators initialization, a BadMatch error will occur\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +If the request succeeds, a status of Success is returned\&. If +another client has the device grabbed, a status of +AlreadyGrabbed is returned\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +XSetDeviceValuators can generate a BadLength, BadDevice, +BadMatch, or BadValue error\&. +.fi +.if n \{\ +.RE +.\} +.SH "DIAGNOSTICS" +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadDevice + An invalid device was specified\&. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadMatch + This error may occur if an XSetDeviceValuators request + is made specifying a device that has no valuators and + reports no axes of motion, or if such a request is made + specifying a device that does not support valuator + initialization\&. +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +BadValue + An invalid first_valuator or num_valuators values was + specified\&. +.fi +.if n \{\ +.RE +.\} diff --git a/man/XSetDeviceValuators.txt b/man/XSetDeviceValuators.txt new file mode 100644 index 0000000..1116cea --- /dev/null +++ b/man/XSetDeviceValuators.txt @@ -0,0 +1,74 @@ +XSETDEVICEVALUATORS(libmansuffix) +================================= + +NAME +---- + + XSetDeviceValuators - initialize the valuators on an extension input device + +SYNOPSIS +-------- + + #include <X11/extensions/XInput.h> + + XSetDeviceValuators( Display *display, + XDevice *device, + int *valuators, + int first_valuator, + int num_valuators); + + display + Specifies the connection to the X server. + + device + Specifies the device whose valuators are to be + initialized. + + valuators + Specifies a pointer to an array of integer values to be + used to initialize thedevice valuators. + + first_valuator + Specifies the first valuator to be set. Valuators are + numbered beginning withzero. + + num_valuators + Specifies the number of valuators to be set. + +DESCRIPTION +----------- + + The XSetDeviceValuators request sets the current values of the + valuators of an input device. The valuators in the range + first_valuator to (first_valuator + num_valuators) are set to + the specified values. Valuators are numbered beginning with 0. + Not all input devices support initialization of valuator + values. If this request is made to a device that does not + support valuators initialization, a BadMatch error will occur. + + If the request succeeds, a status of Success is returned. If + another client has the device grabbed, a status of + AlreadyGrabbed is returned. + + XSetDeviceValuators can generate a BadLength, BadDevice, + BadMatch, or BadValue error. + +DIAGNOSTICS +----------- + + BadDevice + An invalid device was specified. The specified device + does not exist or has not been opened by this client via + XOpenInputDevice. + + BadMatch + This error may occur if an XSetDeviceValuators request + is made specifying a device that has no valuators and + reports no axes of motion, or if such a request is made + specifying a device that does not support valuator + initialization. + + BadValue + An invalid first_valuator or num_valuators values was + specified. + diff --git a/man/XUngrabDevice.man b/man/XUngrabDevice.man new file mode 100644 index 0000000..92a0ec7 --- /dev/null +++ b/man/XUngrabDevice.man @@ -0,0 +1 @@ +.so XGrabDevice.libmansuffix diff --git a/man/XUngrabDeviceButton.man b/man/XUngrabDeviceButton.man new file mode 100644 index 0000000..1131aaf --- /dev/null +++ b/man/XUngrabDeviceButton.man @@ -0,0 +1 @@ +.so XGrabDeviceButton.libmansuffix diff --git a/man/XUngrabDeviceKey.man b/man/XUngrabDeviceKey.man new file mode 100644 index 0000000..e57f8ef --- /dev/null +++ b/man/XUngrabDeviceKey.man @@ -0,0 +1 @@ +.so XGrabDeviceKey.libmansuffix diff --git a/packaging/libXi.spec b/packaging/libXi.spec new file mode 100755 index 0000000..a27897f --- /dev/null +++ b/packaging/libXi.spec @@ -0,0 +1,92 @@ +%global tarball libXi +#global gitdate 20111222 +#global gitversion ae0187c87 + +Summary: X.Org X11 libXi runtime library +Name: libXi +Version: 1.6.1 +Release: 1 +License: MIT +Group: System Environment/Libraries +URL: http://www.x.org + +Source0: %{name}-%{version}.tar.gz + + +BuildRequires: autoconf automake libtool +BuildRequires: xorg-x11-xutils-dev +BuildRequires: pkgconfig(xorg-macros) +BuildRequires: pkgconfig(xproto) +BuildRequires: pkgconfig(inputproto) >= 2.1.99.6 +BuildRequires: libX11-devel >= 1.4.99.1 +BuildRequires: libXext-devel + +Requires: libX11 >= 1.4.99.1 + +%description +X.Org X11 libXi runtime library + +%package devel +Summary: X.Org X11 libXi development package +Group: Development/Libraries +Provides: libxi-devel +Requires: %{name} = %{version}-%{release} +# required by xi.pc +Requires: pkgconfig(xorg-macros) +Requires: pkgconfig(xproto) +Requires: pkgconfig(inputproto) >= 2.1.99.6 +Requires: pkgconfig + +%description devel +X.Org X11 libXi development package + +%prep +%setup -q + +# Disable static library creation by default. +%define with_static 0 + +%build +autoreconf -v --install || exit 1 +%reconfigure --disable-specs \ + --disable-static \ + CFLAGS="${CFLAGS} " \ + LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" + +make %{?jobs:-j%jobs} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p %{buildroot}/usr/share/license +cp -af COPYING %{buildroot}/usr/share/license/%{name} +make install DESTDIR=$RPM_BUILD_ROOT + +# We intentionally don't ship *.la files +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%remove_docs + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +/usr/share/license/%{name} +%doc COPYING +%{_libdir}/libXi.so.6 +%{_libdir}/libXi.so.6.1.0 + +%files devel +%defattr(-,root,root,-) +%if %{with_static} +%{_libdir}/libXi.a +%endif +%{_includedir}/X11/extensions/XInput.h +%{_includedir}/X11/extensions/XInput2.h +%{_libdir}/libXi.so +%{_libdir}/pkgconfig/xi.pc +#%dir %{_mandir}/man3x +#%{_mandir}/man3/*.3* \ No newline at end of file diff --git a/specs/Makefile.am b/specs/Makefile.am new file mode 100644 index 0000000..287f6f0 --- /dev/null +++ b/specs/Makefile.am @@ -0,0 +1,16 @@ + +if ENABLE_SPECS + +# Main DocBook/XML files (DOCTYPE book) +docbook = inputlib.xml + +# Included chapters, appendix, images +chapters = library.xml encoding.xml + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir) + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif ENABLE_SPECS diff --git a/specs/encoding.xml b/specs/encoding.xml new file mode 100644 index 0000000..33318d1 --- /dev/null +++ b/specs/encoding.xml @@ -0,0 +1,2312 @@ +<appendix id="Input_Extension_Protocol_Encoding"> +<title>Input Extension Protocol Encoding + +Syntactic Conventions + + + +All numbers are in decimal, +unless prefixed with #x, in which case they are in hexadecimal (base 16). + + + +The general syntax used to describe requests, replies, errors, events, and +compound types is: + + + + +NameofThing + encode-form + ... + encode-form + +Each encode-form describes a single component. + + + +For components described in the protocol as: + + + + +name: TYPE + +the encode-form is: + + + + + + +N TYPE name + +N is the number of bytes occupied in the data stream, +and TYPE is the interpretation of those bytes. +For example, + + + + + + +depth: CARD8 + +becomes: + + + + + + +1 CARD8 depth + +For components with a static numeric value the encode-form is: + + + + + + +N value name + +The value is always interpreted as an N-byte unsigned integer. +For example, +the first two bytes of a Window error are always zero (indicating an +error in general) and three (indicating the Window error in particular): + + + + + + +1 0 Error +1 3 code + +For components described in the protocol as: + + + + +name: {Name1, ..., NameI} + + + + +the encode-form is: + + + + + + +N name + value1 Name1 + ... + valueI NameI + +The value is always interpreted as an N-byte unsigned integer. +Note that the size of N is sometimes larger than that strictly required +to encode the values. +For example: + + + + +class: {InputOutput, InputOnly, CopyFromParent} + + + + +becomes: + + + + + + +2 class + 0 CopyFromParent + 1 InputOutput + 2 InputOnly + +For components described in the protocol as: + + + + +NAME: TYPE or Alternative1 ... or AlternativeI + + + + +the encode-form is: + + + + + + +N TYPE NAME + value1 Alternative1 + ... + valueI AlternativeI + +The alternative values are guaranteed not to conflict with the encoding +of TYPE. +For example: + + + + +destination: WINDOW or PointerWindow or InputFocus + + + + +becomes: + + + + + + +4 WINDOW destination + 0 PointerWindow + 1 InputFocus + +For components described in the protocol as: + + + + + + +value-mask: BITMASK + +the encode-form is: + + + + + + +N BITMASK value-mask + mask1 mask-name1 + ... + maskI mask-nameI + +The individual bits in the mask are specified and named, +and N is 2 or 4. +The most-significant bit in a BITMASK is reserved for use in defining +chained (multiword) bitmasks, as extensions augment existing core requests. +The precise interpretation of this bit is not yet defined here, +although a probable mechanism is that a 1-bit indicates that another N bytes +of bitmask follows, with bits within the overall mask still interpreted +from least-significant to most-significant with an N-byte unit, with N-byte units +interpreted in stream order, and with the overall mask being byte-swapped +in individual N-byte units. + + + +For LISTofVALUE encodings, the request is followed by a section of the form: + + + + + + +VALUEs + encode-form + ... + encode-form + +listing an encode-form for each VALUE. +The NAME in each encode-form keys to the corresponding BITMASK bit. +The encoding of a VALUE always occupies four bytes, +but the number of bytes specified in the encoding-form indicates how +many of the least-significant bytes are actually used; +the remaining bytes are unused and their values do not matter. + + + +In various cases, the number of bytes occupied by a component will be specified +by a lowercase single-letter variable name instead of a specific numeric +value, and often some other component will have its value specified as a +simple numeric expression involving these variables. +Components specified with such expressions are always interpreted +as unsigned integers. +The scope of such variables is always just the enclosing request, reply, +error, event, or compound type structure. +For example: + + + + + + +2 3+n request length +4n LISTofPOINT points + +For unused bytes (the values of the bytes are undefined and do not matter), +the encode-form is: + + + + + + +N unused + +If the number of unused bytes is variable, the encode-form typically is: + + + + + + +p unused, p=pad(E) + +where E is some expression, +and pad(E) is the number of bytes needed to round E up to a multiple of four. + + + + + + +pad(E) = (4 - (E mod 4)) mod 4 + + +Common Types + + + + +LISTofFOO + + + + +In this document the LISTof notation strictly means some number of repetitions +of the FOO encoding; +the actual length of the list is encoded elsewhere. + + + + + +SETofFOO + + + + +A set is always represented by a bitmask, with a 1-bit indicating presence in +the set. + + + + + +BITMASK: CARD32 + + + +WINDOW: CARD32 + + + +BYTE: 8-bit value + + + +INT8: 8-bit signed integer + + + +INT16: 16-bit signed integer + + + +INT32: 32-bit signed integer + + + +CARD8: 8-bit unsigned integer + + + +CARD16: 16-bit unsigned integer + + + +CARD32: 32-bit unsigned integer + + + +TIMESTAMP: CARD32 + + + +EVENTCLASS: CARD32 + + + + + + +INPUTCLASS + 0 KeyClass + 1 ButtonClass + 2 ValuatorClass + 3 FeedbackClass + 4 ProximityClass + 5 FocusClass + 6 OtherClass + + + + + + + +INPUTCLASS + 0 KbdFeedbackClass + 1 PtrFeedbackClass + 2 StringFeedbackClass + 3 IntegerFeedbackClass + 4 LedFeedbackClass + 5 BellFeedbackClass + + + + + + + +INPUTINFO + 0 KEYINFO + 1 BUTTONINFO + 2 VALUATORINFO + + + + + + + +DEVICEMODE + 0 Relative + 1 Absolute + + + + + + + +PROXIMITYSTATE + 0 InProximity + 1 OutOfProximity + + + + + + + +BOOL + 0 False + 1 True + + + + +KEYSYM: CARD32 + + + +KEYCODE: CARD8 + + + +BUTTON: CARD8 + + + + + + +SETofKEYBUTMASK + #x0001 Shift + #x0002 Lock + #x0004 Control + #x0008 Mod1 + #x0010 Mod2 + #x0020 Mod3 + #x0040 Mod4 + #x0080 Mod5 + #x0100 Button1 + #x0200 Button2 + #x0400 Button3 + #x0800 Button4 + #x1000 Button5 + #xe000 unused but must be zero + + + + + + + +SETofKEYMASK + encodings are the same as for SETofKEYBUTMASK, except with + #xff00 unused but must be zero + + + + +STRING8: LISTofCARD8 + + + + + + +STR + 1 n length of name in bytes + n STRING8 name + + +Errors + + + + + + + +Request + 1 0 Error + 1 1 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Value + 1 0 Error + 1 2 code + 2 CARD16 sequence number + 4 <32-bits> bad value + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Window + 1 0 Error + 1 3 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Match + 1 0 Error + 1 8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Access + 1 0 Error + 1 10 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Alloc + 1 0 Error + 1 11 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Name + 1 0 Error + 1 15 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Device + 1 0 Error + 1 CARD8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Event + 1 0 Error + 1 CARD8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Mode + 1 0 Error + 1 CARD8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + + + +Class + 1 0 Error + 1 CARD8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + +Keyboards + + + + +KEYCODE values are always greater than 7 (and less than 256). + + + +KEYSYM values with the bit #x10000000 set are reserved as vendor-specific. + + + +The names and encodings of the standard KEYSYM values are contained in + +appendix F. + + + + +Pointers + + + + +BUTTON values are numbered starting with one. + + + + +Requests + + + + + + + +GetExtensionVersion + 1 CARD8 input extension opcode + 1 1 GetExtensionVersion opcode + 2 2+(n+p)/4 request length + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + + + + + => + 1 1 Reply + 1 1 GetExtensionVersion opcode + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 major version + 2 CARD16 minor version + 1 BOOL present + 19 unused + + + + + + + +ListInputDevices + 1 CARD8 input extension opcode + 1 2 ListInputDevices opcode + 2 1 request length + + + + + => + 1 1 Reply + 1 2 ListInputDevices opcode + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 1 CARD8 number of input devices + 23 unused + n LISTofDEVICEINFO info for each input device + p unused, p=pad(n) + + + + + + + + DEVICEINFO + 4 CARD32 device type + 1 CARD8 device id + 1 CARD8 number of input classes this device reports + 1 CARD8 device use + 0 IsXPointer + 1 IsXKeyboard + 2 IsXExtensionDevice + 1 unused + n LISTofINPUTINFO input info for each input class + m STR name + p unused, p=pad(m) + + + + + + + + INPUTINFO KEYINFO or BUTTONINFO or VALUATORINFO + + + + + + + + KEYINFO + 1 0 class id + 1 8 length + 1 KEYCODE minimum keycode + 1 KEYCODE maximum keycode + 2 CARD16 number of keys + 2 unused + + + + + + + +BUTTONINFO + 1 1 class id + 1 4 length + 2 CARD16 number of buttons + + + + + + + +VALUATORINFO + 1 2 class id + 1 8+12n length + 1 n number of axes + 1 SETofDEVICEMODE mode + 4 CARD32 size of motion buffer + 12n LISTofAXISINFO valuator limits + + + + + + + +AXISINFO + 4 CARD32 resolution + 4 CARD32 minimum value + 4 CARD32 maximum value + + + + + + + +OpenDevice + 1 CARD8 input extension opcode + 1 3 OpenDevice opcode + 2 2 request length + 1 CARD8 device id + 3 unused + + + + + => + 1 1 Reply + 1 3 OpenDevice opcode + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 1 CARD8 number of input classes + 23 unused + n LISTofINPUTCLASSINFO input class information + p unused, p=pad(n) + + + + + + + + INPUTCLASSINFO + 1 CARD8 input class id + 0 KEY + 1 BUTTON + 2 VALUATOR + 3 FEEDBACK + 4 PROXIMITY + 5 FOCUS + 6 OTHER + 1 CARD8 event type base code for this class + + + + + + + +CloseDevice + 1 CARD8 input extension opcode + 1 4 CloseDevice opcode + 2 2 request length + 1 CARD8 device id + 3 unused + + + + + + + +SetDeviceMode + 1 CARD8 input extension opcode + 1 5 SetDeviceMode opcode + 2 2 request length + 1 CARD8 device id + 1 CARD8 mode + 2 unused + + + + + => + 1 1 Reply + 1 5 SetDeviceMode opcode + 2 CARD16 sequence number + 4 0 reply length + 1 CARD8 status + 0 Success + 1 AlreadyGrabbed + 3 + first_error DeviceBusy + 23 unused + + + + + + + +SelectExtensionEvent + 1 CARD8 input extension opcode + 1 6 SelectExtensionEvent opcode + 2 3+n request length + 4 Window event window + 2 CARD16 count + 2 unused + 4n LISTofEVENTCLASS desired events + + + + + + + +GetSelectedExtensionEvents + 1 CARD8 input extension opcode + 1 7 GetSelectedExtensionEvents opcode + 2 2 request length + 4 Window event window + + + + + => + 1 1 Reply + 1 7 GetSelecteExtensionEvents opcode + 2 CARD16 sequence number + 4 n + m reply length + 2 n this client count + 2 m all clients count + 20 unused + 4n LISTofEVENTCLASS this client list + 4m LISTofEVENTCLASS all clients list + + + + + + + +ChangeDeviceDontPropagateList + 1 CARD8 input extension opcode + 1 8 ChangeDeviceDontPropagateList opcode + 2 3+n request length + 4 Window event window + 2 n count of events + 1 mode + 0 AddToList + 1 DeleteFromList + 1 unused + 4n LISTofEVENTCLASS desired events + + + + + + + +GetDeviceDontPropagateList + 1 CARD8 input extension opcode + 1 9 GetDeviceDontPropagateList opcode + 2 2 request length + 4 Window event window + + + + + => + 1 1 Reply + 1 9 GetDeviceDontPropagateList opcode + 2 CARD16 sequence number + 4 n reply length + 2 n count of events + 22 unused + 4n LISTofEVENTCLASS don't propagate list + + + + + + + +GetDeviceMotionEvents + 1 CARD8 input extension opcode + 1 10 GetDeviceMotionEvents opcode + 2 4 request length + 4 TIMESTAMP start + 0 CurrentTime + 4 TIMESTAMP stop + 0 CurrentTime + 1 CARD8 device id + 3 unused + + + + + => + 1 1 Reply + 1 10 GetDeviceMotionEvents opcode + 2 CARD16 sequence number + 4 (m+1)n reply length + 4 n number of DEVICETIMECOORDs in events + 1 m number of valuators per event + 1 CARD8 mode of the device + 0 Absolute + 1 Relative + 18 unused + (4m+4)n LISTofDEVICETIMECOORD events + + + + + + + + DEVICETIMECOORD + 4 TIMESTAMP time + 4m LISTofINT32 valuators + + + + + + + +ChangeKeyboardDevice + 1 CARD8 input extension opcode + 1 11 ChangeKeyboardDevice opcode + 2 2 request length + 1 CARD8 device id + 3 unused + + + + + => + 1 1 Reply + 1 11 ChangeKeyboardDevice opcode + 2 CARD16 sequence number + 4 0 reply length + 1 status + 0 Success + 1 AlreadyGrabbed + 2 DeviceFrozen + 23 unused + + + + + + + +ChangePointerDevice + 1 CARD8 input extension opcode + 1 12 ChangePointerDevice opcode + 2 2 request length + 1 CARD8 x-axis + 1 CARD8 y-axis + 1 CARD8 device id + 1 unused + + + + + => + 1 1 Reply + 1 12 ChangePointerDevice opcode + 2 CARD16 sequence number + 4 0 reply length + 1 status + 0 Success + 1 AlreadyGrabbed + 2 DeviceFrozen + 23 unused + + + + + + + +GrabDevice + 1 CARD8 input extension opcode + 1 13 GrabDevice opcode + 2 5+n request length + 4 WINDOW grab-window + 4 TIMESTAMP time + 0 CurrentTime + 2 n count of events + 1 this-device-mode + 0 Synchronous + 1 Asynchronous + 1 other-devices-mode + 0 Synchronous + 1 Asynchronous + 1 BOOL owner-events + 1 CARD8 device id + 2 unused + 4n LISTofEVENTCLASS event list + + + + + => + 1 1 Reply + 1 13 GrabDevice opcode + 2 CARD16 sequence number + 4 0 reply length + 1 status + 0 Success + 1 AlreadyGrabbed + 2 InvalidTime + 3 NotViewable + 4 Frozen + 23 unused + + + + + + + +UngrabDevice + 1 CARD8 input extension opcode + 1 14 UngrabDevice opcode + 2 3 request length + 4 TIMESTAMP time + 0 CurrentTime + 1 CARD8 device id + 3 unused + + + + + + + +GrabDeviceKey + 1 CARD8 input extension opcode + 1 15 GrabDeviceKey opcode + 2 5+n request length + 4 WINDOW grab-window + 2 n count of events + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 1 CARD8 modifier device + #x0FF UseXKeyboard + 1 CARD8 grabbed device + 1 KEYCODE key + 0 AnyKey + 1 this-device-mode + 0 Synchronous + 1 Asynchronous + 1 other-devices-mode + 0 Synchronous + 1 Asynchronous + 1 BOOL owner-events + 2 unused + 4n LISTofEVENTCLASS event list + + + + + + + +UngrabDeviceKey + 1 CARD8 input extension opcode + 1 16 UngrabDeviceKey opcode + 2 4 request length + 4 WINDOW grab-window + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 1 CARD8 modifier device + #x0FF UseXKeyboard + 1 KEYCODE key + 0 AnyKey + 1 CARD8 grabbed device + 3 unused + + + + + + + + +GrabDeviceButton + 1 CARD8 input extension opcode + 1 17 GrabDeviceButton opcode + 2 5+n request length + 4 WINDOW grab-window + 1 CARD8 grabbed device + 1 CARD8 modifier device + #x0FF UseXKeyboard + 2 n count of desired events + 2 SETofKEYMASK modifiers + 1 this-device-mode + 0 Synchronous + 1 Asynchronous + 1 other-device-mode + 0 Synchronous + 1 Asynchronous + 1 BUTTON button + 0 AnyButton + 1 BOOL owner-events + #x8000 AnyModifier + 2 unused + 4n LISTofEVENTCLASS event list + + + + + + + +UngrabDeviceButton + 1 CARD8 input extension opcode + 1 18 UngrabDeviceButton opcode + 2 4 request length + 4 WINDOW grab-window + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 1 CARD8 modifier device + #x0FF UseXKeyboard + 1 BUTTON button + 0 AnyButton + 1 CARD8 grabbed device + 3 unused + + + + + + + +AllowDeviceEvents + 1 CARD8 input extension opcode + 1 19 AllowDeviceEvents opcode + 2 3 request length + 4 TIMESTAMP time + 0 CurrentTime + 1 mode + 0 AsyncThisDevice + 1 SyncThisDevice + 2 ReplayThisDevice + 3 AsyncOtherDevices + 4 AsyncAll + 5 SyncAll + 1 CARD8 device id + 2 unused + + + + + + + +GetDeviceFocus + 1 CARD8 input extension opcode + 1 20 GetDeviceFocus opcode + 2 2 request length + 1 CARD8 device + 3 unused + + + + + => + 1 1 Reply + 1 20 GetDeviceFocus opcode + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW focus + 0 None + 1 PointerRoot + 3 FollowKeyboard + 4 TIMESTAMP focus time + 1 revert-to + 0 None + 1 PointerRoot + 2 Parent + 3 FollowKeyboard + 15 unused + + + + + + + +SetDeviceFocus + 1 CARD8 input extension opcode + 1 21 SetDeviceFocus opcode + 2 4 request length + 4 WINDOW focus + 0 None + 1 PointerRoot + 3 FollowKeyboard + 4 TIMESTAMP time + 0 CurrentTime + 1 revert-to + 0 None + 1 PointerRoot + 2 Parent + 3 FollowKeyboard + 1 CARD8 device + 2 unused + + + + + + + +GetFeedbackControl + 1 CARD8 input extension opcode + 1 22 GetFeedbackControl opcode + 2 2 request length + 1 CARD8 device id + 3 unused + + + + + => + 1 1 Reply + 1 22 GetFeedbackControl opcode + 2 CARD16 sequence number + 4 m/4 reply length + 2 n number of feedbacks supported + 22 unused + m LISTofFEEDBACKSTATE feedbacks + + + + + + + + FEEDBACKSTATE KBDFEEDBACKSTATE, PTRFEEDBACKSTATE, INTEGERFEEDBACKSTATE, + STRINGFEEDBACKSTATE, BELLFEEDBACKSTATE, or LEDFEEDBACKSTATE + + + + + + + + KBDFEEDBACKSTATE + 1 0 feedback class id + 1 CARD8 id of this feedback + 2 20 length + 2 CARD16 pitch + 2 CARD16 duration + 4 CARD32 led_mask + 4 CARD32 led_values + 1 global_auto_repeat + 0 Off + 1 On + 1 CARD8 click + 1 CARD8 percent + 1 unused + 32 LISTofCARD8 auto_repeats + + + + + + + + PTRFEEDBACKSTATE + 1 0 feedback class id + 1 CARD8 id of this feedback + 2 12 length + 2 unused + 2 CARD16 acceleration-numerator + 2 CARD16 acceleration-denominator + 2 CARD16 threshold + + + + + + + + INTEGERFEEDBACKSTATE + 1 0 feedback class id + 1 CARD8 id of this feedback + 2 16 length + 4 CARD32 resolution + 4 INT32 minimum value + 4 INT32 maximum value + + + + + + + + STRINGFEEDBACKSTATE + 1 1 feedback class id + 1 CARD8 id of this feedback + 2 4n+8 length + 2 CARD16 max_symbols + 2 n number of keysyms supported + 4n LISTofKEYSYM key symbols supported + + + + + + + + BELLFEEDBACKSTATE + 1 1 feedback class id + 1 CARD8 id of this feedback + 2 12 length + 1 CARD8 percent + 3 unused + 2 CARD16 pitch + 2 CARD16 duration + + + + + + + + LEDFEEDBACKSTATE + 1 1 feedback class id + 1 CARD8 id of this feedback + 2 12 length + 4 CARD32 led_mask + 4 BITMASK led_values + #x0001 On + #x0002 Off + + + + + + + +ChangeFeedbackControl + 1 CARD8 input extension opcode + 1 23 ChangeFeedbackControl opcode + 2 3+n/4 request length + 4 BITMASK value-mask (has n bits set to 1) + #x0001 keyclick-percent + #x0002 bell-percent + #x0004 bell-pitch + #x0008 bell-duration + #x0010 led + #x0020 led-mode + #x0040 key + #x0080 auto-repeat-mode + #x0001 string + #x0001 integer + #x0001 acceleration-numerator + #x0002 acceleration-denominator + #x0004 acceleration-threshold + 1 CARD8 device id + 1 CARD8 feedback class id + 2 unused + n FEEDBACKCLASS + + + + + + + + FEEDBACKCLASS KBDFEEDBACKCTL, PTRFEEDBACKCTL, INTEGERFEEDBACKCTL, + STRINGFEEDBACKCTL, BELLFEEDBACKCTL, or LEDFEEDBACKCTL + + + + + + + + KBDFEEDBACKCTL + 1 0 feedback class id + 1 CARD8 id of this feedback + 2 20 length + 1 KEYCODE key + 1 auto-repeat-mode + 0 Off + 1 On + 2 Default + 1 INT8 key-click-percent + 1 INT8 bell-percent + 2 INT16 bell-pitch + 2 INT16 bell-duration + 4 CARD32 led_mask + 4 CARD32 led_values + + + + + + + + PTRFEEDBACKCTL + 1 1 feedback class id + 1 CARD8 id of this feedback + 2 12 length + 2 unused + 2 INT16 numerator + 2 INT16 denominator + 2 INT16 threshold + + + + + + + + STRINGCTL + 1 2 feedback class id + 1 CARD8 id of this feedback + 2 4n+8 length + 2 unused + 2 n number of keysyms to display + 4n LISTofKEYSYM list of key symbols to display + + + + + + + + INTEGERCTL + 1 3 feedback class id + 1 CARD8 id of this feedback + 2 8 length + 4 INT32 integer to display + + + + + + + + LEDCTL + 1 4 feedback class id + 1 CARD8 id of this feedback + 2 12 length + 4 CARD32 led_mask + 4 BITMASK led_values + #x0001 On + #x0002 Off + + + + + + + + BELLCTL + 1 5 feedback class id + 1 CARD8 id of this feedback + 2 8 length + 1 INT8 percent + 3 unused + 2 INT16 pitch + 2 INT16 duration + + + + + + + +GetDeviceKeyMapping + 1 CARD8 input extension opcode + 1 24 GetDeviceKeyMapping opcode + 2 2 request length + 1 CARD8 device + 1 KEYCODE first-keycode + 1 CARD8 count + 1 unused + + + + + => + 1 1 Reply + 1 24 GetDeviceKeyMapping opcode + 2 CARD16 sequence number + 4 nm reply length (m = count field from the request) + 1 n keysyms-per-keycode + 23 unused + 4nm LISTofKEYSYM keysyms + + + + + + + +ChangeDeviceKeyMapping + 1 CARD8 input extension opcode + 1 25 ChangeDeviceKeyMapping opcode + 2 2+nm request length + 1 CARD8 device + 1 KEYCODE first-keycode + 1 m keysyms-per-keycode + 1 n keycode-count + 4nm LISTofKEYSYM keysyms + + + + + + + +GetDeviceModifierMapping + 1 CARD8 input extension opcode + 1 26 GetDeviceModifierMapping opcode + 2 2 request length + 1 CARD8 device + 3 unused + + + + + => + 1 1 Reply + 1 26 GetDeviceModifierMapping opcode + 2 CARD16 sequence number + 4 2n reply length + 1 n keycodes-per-modifier + 23 unused + 8n LISTofKEYCODE keycodes + + + + + + + +SetDeviceModifierMapping + 1 CARD8 input extension opcode + 1 27 SetDeviceModifier opcode + 2 2+2n request length + 1 CARD8 device + 1 n keycodes-per-modifier + 2 unused + 8n LISTofKEYCODE keycodes + + + + + => + 1 1 Reply + 1 27 SetDeviceModifierMapping opcode + 2 CARD16 sequence number + 4 0 reply length + 1 status + 0 Success + 1 Busy + 2 Failed + 23 unused + + + + + + + +GetDeviceButtonMapping + 1 CARD8 input extension opcode + 1 28 GetDeviceButtonMapping opcode + 2 2 request length + 1 CARD8 device + 3 unused + + + + + => + 1 1 Reply + 1 28 GetDeviceButtonMapping opcode + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 1 n number of elements in map list + 23 unused + n LISTofCARD8 map + p unused, p=pad(n) + + + + + + + +SetDeviceButtonMapping + 1 CARD8 input extension opcode + 1 29 SetDeviceButtonMapping opcode + 2 2+(n+p)/4 request length + 1 CARD8 device + 1 n length of map + 2 unused + n LISTofCARD8 map + p unused, p=pad(n) + + + + + => + 1 1 Reply + 1 29 SetDeviceButtonMapping opcode + 2 CARD16 sequence number + 4 0 reply length + 1 status + 0 Success + 1 Busy + 23 unused + + + + + + + +QueryDeviceState + 1 CARD8 input extension opcode + 1 30 QueryDeviceState opcode + 2 2 request length + 1 CARD8 device + 3 unused + + + + + => + 1 1 Reply + 1 30 QueryDeviceState opcode + 2 CARD16 sequence number + 4 m/4 reply length + 1 n number of input classes + 23 unused + m LISTofINPUTSTATE + + + + + INPUTSTATE KEYSTATE or BUTTONSTATE or VALUATORSTATE + + + + + + + + KEYSTATE + 1 CARD8 key input class id + 1 36 length + 1 CARD8 num_keys + 1 unused + 32 LISTofCARD8 status of keys + + + + + BUTTONSTATE + 1 CARD8 button input class id + 1 36 length + 1 CARD8 num_buttons + 1 unused + 32 LISTofCARD8 status of buttons + + + + + VALUATORSTATE + 1 CARD8 valuator input class id + 1 4n + 4 length + 1 n number of valuators + 1 mode + #x01 DeviceMode (0 = Relative, 1 = Absolute) + #x02 ProximityState (0 = InProximity, 1 = OutOfProximity) + 4n LISTofCARD32 status of valuators + + + + + + + +SendExtensionEvent + 1 CARD8 input extension opcode + 1 31 SendExtensionEvent opcode + 2 4 + 8n + m request length + 4 WINDOW destination + 1 CARD8 device + 1 BOOL propagate + 2 CARD16 eventclass count + 1 CARD8 num_events + 3 unused + 32n LISTofEVENTS events to send + 4m LISTofEVENTCLASS desired events + + + + + + + +DeviceBell + 1 CARD8 input extension opcode + 1 32 DeviceBell opcode + 2 2 request length + 1 CARD8 device id + 1 CARD8 feedback id + 1 CARD8 feedback class + 1 INT8 percent + + + + + + + +SetDeviceValuators + 1 CARD8 input extension opcode + 1 33 SetDeviceValuators opcode + 2 2 + n request length + 1 CARD8 device id + 1 CARD8 first valuator + 1 n number of valuators + 1 unused + 4n LISTofINT32 valuator values to set + + + + + => + 1 1 Reply + 1 33 SetDeviceValuators opcode + 2 CARD16 sequence number + 4 0 reply length + 1 CARD8 status + 0 Success + 1 AlreadyGrabbed + 23 unused + + + + + + + +GetDeviceControl + 1 CARD8 input extension opcode + 1 34 GetDeviceControl opcode + 2 2 request length + 2 CARD16 device control type + 1 CARD8 device id + 1 unused + + + + + => + 1 1 Reply + 1 34 GetDeviceControl opcode + 2 CARD16 sequence number + 4 n/4 reply length + 1 CARD8 status + 0 Success + 1 AlreadyGrabbed + 3 + first_error DeviceBusy + 23 unused + n DEVICESTATE + + + + +DEVICESTATE DEVICERESOLUTIONSTATE + + + + + + + +DEVICERESOLUTIONSTATE + 2 0 control type + 2 8 + 12n length + 4 n num_valuators + 4n LISTOfCARD32 resolution values + 4n LISTOfCARD32 resolution min_values + 4n LISTOfCARD32 resolution max_values + + + + + + + + + + +ChangeDeviceControl + 1 CARD8 input extension opcode + 1 35 ChangeDeviceControl opcode + 2 2+n/4 request length + 2 CARD16 control type + 1 CARD8 device id + 1 unused + n DEVICECONTROL + + + + +DEVICECONTROL DEVICERESOLUTIONCTL + + + + + + + +DEVICERESOLUTIONCTL + 2 1 control type + 2 8 + 4n length + 1 CARD8 first_valuator + 1 n num_valuators + 2 unused + 4n LISTOfCARD32 resolution values + + + + + + + + => + 1 1 Reply + 1 35 ChangeDeviceControl opcode + 2 CARD16 sequence number + 4 0 reply length + 1 CARD8 status + 0 Success + 1 AlreadyGrabbed + 3 + first_error DeviceBusy + 23 unused + + +Events + + + + +DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, DeviceButtonRelease, +ProximityIn, ProximityOut, and DeviceStateNotify events may be followed by +zero or more DeviceValuator events. DeviceMotionNotify events will be +followed by one or more DeviceValuator events. + + + + + + +DeviceValuator + 1 CARD8 code + 1 CARD8 device id + 2 CARD16 sequence number + 2 SETofKEYBUTMASK state + 1 n number of valuators this device reports + 1 m number of first valuator in this event + 24 LISTofINT32 valuators + + + + + + + +DeviceKeyPress + 1 CARD8 code + 1 KEYCODE detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + + + + +DeviceKeyRelease + 1 CARD8 code + 1 KEYCODE detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + + + + +DeviceButtonPress + 1 CARD8 code + 1 BUTTON detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + + + + +DeviceButtonRelease + 1 CARD8 code + 1 BUTTON detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + + + + +DeviceMotionNotify + 1 CARD8 code + 1 detail + 0 Normal + 1 Hint + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + +DeviceFocusIn + 1 CARD8 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 5 Pointer + 6 PointerRoot + 7 None + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW event + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 3 WhileGrabbed + 1 CARD8 device id + 18 unused + + + + + + + +DeviceFocusOut + 1 CARD8 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 5 Pointer + 6 PointerRoot + 7 None + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW event + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 3 WhileGrabbed + 1 CARD8 device id + 18 unused + + + + + + + +ProximityIn + 1 CARD8 code + 1 unused + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + + + + +ProximityOut + 1 CARD8 code + 1 unused + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 CARD8 device id + #x80 MORE_EVENTS follow + + + + +DeviceStateNotify events may be immediately followed by zero or one +DeviceKeyStateNotify and/ or zero or more DeviceValuator events. + + + + + + +DeviceStateNotify + 1 CARD8 code + 1 CARD8 device id + #x80 MORE_EVENTS follow + 2 CARD16 sequence number + 4 TIMESTAMP time + 1 CARD8 num_keys + 1 CARD8 num_buttons + 1 CARD8 num_valuators + 1 CARD8 valuator mode and input classes reported + #x01 reporting keys + #x02 reporting buttons + #x04 reporting valuators + #x40 device mode (0 = Relative, 1 = Absolute) + #x80 proximity state (0 = InProximity, 1 = OutOfProximity) + 4 LISTofCARD8 first 32 keys (if reported) + 4 LISTofCARD8 first 32 buttons (if reported) + 12 LISTofCARD32 first 3 valuators (if reported) + + + + + + + +DeviceKeyStateNotify + 1 CARD8 code + 1 CARD8 device id + #x80 MORE_EVENTS follow + 2 CARD16 sequence number + 28 LISTofCARD8 state of keys 33-255 + + + + + + + +DeviceButtonStateNotify + 1 CARD8 code + 1 CARD8 device id + #x80 MORE_EVENTS follow + 2 CARD16 sequence number + 28 LISTofCARD8 state of buttons 33-255 + + + + + + + +DeviceValuator + 1 CARD8 code + 1 CARD8 device id + 2 CARD16 sequence number + 2 SETofKEYBUTMASK state + 1 n number of valuators this device reports + 1 n number of first valuator in this event + 24 LISTofINT32 valuators + + + + + + + +DeviceMappingNotify + 1 CARD8 code + 1 CARD8 device id + 2 CARD16 sequence number + 1 request + 0 MappingModifier + 1 MappingKeyboard + 2 MappingPointer + 1 KEYCODE first-keycode + 1 CARD8 count + 1 unused + 4 TIMESTAMP time + 20 unused + + + + + + +ChangeDeviceNotify + 1 CARD8 code + 1 CARD8 id of device specified on change request + 2 CARD16 sequence number + 4 TIMESTAMP time + 1 request + 0 NewPointer + 1 NewKeyboard + 23 unused + + + + + + + + diff --git a/specs/inputlib.xml b/specs/inputlib.xml new file mode 100644 index 0000000..0c562a2 --- /dev/null +++ b/specs/inputlib.xml @@ -0,0 +1,75 @@ + + %defs; +]> + + + + + X Input Device Extension Library + X Version 11, Release &fullrelvers; + Version 1.0 + + + MarkPatrick + Ardent Computer + + + GeorgeSachs + Hewlett-Packard + + + 198919901991 + Hewlett-Packard Company + Ardent Computer + + + + +Permission to use, copy, modify, and distribute this documentation for any purpose and without +fee is hereby granted, provided that the above copyright notice and this permission notice appear +in all copies. Ardent and Hewlett-Packard make no representations about the suitability for any +purpose of the information in this document. It is provided "as is" without express or implied +warranty. + + + + + +Copyright © 1989, 1990, 1991, 1992 X Consortium + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the ‘‘Software’’), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The Open Group. + + + + + + + diff --git a/specs/library.xml b/specs/library.xml new file mode 100644 index 0000000..b65b234 --- /dev/null +++ b/specs/library.xml @@ -0,0 +1,8559 @@ +Input Extension + +Overview + + + + + +This document describes an extension to +the X11 server. The purpose of this extension is to support the use +of additional input devices beyond the pointer and keyboard devices +defined by the core X protocol. This first section gives an overview +of the input extension. The following sections correspond to +chapters 9, 10, and 11, ``Window and Session Manager Functions'', +``Events'', and ``Event Handling Functions'' of the +``Xlib - C Language Interface'' manual +and describe how to use the input device extension. + + +Design Approach + + + + + +The design approach of the extension is to define functions +and events analogous to the core functions and events. +This allows extension input devices and events to be individually +distinguishable from each other and from the core input devices and events. +These functions and events make use of a device identifier and support the +reporting of n-dimensional motion data as well as other data that +is not currently reportable via the core input events. + + + +Core Input Devices + + + + + +The X server core protocol supports two input devices: a pointer and a +keyboard. The pointer device has two major functions. +First, it may be used to generate motion information +that client programs can detect. Second, it may also be used to indicate the +current location and focus of the X keyboard. To accomplish this, the server +echoes a cursor at the current position of the X pointer. Unless the X +keyboard has been explicitly focused, this cursor also shows the current +location and focus of the X keyboard. + + + +The X keyboard is used to generate input that client programs can detect. + + + +The X keyboard and X pointer are referred to in this document as +the core devices, and the input +events they generate +( KeyPress , +KeyRelease , +ButtonPress , +ButtonRelease , +and +MotionNotify ) +are known as the core input events. All other +input devices are referred to as extension input devices, and the +input events they generate are referred to as extension input events. + +This input extension does not change the behavior or functionality of the +core input devices, core events, or core protocol requests, with the +exception of the core grab requests. These requests may affect the +synchronization of events from extension devices. See the explanation +in the section titled ``Event Synchronization and Core Grabs.'' + + + + +Selection of the physical devices to be initially used by the server as the +core devices is left implementation dependent. Functions are defined that +allow client programs to change which physical devices are used as the +core devices. + + + +Extension Input Devices + + + + + +The input extension controls access to input devices other than the X keyboard +and X pointer. It allows client programs to select input from these devices +independently +from each other and independently from the core devices. Input events from +these devices are of extension types +( DeviceKeyPress , +DeviceKeyRelease , +DeviceButtonPress , +DeviceButtonRelease , +DeviceMotionNotify , +and so on) and contain +a device identifier so that events of the same type coming from different +input devices can be distinguished. + + + +Extension input events are not limited in size by the size of the server +32-byte wire events. Extension input events +may be constructed by the server sending as many +wire-sized events as necessary to return the information required for +that event. +The library event reformatting routines +are responsible for combining these into one or more client XEvents. + + + +Any input device that generates key, button, or motion data may be used as +an extension input device. +Extension input devices may have zero or more keys, zero or more buttons, +and may report zero or more axes of motion. Motion may be reported +as relative movements from a previous position or as an absolute +position. All valuators reporting motion information for a given +extension input device must report the same kind of motion information +(absolute or relative). + + + +This extension is designed to accommodate new types of input devices that +may be added in the future. The protocol requests that refer to +specific characteristics of input devices organize that information +by input device classes. Server implementors may add new +classes of input devices without changing the protocol requests. + + + +All extension input +devices are treated like the core X keyboard in determining their location +and focus. The server does not track the location of these devices on an +individual basis and, therefore, +does not echo a cursor to indicate their current location. +Instead, their location is determined by the location of the core X pointer. +Like the core X keyboard, some may be explicitly focused. If they are +not explicitly focused, their focus +is determined by the location of the core X pointer. + + +Input Device Classes + + + + + +Some of the input extension requests divide input devices into classes +based on their functionality. This is intended to allow new classes of input +devices to be defined at a later time without changing the semantics of +these functions. The following input device classes are currently +defined: + + + KEY + + +The device reports key events. + + + + + BUTTON + + +The device reports button events. + + + + + VALUATOR + + +The device reports valuator data in motion events. + + + + + PROXIMITY + + +The device reports proximity events. + + + + + FOCUS + + +The device can be focused. + + + + + FEEDBACK + + +The device supports feedbacks. + + + + + + + +Additional classes may be added in the future. +Functions that support multiple input classes, such as the + +function that lists all available input devices, +organize the data they return by input class. Client programs that +use these functions should not access data unless it matches a +class defined at the time those clients were compiled. In this way, +new classes can be added without forcing existing clients that use +these functions to be recompiled. + + + + +Using Extension Input Devices + + + + + +A client that wishes to access an input device does so through the library +functions defined in the following sections. A typical sequence of requests +that a client would make is as follows: + + + + + +- lists all of the available input devices. From the +information returned by this request, determine whether the desired input +device is attached to the server. For a description of the + +request, see the section entitled ``Listing Available Devices.'' + + + + + +- requests that the server open the device for access by this client. +This request returns an +XDevice +structure that is used +by most other input extension requests to identify the specified device. +For a description of the + +request, see the section entitled ``Enabling and Disabling Extension Devices.'' + + + + +Determine the event types and event classes needed to select the desired +input extension events, and identify them when they are received. +This is done via macros whose name corresponds to the desired event, for +example, +DeviceKeyPress . +For a description of these macros, +see the section entitled ``Selecting Extension Device Events.'' + + + + + +- selects the desired events from the server. +For a description of the +XSelextExtensionEvent +request, see the section entitled ``Selecting Extension Device Events.'' + + + + +XNextEvent +- receives the next available event. This is the core +XNextEvent +function provided by the standard X libarary. + + + + + +Other requests are defined to grab and focus extension devices, to +change their key, button, or modifier mappings, to control the +propagation of input extension events, to get motion history from an +extension device, and to send input extension events to another client. +These functions are described in the following sections. + + + + +Library Extension Requests + + + + + +Extension input devices are accessed by client programs through the +use of new protocol requests. +The following requests are provided as extensions to Xlib. Constants +and structures referenced by these functions may be found in the +files <X11/extensions/XI.h> and <X11/extensions/XInput.h>, +which are attached to this document as +Appendix A. + + + +The library will return NoSuchExtension if an extension request +is made to a server that does not support the input extension. + + + +Input extension requests cannot be used to access the X keyboard and +X pointer devices. + + +Window Manager Functions + + + + + +This section discusses the following X Input Extension Window Manager topics: + + + + +Changing the core devices + + + + +Event synchronization and core grabs + + + + +Extension active grabs + + + + +Passively grabbing a key + + + + +Passively grabbing a button + + + + +Thawing a device + + + + +Controlling device focus + + + + +Controlling device feedback + + + + +Ringing a bell on an input device + + + + +Controlling device encoding + + + + +Controlling button mapping + + + + +Obtaining the state of a device + + + + +Changing the Core Devices + + + + + + +These functions are provided to change which physical device is used +as the X pointer or X keyboard. + + + +Using these functions may change the characteristics of the core devices. +The new pointer device may have a different number of buttons from the +old one, or the new keyboard device may have a different number of +keys or report a different range of keycodes. Client programs may be +running that depend on those characteristics. For example, a client +program could allocate an array based on the number of buttons on the +pointer device and then use the button numbers received in button events +as indices into that array. Changing the core devices could cause +such client programs to behave improperly or to terminate abnormally +if they ignore the +ChangeDeviceNotify +event generated by these requests. + + + + + +These functions change the X keyboard or X pointer device and generate an +XChangeDeviceNotify +event and a +MappingNotify +event. +The specified device becomes the +new X keyboard or X pointer device. The location of the core device +does not change as a result of this request. + + + +These requests fail and return +AlreadyGrabbed +if either the specified +device or the core device it would replace are grabbed by some other client. +They fail and return +GrabFrozen +if either device is frozen by the active grab of another client. + + + +These requests fail with a +BadDevice +error if the specified device is invalid, has not previously been opened via +XOpenDevice , +or is +not supported as a core device by the server implementation. + + + +Once the device has successfully replaced one of the core devices, it +is treated as a core device until it is in turn replaced by another +ChangeDevice +request or until the server terminates. The termination +of the client that changed the device will not cause it to change back. +Attempts to use the + +request to close the new core device will fail with a +BadDevice +error. + + + + +To change which physical device is used as the X keyboard, use the + +function. +The specified device must support input class +Keys +(as reported in the +ListInputDevices +request) or the request will fail with a +BadMatch +error. + + + + + + + int XChangeKeyboardDevice + Display *display + XDevice *device + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + + + +If no error occurs, + +returns +Success . +A +ChangeDeviceNotify +event with the request field set to +NewKeyboard +is sent to all clients selecting that event. +A +MappingNotify +event with the request field set to +MappingKeyboard +is sent to all clients. +The requested device becomes the X keyboard, and the old keyboard becomes +available as an extension input device. +The focus state of the new keyboard is the same as +the focus state of the old X keyboard. + + + + +can generate +AlreadyGrabbed , +BadDevice , +BadMatch , +and +GrabFrozen +errors. + + + + +To change which physical device is used as the X pointer, +use the + +function. +The specified device must support input class +Valuators +(as reported in the + +request) and report at least two axes of motion, +or the request will fail with a +BadMatch +error. +If the specified device reports more than two axes, the two specified in +the xaxis and yaxis arguments will be used. Data from other +valuators on the device will be ignored. + + + +If the specified device reports absolute positional information, and the +server implementation does not allow such a device to be used as the +X pointer, the request will fail with a +BadDevice +error. + + + + int XChangePointerDevice + Display *display + XDevice *device + int xaxis + int yaxis + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + xaxis + + + +Specifies the zero-based index of the axis to be used as the x-axis of the +pointer device. + + + + + + yaxis + + + +Specifies the zero-based index of the axis to be used as the y-axis of the +pointer device. + + + + + + + + +If no error occurs, + +returns +Success . +A +ChangeDeviceNotify +event with the request field set to +NewPointer +is sent to all clients selecting that event. +A +MappingNotify +event with the request field set to +MappingPointer +is sent to all clients. +The requested device becomes the X pointer, and the old pointer becomes +available as an extension input device. + + + + +can generate +AlreadyGrabbed , +BadDevice , +BadMatch , +and +GrabFrozen +errors. + + + +Event Synchronization and Core Grabs + + + + + +Implementation of the input extension requires an extension of the +meaning of event synchronization for the core grab requests. This is +necessary in order to allow window managers to freeze all input devices +with a single request. + + + +The core grab requests require a pointer_mode and keyboard_mode +argument. The meaning of these modes is changed by the input extension. +For the +XGrabPointer +and +XGrabButton +requests, pointer_mode controls synchronization of the pointer device, +and keyboard_mode controls the synchronization of all other input devices. +For the +XGrabKeyboard +and +XGrabKey +requests, pointer_mode controls the synchronization +of all input devices, except the X keyboard, while keyboard_mode controls +the synchronization of the keyboard. When using one of the core grab +requests, the synchronization of extension devices +is controlled by the mode specified for the device not being grabbed. + + + +Extension Active Grabs + + + + + +Active grabs of +extension devices are supported via the + +function in the same way that core devices are grabbed using the core +XGrabKeyboard +function, except that an extension input device +is passed as a function parameter. +The + +function allows a previous active grab for an extension device to be released. + + + +Passive grabs of buttons and keys on extension devices are supported +via the + +and + +functions. +These passive grabs are released via the + +and + +functions. + + + + +To grab an extension device, use the + +function. +The device must have previously been opened using the + +function. + + + + int XGrabDevice + Display *display + XDevice *device + Window grab_window + Bool owner_events + int event_count + XEventClass *event_list + int this_device_mode + int other_device_mode + Time time + + + + + + + "display" + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + grab_window + + + +Specifies the ID of a window associated with the device specified above. + + + + + + owner_events + + + +Specifies a boolean value of either +True +or +False . + + + + + + event_count + + + +Specifies the number of elements in the event_list array. + + + + + + event_list + + + +Specifies a pointer to a list of event classes that indicate which events +the client wishes to receive. +These event classes must have been obtained +using the device being grabbed. + + + + + + this_device_mode + + + +Controls further processing of events from this device. You can pass one +of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + other_device_mode + + + +Controls further processing of events from all other devices. You can pass one +of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + time + + + +Specifies the time. This may be either a timestamp expressed in +milliseconds or +CurrentTime . + + + + + + + + + +actively grabs an extension input device and generates +DeviceFocusIn +and +DeviceFocusOut +events. +Further input events from this device are reported only to the grabbing client. +This function overrides any previous active grab by this client for this device. + + + +The event_list parameter is a pointer to a list of event classes. This list +indicates which events the client wishes to receive while the grab is active. +If owner_events is +False , +input events from this device are reported with respect to +grab_window and are reported only if specified in event_list. +If owner_events is +True , +then if a generated event would normally be reported to this client, +it is reported normally. +Otherwise, the event is reported with respect to the grab_window and is only +reported if specified in event_list. + + + +The this_device_mode argument controls the further processing +of events from this device, and the other_device_mode argument controls +the further processing of input events from all other devices. + + + + +If the this_device_mode argument is +GrabModeAsync , +device event processing continues +normally; if the device is currently frozen by this client, then +processing of device events is resumed. +If the this_device_mode argument is +GrabModeSync , +the state of the grabbed device +(as seen by client applications) appears to freeze, +and no further device events are generated by the server until the +grabbing client issues a releasing + +call or until the device grab is released. +Actual device input events are not lost while the device is frozen; they are +simply queued for later processing. + + + + +If the other_device_mode is +GrabModeAsync , +event processing from other input devices is unaffected +by activation of the grab. +If other_device_mode is +GrabModeSync , +the state of all devices except the grabbed device +(as seen by client applications) appears to freeze, and no further +events are generated by the server until the grabbing client issues a +releasing +XAllowEvents +or + +call or until the device grab is released. +Actual events are not lost +while the other devices are frozen; they are simply queued for later +processing. + + + + + + +fails on the following conditions: + + + + +If the device is actively grabbed by some other client, it returns +AlreadyGrabbed . + + + + +If grab_window is not viewable, it returns +GrabNotViewable . + + + + +If the specified time is earlier +than the last-grab-time for the specified device +or later than the current X server time, it returns +GrabInvalidTime . +Otherwise, +the last-grab-time for the specified device is set +to the specified time and +CurrentTime +is replaced by the current X server time. + + + + +If the device is frozen by an active grab of another client, it returns +GrabFrozen . + + + + + +If a grabbed device is closed by a client while an active grab by that +client is in effect, that active grab will be released. +Any passive grabs established by that client will be released. +If the device is frozen only by an active grab +of the requesting client, it is thawed. + + + + +can generate +BadClass , +BadDevice , +BadValue , +and +BadWindow +errors. + + + + +To release a grab of an extension device, use the + +function. + + + + + + + int XUngrabDevice + Display *display + XDevice *device + Time time + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + time + + + +Specifies the time. This may be either a timestamp expressed in +milliseconds, or +CurrentTime . + + + + + + + + + +allows a client to release an extension input device and any +queued events if this client has it grabbed from either + +or +XGrabDeviceKey . +If any other devices are frozen by the grab, + +thaws them. +This function does not release the device and any +queued events if the specified time is earlier than the last-device-grab +time or is later than the current X server time. It also generates +DeviceFocusIn +and +DeviceFocusOut +events. The X server automatically performs an + +if the event window for an active device grab becomes not viewable +or if the client terminates without releasing the grab. + + + + +can generate +BadDevice +errors. + + + +Passively Grabbing a Key + + + + + +To passively grab a single key on an extension device, use +XGrabDeviceKey . +That device must have previously been opened using the + +function, or the request will fail with a +BadDevice +error. +If the specified device does not support input class +Keys , +the request will fail with a +BadMatch +error. + + + + int XGrabDeviceKey + Display *display + XDevice *device + int keycode + unsignedint modifiers + XDevice *modifier_device + Window grab_window + Bool owner_events + int event_count + XEventClass *event_list + int this_device_mode + int other_device_mode + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + keycode + + + +Specifies the keycode of the key that is to be grabbed. You can pass +either the keycode or +AnyKey . + + + + + + modifiers + + + +Specifies the set of keymasks. This mask is the bitwise inclusive OR +of these keymask bits: +ShiftMask , +LockMask , +ControlMask , +Mod1Mask , +Mod2Mask , +Mod3Mask , +Mod4Mask , +and +Mod5Mask . + + + + + + + + + +You can also pass +AnyModifier , +which is equivalent to issuing the grab key request +for all possible modifier combinations (including the combination +of no modifiers). + + + + + + modifier_device + + + +Specifies the device whose modifiers are to be used. If NULL is +specified, the core X keyboard is used as the modifier_device. + + + + + + grab_window + + + +Specifies the ID of a window associated with the device specified above. + + + + + + owner_events + + + +Specifies a boolean value of either +True +or +False . + + + + + + event_count + + + +Specifies the number of elements in the event_list array. + + + + + + event_list + + + +Specifies a pointer to a list of event classes that indicate which events +the client wishes to receive. + + + + + + this_device_mode + + + +Controls further processing of events from this device. +You can pass one of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + other_device_mode + + + +Controls further processing of events from all other devices. +You can pass one of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + + + + +is analogous to the core +XGrabKey +function. It creates an +explicit passive grab for a key on an extension device. +The + +function establishes a passive grab on a device. +Consequently, in the future, + + + + +IF the device is not grabbed and the specified key, +which itself can be a modifier key, is logically pressed +when the specified modifier keys logically are down on the specified +modifier device (and no other keys are down), + + + + +AND no other modifier keys logically are down, + + + + +AND EITHER the grab window is an ancestor of (or is) the focus window +or the grab window is a descendent of the focus window and contains the pointer, + + + + +AND a passive grab on the same device and key combination does not exist on any +ancestor of the grab window, + + + + +THEN the device is actively grabbed, as for +XGrabDevice , +the last-device-grab time is set to the time at which the key was pressed +(as transmitted in the +DeviceKeyPress +event), and the +DeviceKeyPress +event is reported. + + + + + +The interpretation of the remaining arguments is as for +XGrabDevice . +The active grab is terminated automatically when the logical state of the +device has the specified key released +(independent of the logical state of the modifier keys). + + + +Note that the logical state of a device (as seen by means of the X protocol) +may lag the physical state if device event processing is frozen. + + + +A modifier of +AnyModifier +is equivalent to issuing the request for all +possible modifier combinations (including the combination of no modifiers). +It is not required that all modifiers specified have +currently assigned keycodes. +A key of +AnyKey +is equivalent to issuing +the request for all possible keycodes. Otherwise, the key must be in +the range specified by min_keycode and max_keycode in the +information returned by the + +function. +If it is not within that range, + +generates a +BadValue +error. + + + + +generates a +BadAccess +error if some other client has issued a + +with the same device and key combination on the same window. +When using +AnyModifier +or +AnyKey , +the request fails completely and the X server generates a +BadAccess +error, and no grabs are established if there is a conflicting grab +for any combination. + + + + +returns +Success +upon successful completion of the request. + + + + +can generate +BadAccess , +BadClass , +BadDevice , +BadMatch , +BadValue , +and +BadWindow +errors. + + + + +To release a passive grab of a single key on an extension device, use +XUngrabDeviceKey . + + + + int XUngrabDeviceKey + Display *display + XDevice *device + int keycode + unsignedint modifiers + XDevice *modifier_device + Window ungrab_window + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + keycode + + + +Specifies the keycode of the key that is to be ungrabbed. You can pass +either the keycode or +AnyKey . + + + + + + modifiers + + + +Specifies the set of keymasks. This mask is the bitwise inclusive OR +of these keymask bits: +ShiftMask , +LockMask , +ControlMask , +Mod1Mask , +Mod2Mask , +Mod3Mask , +Mod4Mask , +and +Mod5Mask . + + + + + + + + + +You can also pass +AnyModifier , +which is equivalent to issuing the ungrab key +request for all possible modifier combinations (including the combination +of no modifiers). + + + + + + modifier_device + + + +Specifies the device whose modifiers are to be used. If NULL is +specified, the core X keyboard is used as the modifier_device. + + + + + + ungrab_window + + + +Specifies the ID of a window associated with the device specified above. + + + + + + + + + +is analogous to the core +XUngrabKey +function. It releases an explicit passive grab for a key +on an extension input device. + + + + +can generate +BadAlloc , +BadDevice , +BadMatch , +BadValue , +and +BadWindow +errors. + + + +Passively Grabbing a Button + + + + + +To establish a passive grab for a single button on an extension device, use +XGrabDeviceButton . +The specified device must have previously been opened using the + +function, or the request will fail with a +BadDevice +error. If the specified device does not support input class +Buttons , +the request will fail with a +BadMatch +error. + + + + int XGrabDeviceButton + Display *display + XDevice *device + unsignedint button + unsignedint modifiers + XDevice*modifier_device + Window grab_window + Bool owner_events + int event_count + XEventClass *event_list + int this_device_mode + int other_device_mode + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + button + + + +Specifies the code of the button that is to be grabbed. You can pass +either the button or +AnyButton . + + + + + + modifiers + + + +Specifies the set of keymasks. This mask is the bitwise inclusive OR +of these keymask bits: +ShiftMask , +LockMask , +ControlMask , +Mod1Mask , +Mod2Mask , +Mod3Mask , +Mod4Mask , +and +Mod5Mask . + + + + + + + + + +You can also pass +AnyModifier , +which is equivalent to issuing the grab request +for all possible modifier combinations (including the combination +of no modifiers). + + + + + + modifier_device + + + +Specifies the device whose modifiers are to be used. If NULL is +specified, the core X keyboard is used as the modifier_device. + + + + + + grab_window + + + +Specifies the ID of a window associated with the device specified above. + + + + + + owner_events + + + +Specifies a boolean value of either +True +or +False . + + + + + + event_count + + + +Specifies the number of elements in the event_list array. + + + + + + event_list + + + +Specifies a list of event classes that indicates which device events are to be +reported to the client. + + + + + + this_device_mode + + + +Controls further processing of events from this device. You can pass one +of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + other_device_mode + + + +Controls further processing of events from all other devices. You can pass one +of these constants: +GrabModeSync +or +GrabModeAsync . + + + + + + + + + +is analogous to the core +XGrabButton +function. +It creates an explicit passive grab for a button on an extension input device. +Because the server does not track extension devices, +no cursor is specified with this request. +For the same reason, there is no confine_to parameter. +The device must have previously been opened using the + +function. + + + +The + +function establishes a passive grab on a device. +Consequently, in the future, + + + + +IF the device is not grabbed and the specified button is logically pressed +when the specified modifier keys logically are down +(and no other buttons or modifier keys are down), + + + + +AND EITHER the grab window is an ancestor of (or is) the focus window +OR the grab window is a descendent of the focus window and contains the pointer, + + + + +AND a passive grab on the same device and button/key combination does not +exist on any ancestor of the grab window, + + + + +THEN the device is actively grabbed, as for +XGrabDevice , +the last-grab time is set to the time at which the button was pressed +(as transmitted in the +DeviceButtonPress +event), and the +DeviceButtonPress +event is reported. + + + + + +The interpretation of the remaining arguments is as for +XGrabDevice . +The active grab is terminated automatically when logical state of the +device has all buttons released (independent of the logical state of +the modifier keys). + + + +Note that the logical state of a device (as seen by means of the X protocol) +may lag the physical state if device event processing is frozen. + + + +A modifier of +AnyModifier +is equivalent to issuing the request for all +possible modifier combinations (including the combination of no +modifiers). +It is not required that all modifiers specified have +currently assigned keycodes. +A button of +AnyButton +is equivalent to issuing +the request for all possible buttons. +Otherwise, it is not required that the +specified button be assigned to a physical button. + + + + +generates a +BadAccess +error if some other client has issued a + +with the same device and button combination on the same window. +When using +AnyModifier +or +AnyButton , +the request fails completely and the X server generates a +BadAccess +error and no grabs are +established if there is a conflicting grab for any combination. + + + + +can generate +BadAccess , +BadClass , +BadDevice , +BadMatch , +BadValue , +and +BadWindow +errors. + + + + +To release a passive grab of a button on an extension device, use +XUngrabDeviceButton . + + + + int XUngrabDeviceButton + Display *display + XDevice *device + unsignedint button + unsignedint modifiers + XDevice *modifier_device + Window ungrab_window + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + button + + + +Specifies the code of the button that is to be ungrabbed. You can pass +either a button or +AnyButton . + + + + + + modifiers + + + +Specifies the set of keymasks. This mask is the bitwise inclusive OR +of these keymask bits: +ShiftMask , +LockMask , +ControlMask , +Mod1Mask , +Mod2Mask , +Mod3Mask , +Mod4Mask , +and +Mod5Mask . + + + + + + + + + +You can also pass +AnyModifier , +which is equivalent to issuing the ungrab key +request for all possible modifier combinations (including the combination +of no modifiers). + + + + + + modifier_device + + + +Specifies the device whose modifiers are to be used. If NULL is +specified, the core X keyboard is used as the modifier_device. + + + + + + ungrab_window + + + +Specifies the ID of a window associated with the device specified above. + + + + + + + + + +is analogous to the core +XUngrabButton +function. It releases an explicit passive grab for a button +on an extension device. +That device must have previously been opened using the + +function, or a +BadDevice +error will result. + + + +A modifier of +AnyModifier +is equivalent to issuing the request for all +possible modifier combinations (including the combination of no +modifiers). + + + + +can generate +BadAlloc , +BadDevice , +BadMatch , +BadValue , +and +BadWindow +errors. + + + +Thawing a Device + + + + + +To allow further events to be processed when a device has been frozen, use +XAllowDeviceEvents . + + + + int XAllowDeviceEvents + Display *display + XDevice *device + int event_mode + Time time + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + event_mode + + + +Specifies the event mode. You can pass one of these constants: +AsyncThisDevice , +SyncThisDevice , +AsyncOtherDevices , +ReplayThisDevice , +AsyncAll , +or +SyncAll . + + + + + + time + + + +Specifies the time. This may be either a timestamp expressed in +milliseconds, or +CurrentTime . + + + + + + + + + +releases some queued events if the client has caused a device to freeze. +It has no effect if the specified time is earlier than the last-grab +time of the most recent active grab for the client and device, +or if the specified time is later than the current X server time. +The following describes the processing that occurs depending on what constant +you pass to the event_mode argument: + + + + +AsyncThisDevice + + + + +If the specified device is frozen by the client, event processing for that +continues as usual. If the device is frozen multiple times by the client on +behalf of multiple separate grabs, +AsyncThisDevice +thaws for all. +AsyncThisDevice +has no effect if the specified device is not frozen by the +client, but the device need not be grabbed by the client. + + + + +SyncThisDevice + + + + +If the specified device is frozen and actively grabbed by the client, +event processing for that device continues normally until the next +key or button event is reported to the client. +At this time, +the specified device again appears to freeze. +However, if the reported event causes the grab to be released, +the specified device does not freeze. +SyncThisDevice +has no effect if the specified device is not frozen by the client +or is not grabbed by the client. + + + + +ReplayThisDevice + + + + +If the specified device is actively grabbed by the client +and is frozen as the result of an event having been sent to the client +(either from the activation of a +GrabDeviceButton +or from a previous +AllowDeviceEvents +with mode +SyncThisDevice , +but not from a +Grab ), +the grab is released and that event is completely reprocessed. +This time, however, the request ignores any passive grabs at or above +(toward the root) the grab-window of the grab just released. +The request has no effect if the specified device is not grabbed by the client +or if it is not frozen as the result of an event. + + + + +AsyncOtherDevices + + + + +If the remaining devices are frozen by the client, +event processing for them continues as usual. +If the other devices are frozen multiple times by the client on behalf of +multiple separate grabs, +AsyncOtherDevices +``thaws'' for all. +AsyncOtherDevices +has no effect if the devices are not frozen by the client, +but those devices need not be grabbed by the client. + + + + +SyncAll + + + + +If all devices are frozen by the client, +event processing (for all devices) continues normally until the next +button or key event is reported +to the client for a grabbed device, +at which time the devices again appear to +freeze. However, if the reported event causes the grab to be released, +then the devices do not freeze (but if any device is still +grabbed, then a subsequent event for it will still cause all devices +to freeze). +SyncAll +has no effect unless all devices are frozen by the client. +If any device is frozen twice +by the client on behalf of two separate grabs, +SyncAll +"thaws" for both (but a subsequent freeze for +SyncAll +will freeze each device only once). + + + + +AsyncAll + + + + +If all devices are frozen by the +client, event processing (for all devices) continues normally. +If any device is frozen multiple times by the client on behalf of multiple +separate grabs, +AsyncAll +``thaws ''for all. +If any device is frozen twice by the client on behalf of two separate grabs, +AsyncAll +``thaws'' for both. +AsyncAll +has no effect unless all devices are frozen by the client. + + + + + +AsyncThisDevice , +SyncThisDevice , +and +ReplayThisDevice +have no effect on the processing of events from the remaining devices. +AsyncOtherDevices +has no effect on the processing of events from the specified device. +When the event_mode is +SyncAll +or +AsyncAll , +the device parameter is ignored. + + + +It is possible for several grabs of different devices (by the same +or different clients) to be active simultaneously. +If a device is frozen on behalf of any grab, +no event processing is performed for the device. +It is possible for a single device to be frozen because of several grabs. +In this case, +the freeze must be released on behalf of each grab before events can +again be processed. + + + + +can generate +BadDevice +and +BadValue +errors. + + + +Controlling Device Focus + + + + + +The current focus window for an extension input device can be +determined using the + +function. +Extension devices are focused using the + +function in the same way that the keyboard is focused using the core +XSetInputFocus +function, except that a device ID is passed as +a function parameter. One additional focus state, +FollowKeyboard , +is provided for extension devices. + + + +To get the current focus state, revert state, +and focus time of an extension device, use +XGetDeviceFocus . + + + + int XGetDeviceFocus + Display *display + XDevice *device + Window *focus_return + int *revert_to_return + Time *focus_time_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + focus_return + + + +Specifies the address of a variable into which the server can return the ID of +the window that contains the device focus or one of the constants +None , +PointerRoot , +or +FollowKeyboard . + + + + + + revert_to_return + + + +Specifies the address of a variable into which the server can +return the current revert_to status for the device. + + + + + + focus_time_return + + + +Specifies the address of a variable into which the server can +return the focus time last set for the device. + + + + + + + + + +returns the focus state, the revert-to state, +and the last-focus-time for an extension input device. + + + + +can generate +BadDevice +and +BadMatch +errors. + + + + +To set the focus of an extension device, use +XSetDeviceFocus . + + + + int XSetDeviceFocus + Display *display + XDevice *device + Window focus + int revert_to + Time time + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + focus + + + +Specifies the ID of the window to which the device's focus should be set. +This may be a window ID, or +PointerRoot , +FollowKeyboard , +or +None . + + + + + + revert_to + + + +Specifies to which window the focus of the device should revert +if the focus window becomes not viewable. One of the following +constants may be passed: +RevertToParent , +RevertToPointerRoot , +RevertToNone , +or +RevertToFollowKeyboard . + + + + + + time + + + +Specifies the time. You can pass either a timestamp, expressed in +milliseconds, or +CurrentTime . + + + + + + + + + +changes the focus for an extension input device and the +last-focus-change-time. It has no effect if the specified +time is earlier than the last-focus-change-time or is later than the +current X server time. Otherwise, the last-focus-change-time is set to the +specified time. +This function causes the X server to generate +DeviceFocusIn +and +DeviceFocusOut +events. + + + +The action taken by the server when this function is requested depends +on the value of the focus argument: + + + + +If the focus argument is +None , +all input events from this device will be discarded until a new focus window +is set. In this case, the revert_to argument is ignored. + + + + +If the focus argument is a window ID, it becomes the focus +window of the device. If an input event from the device would normally +be reported to this window or to one of its inferiors, the event is +reported normally. Otherwise, the event is reported relative to the focus +window. + + + + +If the focus argument is +PointerRoot , +the focus window is dynamically taken to be the root window +of whatever screen the pointer is on at each input event. +In this case, the revert_to argument is ignored. + + + + +If the focus argument is +FollowKeyboard , +the focus window is dynamically taken to be the same as the focus +of the X keyboard at each input event. + + + + + +The specified focus window must be viewable at the time + +is called. Otherwise, it generates a +BadMatch +error. +If the focus window later becomes not viewable, +the X server evaluates the revert_to argument +to determine the new focus window. + + + + +If the revert_to argument is +RevertToParent , +the focus reverts to the parent (or the closest viewable ancestor), +and the new revert_to value is taken to be +RevertToNone . + + + + +If the revert_to argument is +RevertToPointerRoot , +RevertToFollowKeyboard , +or +RevertToNone , +the focus reverts to that value. + + + + + +When the focus reverts, +the X server generates +DeviceFocusIn +and +DeviceFocusOut +events, but the last-focus-change time is not affected. + + + + +can generate +BadDevice , +BadMatch , +BadValue , +and +BadWindow +errors. + + + +Controlling Device Feedback + + + + + +To determine the current feedback settings of an extension input device, use +XGetFeedbackControl . + + + + XFeedbackState * XGetFeedbackControl + Display *display + XDevice *device + int *num_feedbacks_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + num_feedbacks_return + + + +Returns the number of feedbacks supported by the device. + + + + + + + + + +returns a list of +FeedbackState +structures that describe the feedbacks supported by the specified device. +There is an +XFeedbackState +structure for each class of feedback. These are of +variable length, but the first three members are common to all. + + + + + + + +typedef struct { + XID class; + int length; + XID id; +} XFeedbackState; + + + + + +The common members are as follows: + + + + +The class member identifies the class of feedback. +It may be compared to constants defined in the file +< X11/extensions/XI.h >. +Currently defined feedback constants include: +KbdFeedbackClass , +PtrFeedbackClass , +StringFeedbackClass , +IntegerFeedbackClass , +LedFeedbackClass , +and +BellFeedbackClass . + + + + +The length member specifies the length of the +FeedbackState +structure and can be used by clients to traverse the list. + + + + +The id member uniquely identifies a feedback for a given device and class. +This allows a device to support more than one feedback of the same class. +Other feedbacks of other classes or devices may have the same ID. + + + + + + +Those feedbacks equivalent to those +supported by the core keyboard are reported in class +KbdFeedback +using the +XKbdFeedbackState +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKbdFeedbackState; + + + + + +The additional members of the +XKbdFeedbackState +structure report the current state of the feedback: + + + + +The click member specifies the key-click volume and has a value in the range +0 (off) to 100 (loud). + + + + +The percent member specifies the bell volume and has a value in the range +0 (off) to 100 (loud). + + + + +The pitch member specifies the bell pitch in Hz. The range of the value is +implementation-dependent. + + + + +The duration member specifies the duration in milliseconds of the bell. + + + + +The led_mask member is a bit mask that describes the current state of up to +32 LEDs. A value of 1 in a bit indicates that the corresponding LED is on. + + + + +The global_auto_repeat member has a value of +AutoRepeatModeOn +or +AutoRepeatModeOff . + + + + +The auto_repeats member is a bit vector. Each bit set to 1 indicates +that auto-repeat is enabled for the corresponding key. The vector is +represented as 32 bytes. Byte N (from 0) contains the bits for keys +8N to 8N + 7, with the least significant bit in the byte representing +key 8N. + + + + + + +Those feedbacks equivalent to those +supported by the core pointer are reported in class +PtrFeedback +using the +XPtrFeedbackState +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackState; + + + + + +The additional members of the +XPtrFeedbackState +structure report the current state of the feedback: + + + + +The accelNum member returns the numerator for the acceleration multiplier. + + + + +The accelDenom member returns the denominator for the acceleration multiplier. + + + + +The accelDenom member returns the threshold for the acceleration. + + + + + + +Integer feedbacks are those capable of displaying integer numbers +and reported via the +XIntegerFeedbackState +structure. +The minimum and maximum values that they can display are reported. + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int resolution; + int minVal; + int maxVal; +} XIntegerFeedbackState; + + + + + +The additional members of the +XIntegerFeedbackState +structure report the capabilities of the feedback: + + + + +The resolution member specifies the number of digits that the feedback +can display. + + + + +The minVal member specifies the minimum value that the feedback can display. + + + + +The maxVal specifies the maximum value that the feedback can display. + + + + + + +String feedbacks are those that can display character information +and are reported via the +XStringFeedbackState +structure. +Clients set these feedbacks by passing a list of +KeySyms +to be displayed. +The + +function returns the +set of key symbols that the feedback can display, as well as the +maximum number of symbols that can be displayed. +The +XStringFeedbackState +structure is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int max_symbols; + int num_syms_supported; + KeySym *syms_supported; +} XStringFeedbackState; + + + + + +The additional members of the +XStringFeedbackState +structure report the capabilities of the feedback: + + + + +The max_symbols member specifies the maximum number of symbols +that can be displayed. + + + + +The syms_supported member is a pointer to the list of supported symbols. + + + + +The num_syms_supported member specifies the length of the list of supported symbols. + + + + + + +Bell feedbacks are those that can generate a sound +and are reported via the +XBellFeedbackState +structure. +Some implementations may support a bell as part of a +KbdFeedback +feedback. Class +BellFeedback +is provided for implementations that do not choose to do +so and for devices that support multiple feedbacks that can produce sound. +The meaning of the members is the same as that of the corresponding fields in +the +XKbdFeedbackState +structure. + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackState; + + + + + +Led feedbacks are those that can generate a light and are reported via the +XLedFeedbackState +structure. +Up to 32 lights per feedback are supported. +Each bit in led_mask +corresponds to one supported light, and the corresponding bit in led_values +indicates whether that light is currently on (1) or off (0). +Some implementations may support leds as part of a +KbdFeedback +feedback. +Class +LedFeedback +is provided for implementations that do not choose to do +so and for devices that support multiple led feedbacks. + + + + + + + +typedef struct { + XID class; + int length; + XID id; + Mask led_values; + Mask led_mask; +} XLedFeedbackState; + + + + + + +can generate +BadDevice +and +BadMatch +errors. + + + + +To free the information returned by the + +function, use +XFreeFeedbackList . + + + + void XFreeFeedbackList + XFeedbackState *list + + + + + + + list + + + +Specifies the pointer to the +XFeedbackState +structure returned by +a previous call to +XGetFeedbackControl . + + + + + + + + + +frees the list of feedback control information. + + + + +To change the settings of a feedback on an extension device, use +XChangeFeedbackControl . +This function modifies the current control values of the specified feedback +using information passed in the appropriate +XFeedbackControl +structure for the feedback. +Which values are modified depends on the valuemask passed. + + + + int XChangeFeedbackControl + Display *display + XDevice *device + unsignedlong valuemask + XFeedbackControl *value + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + valuemask + + + +Specifies one value for each bit in the mask (least to most significant +bit). The values are associated with the feedbacks for the specified +device. + + + + + + value + + + +Specifies a pointer to the +XFeedbackControl +structure. + + + + + + + + + +controls the device characteristics described by the +XFeedbackControl +structure. +There is an +XFeedbackControl +structure for each class of feedback. +These are of variable length, but the first +three members are common to all and are as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; +} XFeedbackControl; + + + + + +Feedback class +KbdFeedback +controls feedbacks equivalent to those provided by the core keyboard using the +KbdFeedbackControl +structure, which is defined as follows:. + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int led_value; + int key; + int auto_repeat_mode; +} XKbdFeedbackControl; + + + + + +This class controls the device characteristics described by the +XKbdFeedbackControl +structure. These include the key_click_percent, +global_auto_repeat, and individual key auto-repeat. Valid modes +are +AutoRepeatModeOn , +AutoRepeatModeOff , +and +AutoRepeatModeDefault . + + + +Valid masks are as follows: + + + + + +#define DvKeyClickPercent (1><<0) +#define DvPercent (1><<0) +#define DvPitch (1><<0) +#define DvDuration (1><<0) +#define DvLed (1><<0) +#define DvLedMode (1><<0) +#define DvKey (1><<0) +#define DvAutoRepeatMode (1><<0) + + + + +Feedback class +PtrFeedback +controls feedbacks equivalent to those provided by the core pointer using the +PtrFeedbackControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackControl; + + + + + +Which values are modified depends on the valuemask passed. + + + +Valid masks are as follows: + + + + +#define DvAccelnum (1L<<0) +#define DvAccelDenom (1L<<1) +#define DvThreshold (1L<<2) + + + + + + +The acceleration, expressed as a fraction, is a multiplier for movement. +For example, +specifying 3/1 means that the device moves three times as fast as normal. +The fraction may be rounded arbitrarily by the X server. +Acceleration takes effect only if the device moves more than threshold pixels at +once and applies only to the amount beyond the value in the threshold argument. +Setting a value to -1 restores the default. +The values of the accelNumerator and threshold fields must be nonzero for +the pointer values to be set. +Otherwise, the parameters will be unchanged. +Negative values generate a +BadValue +error, as does a zero value +for the accelDenominator field. + + + +This request fails with a +BadMatch +error if the specified device is not currently reporting relative motion. +If a device that is capable of reporting both relative and absolute motion +has its mode changed from +Relative +to +Absolute +by an + +request, valuator control values +will be ignored by the server while the device is in that mode. + + + +Feedback class +IntegerFeedback +controls integer feedbacks displayed on input devices and are +reported via the +IntegerFeedbackControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int int_to_display; +} XIntegerFeedbackControl; + + + + + +Valid masks are as follows: + + + + + +#define DvInteger (1L<<0) + + + + + +Feedback class +StringFeedback +controls string feedbacks displayed on input devices +and reported via the +StringFeedbackControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int num_keysyms; + KeySym *syms_to_display; +} XStringFeedbackControl; + + + + + +Valid masks are as follows: + + + + +#define DvString (1L<<0) + + + + + +Feedback class +BellFeedback +controls a bell on an input device and is reported via the +BellFeedbackControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackControl; + + + + + +Valid masks are as follows: + + + + + + +#define DvPercent (1L<<1) +#define DvPitch (1L<<2) +#define DvDuration (1L<<3) + + + + + +Feedback class +LedFeedback +controls lights on an input device and are reported via the +LedFeedbackControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID class; + int length; + XID id; + int led_mask; + int led_values; +} XLedFeedbackControl; + + + + + +Valid masks are as follows: + + + + + +#define DvLed (1L<<4) +#define DvLedMode (1L<<5) + + + + + + +can generate +BadDevice , +BadFeedBack , +BadMatch , +and +BadValue +errors. + + + +Ringing a Bell on an Input Device + + + + + +To ring a bell on an extension input device, use +XDeviceBell . + + + + int XDeviceBell + Display *display + XDevice *device + XIDfeedbackclass, feedbackid + int percent + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + feedbackclass + + + +Specifies the feedbackclass. Valid values are +KbdFeedbackClass +and +BellFeedbackClass . + + + + + + feedbackid + + + +Specifies the ID of the feedback that has the bell. + + + + + + percent + + + +Specifies the volume in the range -100 (quiet) to 100 percent (loud). + + + + + + + + + +is analogous to the core +XBell +function. It rings the specified bell on the specified input device feedback, +using the specified volume. +The specified volume is relative to the base volume for the feedback. +If the value for the percent argument is not in the range -100 to 100 +inclusive, a +BadValue +error results. +The volume at which the bell rings when the percent argument is nonnegative is: + + + + + base - [(base * percent) / 100] + percent + + + + +The volume at which the bell rings +when the percent argument is negative is: + + + + + base + [(base * percent) / 100] + + + + +To change the base volume of the bell, use +XChangeFeedbackControl . + + + + +can generate +BadDevice +and +BadValue +errors. + + + +Controlling Device Encoding + + + + + +To get the key mapping of an extension device that supports input class +Keys , +use +XGetDeviceKeyMapping . + + + + KeySym * XGetDeviceKeyMapping + Display *display + XDevice *device + KeyCode first_keycode_wanted + int keycode_count + int *keysyms_per_keycode_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + first_keycode_wanted + + + +Specifies the first keycode that is to be returned. + + + + + + keycode_count + + + +Specifies the number of keycodes that are to be returned. + + + + + + keysyms_per_keycode_return + + + +Returns the number of keysyms per keycode. + + + + + + + + + +is analogous to the core +XGetKeyboardMapping +function. +It returns the symbols for the specified number of keycodes for the +specified extension device. + + + + +returns the symbols for the +specified number of keycodes for the +specified extension device, starting with the specified keycode. +The first_keycode_wanted must be greater than or equal to +min-keycode as returned +by the + +request (else a +BadValue +error results). The following value: + +first_keycode_wanted + keycode_count - 1 + + + + +must be less than or equal to max-keycode as returned +by the + +request (else a +BadValue +error results). + + + +The number of elements in the keysyms list is as follows: + +keycode_count * keysyms_per_keycode_return + +And KEYSYM number N (counting from zero) for keycode K has an index +(counting from zero), in keysyms, of the following: + +(K - first_keycode_wanted) * keysyms_per_keycode_return + N + + + + +The keysyms_per_keycode_return value is chosen arbitrarily by the server +to be large enough to report all requested symbols. +A special KEYSYM value of +NoSymbol +is used to fill in unused elements for individual keycodes. + + + +To free the data returned by this function, use +XFree. + + + +If the specified device has not first been opened by this client via +XOpenDevice , +this request will fail with a +BadDevice +error. +If that device does not support input class +Keys , +this request will fail with a +BadMatch +error. + + + + +can generate +BadDevice , +BadMatch , +and +BadValue +errors. + + + + +To change the keyboard mapping of an extension device that supports input class +Keys , +use +XChangeDeviceKeyMapping . + + + + int XChangeDeviceKeyMapping + Display *display + XDevice *device + int first_keycode + int keysyms_per_keycode + KeySym *keysyms + int num_codes + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + first_keycode + + + +Specifies the first keycode that is to be changed. + + + + + + keysyms_per_keycode + + + +Specifies the keysyms that are to be used. + + + + + + keysyms + + + +Specifies a pointer to an array of keysyms. + + + + + + num_codes + + + +Specifies the number of keycodes that are to be changed. + + + + + + + + + +is analogous to the core +XChangeKeyboardMapping +function. +It defines the symbols for the specified number of keycodes for the +specified extension keyboard device. + + + +If the specified device has not first been opened by this client via +XOpenDevice , +this request will fail with a +BadDevice +error. +If the specified device does not support input class +Keys , +this request will fail with a +BadMatch +error. + + + +The number of elements in the keysyms list must be a multiple of +keysyms_per_keycode. Otherwise, + +generates a +BadLength +error. +The specified first_keycode must be greater than or equal to +the min_keycode value returned by the +ListInputDevices +request, or this request will fail with a +BadValue +error. In addition, if the following expression is not less than +the max_keycode value returned by the +ListInputDevices +request, the request will fail with a +BadValue +error: + + first_keycode + (num_codes / keysyms_per_keycode) - 1 + + + + + +can generate +BadAlloc , +BadDevice , +BadMatch , +and +BadValue +errors. + + + + +To obtain the keycodes that are used as modifiers on an +extension device that supports input class +Keys , +use +XGetDeviceModifierMapping . + + + + XModifierKeymap * XGetDeviceModifierMapping + Display *display + XDevice *device + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + + + + +is analogous to the core +XGetModifierMapping +function. +The + +function returns a newly created +XModifierKeymap +structure that contains the keys being used as +modifiers for the specified device. +The structure should be freed after use with +XFreeModifierMapping . +If only zero values appear in the set for any modifier, +that modifier is disabled. + + + + +can generate +BadDevice +and +BadMatch +errors. + + + + +To set which keycodes are to be used as modifiers for an extension device, use +XSetDeviceModifierMapping . + + + + int XSetDeviceModifierMapping + Display *display + XDevice *device + XModifierKeymap *modmap + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + modmap + + + +Specifies a pointer to the +XModifierKeymap +structure. + + + + + + + + + +is analogous to the core +XSetModifierMapping +function. +The + +function specifies the keycodes of the keys, if any, +that are to be used as modifiers. A zero value means +that no key should be used. No two arguments can have the same nonzero +keycode value. Otherwise, + +generates a +BadValue +error. +There are eight modifiers, and the modifiermap member of the +XModifierKeymap +structure contains eight sets of max_keypermod +keycodes, one for each modifier in the order +Shift , +Lock , +Control , +Mod1 , +Mod2 , +Mod3 , +Mod4 , +and +Mod5 . +Only nonzero keycodes have meaning in each set, and zero keycodes +are ignored. +In addition, all of the nonzero keycodes must be in the range specified by +min_keycode and max_keycode reported by the + +function. +Otherwise, +XSetModifierMapping +generates a +BadValue +error. +No keycode may appear twice in the entire map. +Otherwise, it generates a +BadValue +error. + + + +A X server can impose restrictions on how modifiers can be changed, +for example, +if certain keys do not generate up transitions in hardware or if multiple +modifier keys are not supported. +If some such restriction is violated, +the status reply is +MappingFailed , +and none of the modifiers are changed. +If the new keycodes specified for a modifier differ from those +currently defined and any (current or new) keys for that modifier are +in the logically down state, +the status reply is +MappingBusy , +and none of the modifiers are changed. +XSetModifierMapping +generates a +DeviceMappingNotify +event on a +MappingSuccess +status. + + + + +can generate +BadAlloc , +BadDevice , +BadMatch , +and +BadValue +errors. + + + +Controlling Button Mapping + + + + + +To set the mapping of the buttons on an extension device, use +XSetDeviceButtonMapping . + + + + int XSetDeviceButtonMapping + Display *display + XDevice *device + unsignedchar map[] + int nmap + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + map + + + +Specifies the mapping list. + + + + + + nmap + + + +Specifies the number of items in the mapping list. + + + + + + + + + +sets the mapping of the buttons on an extension device. +If it succeeds, the X server generates a +DeviceMappingNotify +event, and + +returns +MappingSuccess . +Elements of the list are indexed starting from one. +The length of the list must be the same as + +would return, or a +BadValue +error results. +The index is a button number, and the element of the list +defines the effective number. +A zero element disables a button, and elements are not restricted in +value by the number of physical buttons. +However, no two elements can have the same nonzero value, or a +BadValue +error results. +If any of the buttons to be altered are logically in the down state, + +returns +MappingBusy , +and the mapping is not changed. + + + + +can generate +BadDevice , +BadMatch , +and +BadValue +errors. + + + + +To get the button mapping, use +XGetDeviceButtonMapping . + + + + int XGetDeviceButtonMapping + Display *display + XDevice *device + unsignedchar map_return[] + int nmap + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + map_return + + + +Specifies the mapping list. + + + + + + nmap + + + +Specifies the number of items in the mapping list. + + + + + + + + + +returns the current mapping of the specified extension device. +Elements of the list are indexed starting from one. + +returns the number of physical buttons actually on the pointer. +The nominal mapping for the buttons is the identity mapping: map[i]=i. +The nmap argument specifies the length of the array where the button +mapping is returned, and only the first nmap elements are returned +in map_return. + + + + +can generate +BadDevice +and +BadMatch +errors. + + + +Obtaining the State of a Device + + + + + +To obtain information that describes the state of the keys, buttons, and +valuators of an extension device, use +XQueryDeviceState . + + + + XDeviceState * XQueryDeviceState + Display *display + XDevice *device + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + + + + +returns a pointer to an +XDeviceState +structure, which points to a list of +structures that describe the state of the keys, buttons, and valuators +on the device: + + + + + + + +typedef struct { + XID device_id; + int num_classes; + XInputClass *data; +} XDeviceState; + + + + + +The structures are of variable length, but the first +two members are common to all and are as follows: + + + + + + + +typedef struct { + unsigned char class; + unsigned char length; +} XInputClass; + + + + + +The class member contains a class identifier. This identifier can be +compared with constants defined in the file +< X11/extensions/XI.h >. +Currently defined constants are: +KeyClass , +ButtonClass , +and +ValuatorClass . + + + +The length member contains the length of the structure and can be used +by clients to traverse the list. + + + +The +XValuatorState +structure describes the current state of the valuators +on the device. +The num_valuators member contains the number of valuators +on the device. +The mode member is a mask whose bits report the data mode +and other state information for the device. +The following bits are currently defined: + + + + DeviceMode 1 << 0 Relative = 0, Absolute = 1 + ProximityState 1 << 1 InProximity = 0, OutOfProximity = 1 + +The valuators member contains a pointer to an array of integers that +describe the current value of the valuators. +If the mode is +Relative , +these values are undefined. + + + + + + + +typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int *valuators; +} XValuatorState; + + + + + +The +XKeyState +structure describes the current state of the keys +on the device. Byte N (from 0) contains the +bits for key 8N to 8N + 7 with the least significant bit in the +byte representing key 8N. + + + + + + + +typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; +} XKeyState; + + + + + +The +XButtonState +structure describes the current state of the buttons +on the device. Byte N (from 0) contains the bits for button 8N to 8N + 7 +with the least significant bit in the +byte representing button 8N. + + + + + + + +typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonState; + + + + + + +can generate +BadDevice +errors. + + + + +To free the data returned by this function, use +XFreeDeviceState . + + + + void XFreeDeviceState + XDeviceState *state + + + + + + + state + + + +Specifies the pointer to the +XDeviceState +data returned by a previous call to +XQueryDeviceState . + + + + + + + + + +frees the device state data. + + + + +Events + + + + + +The input extension creates input events analogous to the core input events. +These extension input events are generated by manipulating one of the +extension input devices. +The remainder of this section discusses the following X Input Extension +event topics: + + + + +Event types + + + + +Event classes + + + + +Event structures + + + + +Event Types + + + + + +Event types are integer numbers that a client can use to determine what +kind of event it has received. The client compares the type field of +the event structure with known event types to make this determination. + + + +The core input event types are constants and are defined in the header file +< X11/X.h >. +Extension event types are not constants. Instead, they +are dynamically allocated by the extension's request to the X server +when the extension is initialized. Because of this, extension event +types must be obtained by the client from the server. + + + +The client program determines the event type for an extension event by using +the information returned by the + +request. +This type can then be used for comparison with the type field +of events received by the client. + + + +Extension events propagate up the window hierarchy in the same manner +as core events. If a window is not interested in an extension event, +it usually propagates to the closest ancestor that is interested, +unless the dont_propagate list prohibits it. +Grabs of extension devices may alter the set of windows that receive a particular +extension event. + + + +The following table lists the event category and its associated event +type or types. + + + + + + + + + Event Category + Event Type + + + + + Device key + DeviceKeyPress + + + + DeviceKeyRelease + + + Device motion + DeviceButtonPress + + + + DeviceButtonRelease + + + + DeviceMotionNotify + + + Device input focus + DeviceFocusIn + + + + DeviceFocusOut + + + Device state notification + DeviceStateNotify + + + Device proximity + ProximityIn + + + + ProximityOut + + + Device mapping + DeviceMappingNotify + + + Device change + ChangeDeviceNotify + + + + + + + +Event Classes + + + + + +Event classes are integer numbers that are used in the same way as the +core event masks. They are used by a client program to indicate to the +server which events that client program wishes to receive. + + + +The core input event masks are constants and are defined in the header file +< X11/X.h >. +Extension event classes are not constants. Instead, they are dynamically +allocated by the extension's request to the X server +when the extension is initialized. Because of this, extension event +classes must be obtained by the client from the server. + + + +The event class for an extension event and device is obtained from +information returned by the + +function. +This class can then be used in an + +request to ask that events of that type from that device be sent to +the client program. + + + +For +DeviceButtonPress +events, the client may specify whether +or not an implicit passive grab should be done when the button is +pressed. If the client wants to guarantee that it will receive a +DeviceButtonRelease +event for each +DeviceButtonPress +event it receives, it should specify the +DeviceButtonPressGrab +class in addition to the +DeviceButtonPress +class. +This restricts the client in that only one client at a time +may request +DeviceButtonPress +events from the same device and +window if any client specifies this class. + + + +If any client has specified the +DeviceButtonPressGrab +class, any requests by any other client that specify the same device +and window and specify either +DeviceButtonPress +or +DeviceButtonPressGrab +will cause an +Access +error to be generated. + + + +If only the +DeviceButtonPress +class is specified, no implicit passive grab will be done when a button +is pressed on the device. +Multiple clients may use this class to specify the same device and +window combination. + + + +The client may also select +DeviceMotion +events only when a button is down. +It does this by specifying the event classes +DeviceButton1Motion +through +DeviceButton5Motion . +An input device will support only +as many button motion classes as it has buttons. + + + +Event Structures + + + + + +Each extension event type has a corresponding structure declared in +< X11/extensions/XInput.h >. +All event structures have the following common members: + + + + type + + + +Set to the event type number that uniquely identifies it. For example, +when the X server reports a +DeviceKeyPress +event to a client application, it sends an +XDeviceKeyPressEvent +structure. + + + + + + serial + + + +Set from the serial number reported in the protocol but expanded from the +16-bit least significant bits to a full 32-bit value. + + + + + + send_event + + + +Set to +True +if the event came from an +XSendEvent +request. + + + + + + display + + + +Set to a pointer to a structure that defines the display +on which the event was read. + + + + + + + +Extension event structures report the current position of the X pointer. +In addition, if the device reports motion data and is reporting absolute data, +the current value of any valuators the device contains is also reported. + + +Device Key Events + + + + + +Key events from extension devices contain all the information that is +contained in a key event from the X keyboard. In addition, they contain +a device ID and report the current value of any valuators on the device, +if that device is reporting absolute data. +If data for more than six valuators is being reported, more than one +key event will be sent. +The axes_count member contains the number of axes that are being +reported. The server sends as many of these events as are +needed to report the device data. Each event contains the total number +of axes reported in the axes_count member and the first axis reported +in the current event in the first_axis member. +If the device supports input class +Valuators , +but is not reporting absolute mode data, +the axes_count member contains zero (0). + + + +The location reported in +the x, y and x_root, y_root members is the location of the core X pointer. + + + +The +XDeviceKeyEvent +structure is defined as follows: + + + + + + + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int keycode; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} XDeviceKeyEvent; + +typedef XDeviceKeyEvent XDeviceKeyPressedEvent; +typedef XDeviceKeyEvent XDeviceKeyReleasedEvent; + + + + + +Device Button Events + + + + + +Button events from extension devices contain all the information that is +contained in a button event from the X pointer. In addition, they contain +a device ID and report the current value of any valuators on the device +if that device is reporting absolute data. +If data for more than six valuators is being reported, more than one +button event may be sent. +The axes_count member contains the number of axes that are being +reported. The server sends as many of these events as are +needed to report the device data. Each event contains the total number +of axes reported in the axes_count member and the first axis reported +in the current event in the first_axis member. +If the device supports input class +Valuators , +but is not reporting absolute mode data, +the axes_count member contains zero (0). + + + +The location reported in +the x, y and x_root, y_root members is the location of the core X pointer. + + + + + + + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int button; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} XDeviceButtonEvent; + +typedef XDeviceButtonEvent XDeviceButtonPressedEvent; +typedef XDeviceButtonEvent XDeviceButtonReleasedEvent; + + + + + +Device Motion Events + + + + + +Motion events from extension devices contain all the information that is +contained in a motion event from the X pointer. In addition, they contain +a device ID and report the current value of any valuators on the device. + + + +The location reported in +the x, y and x_root, y_root members is the location of the core X pointer, +and so is 2-dimensional. + + + +Extension motion devices may report motion data for a variable number of +axes. +The axes_count member contains the number of axes that are being +reported. The server sends as many of these events as are +needed to report the device data. Each event contains the total number +of axes reported in the axes_count member and the first axis reported +in the current event in the first_axis member. + + + + + + + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occurred on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + char is_hint; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} XDeviceMotionEvent; + + + + + +Device Focus Events + + + + + +These events are equivalent to the core focus events. +They contain the same information, with the addition +of a device ID to identify which device has had a focus change, +and a timestamp. + + + +DeviceFocusIn +and +DeviceFocusOut +events are generated for +focus changes of extension devices in the same manner as core focus +events are generated. + + + + + + + +typedef struct { + int type; /* of event */ + 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; /* "event" window it is reported relative to */ + XID deviceid; + int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + */ + Time time; +} XDeviceFocusChangeEvent; + +typedef XDeviceFocusChangeEvent XDeviceFocusInEvent; +typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent; + + + + + +Device StateNotify Event + + + + + +This event is analogous to the core keymap event but +reports the current state of the device for each +input class that it supports. +It is generated after every +DeviceFocusIn +event and +EnterNotify +event and is delivered to clients who have selected +XDeviceStateNotify +events. + + + +If the device supports input class +Valuators , +the mode member in the +XValuatorStatus +structure is a bitmask that reports the device mode, +proximity state, and other state information. +The following bits are currently defined: + + + + 0x01 Relative = 0, Absolute = 1 + 0x02 InProximity = 0, OutOfProximity = 1 + + + + +If the device supports more valuators than can be reported in a single +XEvent , +multiple +XDeviceStateNotify +events will be generated. + + + + + + + +typedef struct { + unsigned char class; + unsigned char length; +} XInputClass; + +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; + XID deviceid; + Time time; + int num_classes; + char data[64]; +} XDeviceStateNotifyEvent; + +typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int valuators[6]; +} XValuatorStatus; + +typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; +} XKeyStatus; + +typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonStatus; + + + + + +Device Mapping Event + + + + + +This event is equivalent to the core +MappingNotify +event. +It notifies client programs when the mapping of keys, +modifiers, or buttons on an extension device has changed. + + + + + + + +typedef struct { + int type; + unsigned long serial; + Bool send_event; + Display *display; + Window window; + XID deviceid; + Time time; + int request; + int first_keycode; + int count; +} XDeviceMappingEvent; + + + + + +ChangeDeviceNotify Event + + + + + +This event has no equivalent in the core protocol. It notifies client +programs when one of the core devices has been changed. + + + + + + + +typedef struct { + int type; + unsigned long serial; + Bool send_event; + Display *display; + Window window; + XID deviceid; + Time time; + int request; +} XChangeDeviceNotifyEvent; + + + + + +Proximity Events + + + + + +These events have no equivalent in the core protocol. Some input +devices such as graphics tablets or touchscreens may send these +events to indicate that a stylus has moved into or out of contact +with a positional sensing surface. + + + +The event contains the current value of any valuators on the device +if that device is reporting absolute data. +If data for more than six valuators is being reported, more than one +proximity event may be sent. +The axes_count member contains the number of axes that are being +reported. The server sends as many of these events as are +needed to report the device data. Each event contains the total number +of axes reported in the axes_count member and the first axis reported +in the current event in the first_axis member. +If the device supports input class +Valuators , +but is not reporting absolute mode data, +the axes_count member contains zero (0). + + + + + + + +typedef struct { + int type; /* ProximityIn or ProximityOut */ + 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; + XID deviceid; + Window root; + Window subwindow; + Time time; + int x, y; + int x_root, y_root; + unsigned int state; + Bool same_screen; + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} XProximityNotifyEvent; + +typedef XProximityNotifyEvent XProximityInEvent; +typedef XProximityNotifyEvent XProximityOutEvent; + + + + + + + +Event Handling Functions + + + + + +This section discusses the X Input Extension +event handling functions that allow you to: + + + + +Determine the extension version + + + + +List the available devices + + + + +Enable and disable extension devices + + + + +Change the mode of a device + + + + +Initialize valuators on an input device + + + + +Get input device controls + + + + +Change input device controls + + + + +Select extension device events + + + + +Determine selected device events + + + + +Control event propogation + + + + +Send an event + + + + +Get motion history + + + + +Determining the Extension Version + + + + + + + + + XExtensionVersion * XGetExtensionVersion + Display *display + char *name + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + name + + + +Specifies the name of the desired extension. + + + + + + + + + +allows a client to determine whether a server supports +the desired version of the input extension. + + + +The +XExtensionVersion +structure returns information about the version of the extension +supported by the server and is defined as follows: + + + + + + + +typedef struct { + Bool present; + short major_version; + short minor_version; +} XExtensionVersion; + + + + + +The major and minor versions can be compared with constants defined in +the header file +< X11/extensions/XI.h >. +Each version is a superset of the previous versions. + + + +You should use +XFree. +to free the data returned by this function. + + + +Listing Available Devices + + + + + +A client program that wishes to access a specific device +must first determine whether that device is connected to the X server. This +is done through the + +function, which will return a list of all devices that can be opened +by the X server. The client program can use one +of the names defined in the +< X11/extensions/XI.h > +header file in an +XInternAtom +request to determine the device type of the desired device. This type +can then be compared with the device types returned by the + +request. + + + + + + + XDeviceInfo * XListInputDevices + Display *display + int *ndevices + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + ndevices + + + +Specifies the address of a variable into which the server +can return the number of input devices available to the X server. + + + + + + + + + +allows a client to determine which devices +are available for X input and information about those devices. +An array of +XDeviceInfo +structures is returned, with one element in the array for each device. +The number of devices is returned in the ndevices argument. + + + +The X pointer device and X keyboard device are reported, as well as +all available extension input devices. The use member of the +XDeviceInfo +structure specifies the current use of the device. +If the value of this member is +IsXPointer , +the device is the X pointer device. If the value is +IsXKeyboard , +the device is the X keyboard device. If the value is +IsXExtensionDevice , +the device is available for use as an extension input device. + + + +Each +XDeviceInfo +entry contains a pointer to a list of structures +that describe the characteristics of each class +of input supported by that device. The num_classes member +contains the number of entries in that list. + + + +If the device supports input class +Valuators , +one of the structures pointed to by the +XDeviceInfo +structure will be an +XValuatorInfo +structure. The axes member of that structure +contains the address of an array of +XAxisInfo +structures. +There is one element in this array for each axis of motion +reported by the device. The number of elements in this +array is contained in the num_axes element of the +XValuatorInfo +structure. +The size of the motion buffer for the device is +reported in the motion_buffer member of the +XValuatorInfo +structure. + + + +The +XDeviceInfo +structure is defined as follows: + + + + + + + +typedef struct _XDeviceInfo { + XID id; + Atom type; + char *name; + int num_classes; + int use; + XAnyClassPtr inputclassinfo; +} XDeviceInfo; + + + + + +The structures pointed to by the +XDeviceInfo +structure are defined as follows: + + + + + + + +typedef struct _XKeyInfo { + XID class; + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; +} XKeyInfo; + +typedef struct _XButtonInfo { + XID class; + int length; + short num_buttons; +} XButtonInfo; + +typedef struct _XValuatorInfo { + XID class; + int length; + unsigned char num_axes; + unsigned char mode; + unsigned long motion_buffer; + XAxisInfoPtr axes; +} XValuatorInfo; + + + + + +The +XAxisInfo +structure pointed to by the +XValuatorInfo +structure is defined as follows: + + + + + + + +typedef struct _XAxisInfo { + int resolution; + int min_value; + int max_value; +} XAxisInfo; + + + + + +The following atom names are defined in the +< X11/extensions/XI.h > +header file. + + + +MOUSE QUADRATURE +TABLET SPACEBALL +KEYBOARD DATAGLOVE +TOUCHSCREEN EYETRACKER +TOUCHPAD CURSORKEYS +BUTTONBOX FOOTMOUSE +BARCODE ID_MODULE +KNOB_BOX ONE_KNOB +TRACKBALL NINE_KNOB\s+1 + + + + +These names can be used in an +XInternAtom +request to return an atom that can be used for comparison +with the type member of the +XDeviceInfo +structure. + + + + +returns NULL if there are no input devices to list. + + + + +To free the data returned by +XListInputDevices , +use +XFreeDeviceList . + + + + + + + + void XFreeDeviceList + XDeviceInfo *list + + + + + + + list + + + +Specifies the pointer to the +XDeviceInfo +array returned by a previous call to +XListInputDevices . + + + + + + + + + +frees the list of input device information. + + + +Enabling and Disabling Extension Devices + + + + + +Each client program that wishes to access an extension device must request +that the server open that device by calling the + +function. + + + + XDevice * XOpenDevice + Display *display + XID device_id + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device_id + + + +Specifies the ID that uniquely identifies the device to be opened. +This ID is obtained from the + +request. + + + + + + + + + +opens the device for the requesting client and, on success, returns an +XDevice +structure, which is defined as follows: + + + + + + + +typedef struct { + XID device_id; + int num_classes; + XInputClassInfo *classes; +} XDevice; + + + + + +The +XDevice +structure contains a pointer to an array of +XInputClassInfo +structures. Each element in that array +contains information about events of a particular input class supported +by the input device. + + + +The +XInputClassInfo +structure is defined as follows: + + + + + + + +typedef struct { + unsigned char input_class; + unsigned char event_type_base; +} XInputClassInfo; + + + + + +A client program can determine the event +type and event class for a given event by using macros defined by the +input extension. The name of the macro corresponds to the desired event, +and the macro is passed the structure that describes the device from which +input is desired, for example: + + + + + + + DeviceKeyPress(XDevice *device, event_type, event_class) + + + + +The macro will fill in the values of the event class to be used in an + +request to select the event and the event type to be used in comparing +with the event types of events received via +XNextEvent. + + + + +can generate +BadDevice +errors. + + + + +Before terminating, the client program should request that the server close +the device by calling the + +function. + + + + int XCloseDevice + Display *display + XDevice *device + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device to be closed. + + + + + + + + + +closes the device for the requesting client and frees the associated +XDevice +structure. + + + +A client may open the same extension device more than once. Requests +after the first successful one return an additional +XDevice +structure +with the same information as the first, but otherwise have no effect. +A single + +request will terminate that client's access to the device. + + + +Closing a device releases any active or passive grabs the requesting client +has established. If the device is frozen only by an active grab of the +requesting client, any queued events are released. + + + +If a client program terminates without closing a device, the server will +automatically close that device on behalf of the client. This does not +affect any other clients that may be accessing that device. + + + + +can generate +BadDevice +errors. + + + +Changing the Mode of a Device + + + + + +Some devices are capable of reporting either relative or absolute motion +data. +To change the mode of a device from relative to absolute, use +XSetDeviceMode . + + + + int XSetDeviceMode + Display *display + XDevice *device + int mode + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device whose mode should be changed. + + + + + + mode + + + +Specifies the mode. You can pass +Absolute +or +Relative . + + + + + + + + + +allows a client to request the server to change the mode of a +device that is capable of reporting either absolute positional data or relative +motion data. If the device is invalid or if the client has not previously +requested that the server open the device via an + +request, this request will fail with a +BadDevice +error. +If the device does not support input class +Valuators +or if it is not capable of reporting the specified mode, +the request will fail with a +BadMatch +error. + + + +This request will fail and return +DeviceBusy +if another client has already opened the device and requested a different mode. + + + + +can generate +BadDevice , +BadMatch , +BadMode , +and +DeviceBusy +errors. + + + +Initializing Valuators on an Input Device + + + + + +Some devices that report absolute positional data can be initialized to a +starting value. Devices that are capable of reporting relative motion or +absolute positional data may require that their valuators be initialized +to a starting value after the mode of the device is changed to +Absolute . + + + + +To initialize the valuators on such a device, use +XSetDeviceValuators . + + + + Status XSetDeviceValuators + Display *display + XDevice *device + int*valuators,first_valuator, num_valuators + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device whose valuators should be initialized. + + + + + + valuators + + + +Specifies the values to which each valuator should be set. + + + + + + first_valuator + + + +Specifies the first valuator to be set. + + + + + + num_valuators + + + +Specifies the number of valuators to be set. + + + + + + + + + +initializes the specified valuators on the specified extension +input device. Valuators are numbered beginning with zero. Only the valuators +in the range specified by first_valuator and num_valuators are set. +A +BadValue +error results if the number of valuators supported by the device +is less than the following expression: + + + + first_valuator + num_valuators + + + + +If the request succeeds, +Success +is returned. If the specified device is grabbed by some other client, +the request will fail and a status of +AlreadyGrabbed +will be returned. + + + + +can generate +BadDevice , +BadLength , +BadMatch , +and +BadValue +errors. + + + +Getting Input Device Controls + + + + + +Some input devices support various configuration controls +that can be queried or changed by clients. The set of supported +controls will vary from one input device to another. Requests +to manipulate these controls will fail if either the target +X server or the target input device does not support the +requested device control. + + + +Each device control has a unique identifier. Information +passed with each device control varies in length and is mapped +by data structures unique to that device control. + + + + +To query a device control, use +XGetDeviceControl . + + + + XDeviceControl * XGetDeviceControl + Display *display + XDevice *device + int control + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device whose configuration control status is to be returned. + + + + + + control + + + +Identifies the specific device control to be queried. + + + + + + + + + +returns the current state of the specified device control. +If the target X server does not support that device control, a +BadValue +error is returned. +If the specified device does not support that device control, a +BadMatch +error +is returned. + + + +If the request is successful, a pointer to a generic +XDeviceState +structure is returned. The information returned varies according +to the specified control and is mapped by a structure appropriate +for that control. +The first two members are common to all device controls +and are defined as follows: + + + + + + + +typedef struct { + XID control; + int length; +} XDeviceState; +\fP + + + + + +The control may be compared to constants defined in the file +< X11/extensions/XI.h >. +Currently defined device controls include DEVICE_RESOLUTION. + + + +The information returned for the DEVICE_RESOLUTION control is +defined in the +XDeviceResolutionState +structure, which is defined as follows: + + + + + + + +typedef struct { + XID control; + int length; + int num_valuators; + int *resolutions; + int *min_resolutions; + int *max_resolutions; +} XDeviceResolutionState; + + + + + +This device control returns a list of valuators and the range of +valid resolutions allowed for each. Valuators are numbered +beginning with zero (0). Resolutions for all valuators on the device are +returned. For each valuator i on the device, resolutions[i] returns +the current setting of the resolution, min_resolutions[i] returns +the minimum valid setting, and max_resolutions[i] returns the +maximum valid setting. + + + +When this control is specified, + +fails with a +BadMatch +error if the specified device has no valuators. + + + + +can generate +BadMatch +and +BadValue +errors. + + + +Changing Input Device Controls + + + + + +Some input devices support various configuration controls +that can be changed by clients. Typically, this would be +done to initialize the device to a known state or configuration. +The set of supported controls will vary from one input device +to another. Requests to manipulate these controls will fail if +either the target X server or the target input device does not +support the requested device control. Setting the device control +will also fail if the target input device is grabbed by another +client or is open by another client and has been set to a conflicting +state. + + + +Each device control has a unique identifier. Information +passed with each device control varies in length and is mapped +by data structures unique to that device control. + + + + +To change a device control, use +XChangeDeviceControl . + + + + Status XChangeDeviceControl + Display *display + XDevice *device + int control + XDeviceControl *value + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device whose configuration control status is to be modified. + + + + + + control + + + +Identifies the specific device control to be changed. + + + + + + value + + + +Specifies a pointer to an +XDeviceControl +structure that describes which control is to be changed +and how it is to be changed. + + + + + + + + + +changes the current state of the specified device control. +If the target X server does not support that device control, a +BadValue +error is returned. +If the specified device does not support that device control, a +BadMatch +error is returned. +If another client has the target device grabbed, a status of +AlreadyGrabbed +is returned. +If another client has the device open and has set it to a +conflicting state, a status of +DeviceBusy +is returned. +If the request fails for any reason, the device control will not +be changed. + + + +If the request is successful, the device control will be changed +and a status of +Success +is returned. +The information passed varies according to the specified control +and is mapped by a structure appropriate for that control. +The first two members are common to all device controls: + + + + + + + +typedef struct { + XID control; + int length; +} XDeviceControl; + + + + + +The control may be set using constants defined in the +< X11/extensions/XI.h > +header file. +Currently defined device controls include DEVICE_RESOLUTION. + + + +The information that can be changed by the DEVICE_RESOLUTION +control is defined in the +XDeviceResolutionControl +structure, which is defined as follows: + + + + + + + +typedef struct { + XID control; + int length; + int first_valuator; + int num_valuators; + int *resolutions; +} XDeviceResolutionControl; + + + + + +This device control changes the resolution of the specified +valuators on the specified extension input device. Valuators +are numbered beginning with zero. Only the valuators in the range +specified by first_valuator and num_valuators are set. A value +of -1 in the resolutions list indicates that the resolution for +this valuator is not to be changed. The num_valuators member +specifies the number of valuators in the resolutions list. + + + +When this control is specified, + +fails with a +BadMatch +error if the specified device has no valuators. +If a resolution is specified that is not within the range of valid values +(as returned by +XGetDeviceControl ), + +fails with a +BadValue +error. +A +BadValue +error results if the number of valuators supported by the device +is less than the following expression: + + + + + + + first_valuator + num_valuators, + + + + + +can generate +BadMatch +and +BadValue +errors. + + + +Selecting Extension Device Events + + + + + +To select device input events, use +XSelectExtensionEvent . +The parameters passed are a pointer to +a list of classes that define the desired event types and devices, a count +of the number of elements in the list, and the ID of the window from which +events are desired. + + + + int XSelectExtensionEvent + Display *display + Window window + XEventClass *event_list + int event_count + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + window + + + +Specifies the ID of the window from which the client wishes to receive events. + + + + + + event_list + + + +Specifies a pointer to an array of event classes +that specify which events are desired. + + + + + + event_count + + + +Specifies the number of elements in the event_list. + + + + + + + + + +requests the server to send events that match the events and +devices described by the event list and that come from the requested +window. +The elements of the +XEventClass +array are the event_class values +obtained by invoking a macro with the pointer to an +XDevice +structure returned by the + +request. +For example, the +DeviceKeyPress +macro would return the +XEventClass +for +DeviceKeyPress +events from the specified device if it were invoked in the following form: + + + + DeviceKeyPress (XDevice *device, event_type, event_class) + + + + +Macros are defined for the following event classes: + +DeviceKeyPress +DeviceKeyRelease +DeviceButtonPress +DeviceButtonRelease +DeviceMotionNotify +DeviceFocusIn +DeviceFocusOut +ProximityIn +ProximityOut +DeviceStateNotify +DeviceMappingNotify +ChangeDeviceNotify +DevicePointerMotionHint +DeviceButton1Motion +DeviceButton2Motion +DeviceButton3Motion, +DeviceButton4Motion +DeviceButton5Motion +DeviceButtonMotion, +DeviceOwnerGrabButton +DeviceButtonPressGrab + + + + +To get the next available event from within a client program, use the core +XNextEvent +function. This returns the next event whether it +came from a core device or an extension device. + + + +Succeeding + +requests using event classes +for the same device as was specified on a previous request will replace +the previous set of selected events from that device with the new set. + + + + +can generate +BadAccess , +BadClass , +BadLength , +and +BadWindow +errors. + + + +Determining Selected Device Events + + + + + +To determine which extension events are currently selected from a given +window, use +XGetSelectedExtensionEvents . + + + + int XGetSelectedExtensionEvents + Display *display + Window window + int *this_client_count + XEventClass **this_client + int *all_clients_count + XEventClass **all_clients + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + window + + + +Specifies the ID of the window from which the client wishes to receive events. + + + + + + this_client_count + + + +Returns the number of elements in the this_client list. + + + + + + this_client + + + +Returns a list of +XEventClasses +that specify which events are +selected by this client. + + + + + + all_clients_count + + + +Returns the number of elements in the all_clients list. + + + + + + all_clients + + + +Returns a list of +XEventClasses +that specify which events are +selected by all clients. + + + + + + + + + +returns pointers to two event class arrays. +One lists the extension events selected by this client from +the specified window. The other lists the extension events selected by +all clients from the specified window. This information is analogous +to that returned in your_event_mask and all_event_masks of the +XWindowAttributes +structure when an +XGetWindowAttributes +request is made. +To free the two arrays returned by this function, use +XFree. + + + + +can generate +BadWindow +errors. + + + +Controlling Event Propagation + + + + + +Extension events propagate up the window hierarchy in the same manner +as core events. If a window is not interested in an extension event, +it usually propagates to the closest ancestor that is interested, +unless the dont_propagate list prohibits it. +Grabs of extension devices may alter the set of windows that receive a +particular extension event. + + + +Client programs may control event propagation through the use +of the following two functions: + +and +XGetDeviceDontPropagateList . + + + + + + + int XChangeDeviceDontPropagateList + Display *display + Window window + int event_count + XEventClass *events + int mode + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + window + + + +Specifies the desired window. + + + + + + event_count + + + +Specifies the number of elements in the events list. + + + + + + events + + + +Specifies a pointer to the list of XEventClasses. + + + + + + mode + + + +Specifies the mode. You can pass +AddToList +or +DeleteFromList . + + + + + + + + + +adds an event to or deletes an event from the do_not_propagate list +of extension events for the specified window. +There is one list per window, and the list remains for the life of the window. +The list is not altered if a client that changed the list terminates. + + + +Suppression of event propagation is not allowed for all events. If a +specified +XEventClass +is invalid because suppression of that event is not allowed, a +BadClass +error results. + + + + +can generate +BadClass , +BadMode , +and +BadWindow +errors. + + + + + + + + XEventClass * XGetDeviceDontPropagateList + Display *display + Window window + int *event_count + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + window + + + +Specifies the desired window. + + + + + + event_count + + + +Returns the number of elements in the array returned by this function. + + + + + + + + + +allows a client to determine the do_not_propagate list of extension events +for the specified window. +It returns an array of +XEventClass , +each +XEventClass +representing a device/event type pair. +To free the data returned by this function, use +XFree. + + + + +can generate +BadWindow +errors. + + + +Sending an Event + + + + + +To send an extension event to another client, use +XSendExtensionEvent . + + + + int XSendExtensionEvent + Display *display + XDevice *device + Window window + Bool propagate + int event_count + XEventClass *event_list + XEvent *event + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the device whose ID is recorded in the event. + + + + + + window + + + +Specifies the destination window ID. You can pass a window ID, +PointerWindow +or +InputFocus . + + + + + + propagate + + + +Specifies a boolean value that is either +True +or +False . + + + + + + event_count + + + +Specifies the number of elements in the event_list array. + + + + + + event_list + + + +Specifies a pointer to an array of +XEventClass . + + + + + + event + + + +Specifies a pointer to the event that is to be sent. + + + + + + + + + +identifies the destination window, determines which clients should receive +the specified event, and ignores any active grabs. +It requires a list of +XEventClass +to be specified. +These are obtained by opening an input device with the + +request. + + + + +uses the window argument to identify the destination window as follows: + + + + +If you pass +PointerWindow , +the destination window is the window that contains the pointer. + + + + +If you pass +InputFocus +and if the focus window contains the pointer, +the destination window is the window that contains the pointer. +If the focus window does not contain the pointer, +the destination window is the focus window. + + + + + +To determine which clients should receive the specified events, + +uses the propagate argument as follows: + + + + +If propagate is +False , +the event is sent to every client selecting +from the destination window +any of the events specified in the event_list array. + + + + +If propagate is +True +and no clients have selected from the destination window +any of the events specified in the event_list array, the destination is +replaced with the closest ancestor of destination for which some client +has selected one of the specified events and for which no intervening +window has that event in its do_not_propagate mask. +If no such window exists, +or if the window is an ancestor of the focus window, and +InputFocus +was originally specified as the destination, +the event is not sent to any clients. Otherwise, the event is reported to every +client selecting on the final destination any of the events specified +in event_list. + + + + + +The event in the +XEvent +structure must be one of the events defined +by the input extension, so that the X server can correctly byte swap the +contents as necessary. The contents of the event are otherwise unaltered +and unchecked by the X server except to force send_event to +True +in the forwarded event and to set the sequence number in the event correctly. + + + + +returns zero if the conversion-to-wire protocol failed; +otherwise, it returns nonzero. + + + + +can generate +BadClass , +BadDevice , +BadValue , +and +BadWindow +errors. + + + +Getting Motion History + + + + + + + + + XDeviceTimeCoord * XGetDeviceMotionEvents + axis_count_return) + Display *display + XDevice *device + Timestart, stop + int *nevents_return + int *mode_return + int *axis_count_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + device + + + +Specifies the desired device. + + + + + + start + + + +Specifies the start time. + + + + + + stop + + + +Specifies the stop time. + + + + + + nevents_return + + + +Returns the number of positions in the motion buffer returned +for this request. + + + + + + mode_return + + + +Returns the mode of the nevents information. +The mode will be one of the following: +Absolute +or +Relative . + + + + + + axis_count_return + + + +Returns the number of axes reported in each of the positions returned. + + + + + + + + + +returns all positions in the device's motion history buffer +that fall between the specified start and stop times inclusive. +If the start time is in the future or is later than the stop time, +no positions are returned. + + + +The return type for this function is an +XDeviceTimeCoord +structure, which is defined as follows: + + + + + + + +typedef struct { + Time time; + unsigned int *data; +} XDeviceTimeCoord; + + + + + +The data member is a pointer to an array of data items. +Each item is of type int, and there is one data item +per axis of motion reported by the device. +The number of axes reported by the device is returned in the axis_count variable. + + + +The value of the data items depends on the mode of the device. +The mode is returned in the mode variable. If the +mode is +Absolute , +the data items are the raw values generated by the device. +These may be scaled by the client program using the +maximum values that the device can generate for each axis of motion +that it reports. The maximum value for each axis is reported in +the max_val member of the +XAxisInfo +structure, which is part of the information returned by the + +request. + + + +If the mode is +Relative , +the data items are the relative values generated by the device. +The client program must choose an initial +position for the device and maintain a current position by +accumulating these relative values. + + + +Consecutive calls to + +can return data of different modes, that is, if +some client program has changed the mode of the device via an + +request. + + + + +can generate +BadDevice +and +BadMatch +errors. + + + + +To free the data returned by +XGetDeviceMotionEvents , +use +XFreeDeviceMotionEvents . + + + + + + + void XFreeDeviceMotionEvents + XDeviceTimeCoord *events + + + + + + + events + + + +Specifies the pointer to the +XDeviceTimeCoord +array returned by a previous call to +XGetDeviceMotionEvents . + + + + + + + + + +frees the specified array of motion information. + + + + + + + + + +Appendix A + + + + + + +The following information is contained in the <X11/extensions/XInput.h> +and <X11/extensions/XI.h> header files: + + + + +/* Definitions used by the library and client */ + +#ifndef _XINPUT_H_ +#define _XINPUT_H_ + +#ifndef _XLIB_H_ +#include <X11/Xlib.h> +#endif + +#ifndef _XI_H_ +#include "XI.h" +#endif + +#define _deviceKeyPress 0 +#define _deviceKeyRelease 1 + +#define _deviceButtonPress 0 +#define _deviceButtonRelease 1 + +#define _deviceMotionNotify 0 + +#define _deviceFocusIn 0 +#define _deviceFocusOut 1 + +#define _proximityIn 0 +#define _proximityOut 1 + +#define _deviceStateNotify 0 +#define _deviceMappingNotify 1 +#define _changeDeviceNotify 2 + +#define FindTypeAndClass(d, type, class, classid, offset) \ + { int i; XInputClassInfo *ip; \ + type = 0; class = 0; \ + for (i=0, ip= ((XDevice *) d)->classes; \ + i< ((XDevice *) d)->num_classes; \ + i++, ip++) \ + if (ip->input_class == classid) \ + {type = ip->event_type_base + offset; \ + class = ((XDevice *) d)->device_id << 8 | type;}} + +#define DeviceKeyPress(d, type, class) \ + FindTypeAndClass(d, type, class, KeyClass, _deviceKeyPress) + +#define DeviceKeyRelease(d, type, class) \ + FindTypeAndClass(d, type, class, KeyClass, _deviceKeyRelease) + +#define DeviceButtonPress(d, type, class) \ + FindTypeAndClass(d, type, class, ButtonClass, _deviceButtonPress) + +#define DeviceButtonRelease(d, type, class) \ + FindTypeAndClass(d, type, class, ButtonClass, _deviceButtonRelease) + +#define DeviceMotionNotify(d, type, class) \ + FindTypeAndClass(d, type, class, ValuatorClass, _deviceMotionNotify) + +#define DeviceFocusIn(d, type, class) \ + FindTypeAndClass(d, type, class, FocusClass, _deviceFocusIn) + +#define DeviceFocusOut(d, type, class) \ + FindTypeAndClass(d, type, class, FocusClass, _deviceFocusOut) + +#define ProximityIn(d, type, class) \ + FindTypeAndClass(d, type, class, ProximityClass, _proximityIn) + +#define ProximityOut(d, type, class) \ + FindTypeAndClass(d, type, class, ProximityClass, _proximityOut) + +#define DeviceStateNotify(d, type, class) \ + FindTypeAndClass(d, type, class, OtherClass, _deviceStateNotify) + +#define DeviceMappingNotify(d, type, class) \ + FindTypeAndClass(d, type, class, OtherClass, _deviceMappingNotify) + +#define ChangeDeviceNotify(d, type, class) \ + FindTypeAndClass(d, type, class, OtherClass, _changeDeviceNotify) + +#define DevicePointerMotionHint(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;} + +#define DeviceButton1Motion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;} + +#define DeviceButton2Motion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;} + +#define DeviceButton3Motion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;} + +#define DeviceButton4Motion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;} + +#define DeviceButton5Motion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;} + +#define DeviceButtonMotion(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;} + +#define DeviceOwnerGrabButton(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;} + +#define DeviceButtonPressGrab(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;} + +#define NoExtensionEvent(d, type, class) \ + { class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;} + +#define BadDevice(dpy, error) _xibaddevice(dpy, &error) + +#define BadClass(dpy, error) _xibadclass(dpy, &error) + +#define BadEvent(dpy, error) _xibadevent(dpy, &error) + +#define BadMode(dpy, error) _xibadmode(dpy, &error) + +#define DeviceBusy(dpy, error) _xidevicebusy(dpy, &error) + +/*************************************************************** + * + * DeviceKey events. These events are sent by input devices that + * support input class Keys. + * The location of the X pointer is reported in the coordinate + * fields of the x,y and x_root,y_root fields. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if from SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int keycode; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceKeyEvent; + +typedef XDeviceKeyEvent XDeviceKeyPressedEvent; +typedef XDeviceKeyEvent XDeviceKeyReleasedEvent; + +/******************************************************************* + * + * DeviceButton events. These events are sent by extension devices + * that support input class Buttons. + * + */ + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + unsigned int button; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceButtonEvent; + +typedef XDeviceButtonEvent XDeviceButtonPressedEvent; +typedef XDeviceButtonEvent XDeviceButtonReleasedEvent; + +/******************************************************************* + * + * DeviceMotionNotify event. These events are sent by extension devices + * that support input class Valuators. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + Window root; /* root window that the event occured on */ + Window subwindow; /* child window */ + Time time; /* milliseconds */ + int x, y; /* x, y coordinates in event window */ + int x_root; /* coordinates relative to root */ + int y_root; /* coordinates relative to root */ + unsigned int state; /* key or button mask */ + char is_hint; /* detail */ + Bool same_screen; /* same screen flag */ + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XDeviceMotionEvent; + +/******************************************************************* + * + * DeviceFocusChange events. These events are sent when the focus + * of an extension device that can be focused is changed. + * + */ + +typedef struct + { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* "event" window reported relative to */ + XID deviceid; + int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ + int detail; + /* + * NotifyAncestor, NotifyVirtual, NotifyInferior, + * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer, + * NotifyPointerRoot, NotifyDetailNone + */ + Time time; + } XDeviceFocusChangeEvent; + +typedef XDeviceFocusChangeEvent XDeviceFocusInEvent; +typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent; + +/******************************************************************* + * + * ProximityNotify events. These events are sent by those absolute + * positioning devices that are capable of generating proximity information. + * + */ + +typedef struct + { + int type; /* ProximityIn or ProximityOut */ + 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; + XID deviceid; + Window root; + Window subwindow; + Time time; + int x, y; + int x_root, y_root; + unsigned int state; + Bool same_screen; + unsigned int device_state; /* device key or button mask */ + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; + } XProximityNotifyEvent; +typedef XProximityNotifyEvent XProximityInEvent; +typedef XProximityNotifyEvent XProximityOutEvent; + +/******************************************************************* + * + * DeviceStateNotify events are generated on EnterWindow and FocusIn + * for those clients who have selected DeviceState. + * + */ + +typedef struct + { + unsigned char class; + unsigned char length; + } XInputClass; + +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; + XID deviceid; + Time time; + int num_classes; + char data[64]; +} XDeviceStateNotifyEvent; + +typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int valuators[6]; +} XValuatorStatus; + +typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; +} XKeyStatus; + +typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonStatus; + +/******************************************************************* + * + * DeviceMappingNotify event. This event is sent when the key mapping, + * modifier mapping, or button mapping of an extension device is 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 */ + XID deviceid; + Time time; + int request; /* one of MappingModifier, MappingKeyboard, + MappingPointer */ + int first_keycode;/* first keycode */ + int count; /* defines range of change w. first_keycode*/ +} XDeviceMappingEvent; + +/******************************************************************* + * + * ChangeDeviceNotify event. This event is sent when an + * XChangeKeyboard or XChangePointer request is made. + * + */ + +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 */ + XID deviceid; + Time time; + int request; /* NewPointer or NewKeyboard */ +} XChangeDeviceNotifyEvent; + +/******************************************************************* + * + * Control structures for input devices that support input class + * Feedback. These are used by the XGetFeedbackControl and + * XChangeFeedbackControl functions. + * + */ + +typedef struct { + XID class; + int length; + XID id; +} XFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int global_auto_repeat; + char auto_repeats[32]; +} XKbdFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int resolution; + int minVal; + int maxVal; +} XIntegerFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int max_symbols; + int num_syms_supported; + KeySym *syms_supported; +} XStringFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackState; + +typedef struct { + XID class; + int length; + XID id; + int led_values; + int led_mask; +} XLedFeedbackState; + +typedef struct { + XID class; + int length; + XID id; +} XFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int accelNum; + int accelDenom; + int threshold; +} XPtrFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int click; + int percent; + int pitch; + int duration; + int led_mask; + int led_value; + int key; + int auto_repeat_mode; +} XKbdFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int num_keysyms; + KeySym *syms_to_display; +} XStringFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int int_to_display; +} XIntegerFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int percent; + int pitch; + int duration; +} XBellFeedbackControl; + +typedef struct { + XID class; + int length; + XID id; + int led_mask; + int led_values; +} XLedFeedbackControl; + +/******************************************************************* + * + * Device control structures. + * + */ + +typedef struct { + XID control; + int length; +} XDeviceControl; + +typedef struct { + XID control; + int length; + int first_valuator; + int num_valuators; + int *resolutions; +} XDeviceResolutionControl; + +typedef struct { + XID control; + int length; + int num_valuators; + int *resolutions; + int *min_resolutions; + int *max_resolutions; +} XDeviceResolutionState; + +/******************************************************************* + * + * An array of XDeviceList structures is returned by the + * XListInputDevices function. Each entry contains information + * about one input device. Among that information is an array of + * pointers to structures that describe the characteristics of + * the input device. + * + */ + +typedef struct _XAnyClassinfo *XAnyClassPtr; + +typedef struct _XAnyClassinfo { + XID class; + int length; + } XAnyClassInfo; + +typedef struct _XDeviceInfo *XDeviceInfoPtr; + +typedef struct _XDeviceInfo + { + XID id; + Atom type; + char *name; + int num_classes; + int use; + XAnyClassPtr inputclassinfo; + } XDeviceInfo; + +typedef struct _XKeyInfo *XKeyInfoPtr; + +typedef struct _XKeyInfo + { + XID class; + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; + } XKeyInfo; + +typedef struct _XButtonInfo *XButtonInfoPtr; + +typedef struct _XButtonInfo { + XID class; + int length; + short num_buttons; + } XButtonInfo; + +typedef struct _XAxisInfo *XAxisInfoPtr; + +typedef struct _XAxisInfo { + int resolution; + int min_value; + int max_value; + } XAxisInfo; + +typedef struct _XValuatorInfo *XValuatorInfoPtr; + +typedef struct _XValuatorInfo + { + XID class; + int length; + unsigned char num_axes; + unsigned char mode; + unsigned long motion_buffer; + XAxisInfoPtr axes; + } XValuatorInfo; + + +/******************************************************************* + * + * An XDevice structure is returned by the XOpenDevice function. + * It contains an array of pointers to XInputClassInfo structures. + * Each contains information about a class of input supported by the + * device, including a pointer to an array of data for each type of event + * the device reports. + * + */ + + +typedef struct { + unsigned char input_class; + unsigned char event_type_base; +} XInputClassInfo; + +typedef struct { + XID device_id; + int num_classes; + XInputClassInfo *classes; +} XDevice; + + +/******************************************************************* + * + * The following structure is used to return information for the + * XGetSelectedExtensionEvents function. + * + */ + +typedef struct { + XEventClass event_type; + XID device; +} XEventList; + +/******************************************************************* + * + * The following structure is used to return motion history data from + * an input device that supports the input class Valuators. + * This information is returned by the XGetDeviceMotionEvents function. + * + */ + +typedef struct { + Time time; + int *data; +} XDeviceTimeCoord; + + +/******************************************************************* + * + * Device state structure. + * This is returned by the XQueryDeviceState request. + * + */ + +typedef struct { + XID device_id; + int num_classes; + XInputClass *data; +} XDeviceState; + +/******************************************************************* + * + * Note that the mode field is a bitfield that reports the Proximity + * status of the device as well as the mode. The mode field should + * be OR'd with the mask DeviceMode and compared with the values + * Absolute and Relative to determine the mode, and should be OR'd + * with the mask ProximityState and compared with the values InProximity + * and OutOfProximity to determine the proximity state. + * + */ + +typedef struct { + unsigned char class; + unsigned char length; + unsigned char num_valuators; + unsigned char mode; + int *valuators; +} XValuatorState; + +typedef struct { + unsigned char class; + unsigned char length; + short num_keys; + char keys[32]; +} XKeyState; + +typedef struct { + unsigned char class; + unsigned char length; + short num_buttons; + char buttons[32]; +} XButtonState; + +/******************************************************************* + * + * Function definitions. + * + */ + +_XFUNCPROTOBEGIN + +extern int XChangeKeyboardDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */ +#endif +); + +extern int XChangePointerDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* xaxis */, + int /* yaxis */ +#endif +); + +extern int XGrabDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Window /* grab_window */, + Bool /* ownerEvents */, + int /* event count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */, + Time /* time */ +#endif +); + +extern int XUngrabDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Time /* time */ +#endif +); + +extern int XGrabDeviceKey( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned int /* key */, + unsigned int /* modifiers */, + XDevice* /* modifier_device */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */ +#endif +); + +extern int XUngrabDeviceKey( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned int /* key */, + unsigned int /* modifiers */, + XDevice* /* modifier_dev */, + Window /* grab_window */ +#endif +); + +extern int XGrabDeviceButton( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned int /* button */, + unsigned int /* modifiers */, + XDevice* /* modifier_device */, + Window /* grab_window */, + Bool /* owner_events */, + unsigned int /* event_count */, + XEventClass* /* event_list */, + int /* this_device_mode */, + int /* other_devices_mode */ +#endif +); + +extern int XUngrabDeviceButton( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned int /* button */, + unsigned int /* modifiers */, + XDevice* /* modifier_dev */, + Window /* grab_window */ +#endif +); + +extern int XAllowDeviceEvents( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* event_mode */, + Time /* time */ +#endif +); + +extern int XGetDeviceFocus( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Window* /* focus */, + int* /* revert_to */, + Time* /* time */ +#endif +); + +extern int XSetDeviceFocus( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Window /* focus */, + int /* revert_to */, + Time /* time */ +#endif +); + +extern XFeedbackState *XGetFeedbackControl( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int* /* num_feedbacks */ +#endif +); + +extern int XFreeFeedbackList( +#if NeedFunctionPrototypes + XFeedbackState* /* list */ +#endif +); + +extern int XChangeFeedbackControl( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned long /* mask */, + XFeedbackControl* /* f */ +#endif +); + +extern int XDeviceBell( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + XID /* feedbackclass */, + XID /* feedbackid */, + int /* percent */ +#endif +); + +extern KeySym *XGetDeviceKeyMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, +#if NeedWidePrototypes + unsigned int /* first */, +#else + KeyCode /* first */, +#endif + int /* keycount */, + int* /* syms_per_code */ +#endif +); + +extern int XChangeDeviceKeyMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* first */, + int /* syms_per_code */, + KeySym* /* keysyms */, + int /* count */ +#endif +); + +extern XModifierKeymap *XGetDeviceModifierMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */ +#endif +); + +extern int XSetDeviceModifierMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + XModifierKeymap* /* modmap */ +#endif +); + +extern int XSetDeviceButtonMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned char* /* map[] */, + int /* nmap */ +#endif +); + +extern int XGetDeviceButtonMapping( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + unsigned char* /* map[] */, + unsigned int /* nmap */ +#endif +); + +extern XDeviceState *XQueryDeviceState( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */ +#endif +); + +extern int XFreeDeviceState( +#if NeedFunctionPrototypes + XDeviceState* /* list */ +#endif +); + +extern XExtensionVersion *XGetExtensionVersion( +#if NeedFunctionPrototypes + Display* /* display */, + _Xconst char* /* name */ +#endif +); + +extern XDeviceInfo *XListInputDevices( +#if NeedFunctionPrototypes + Display* /* display */, + int* /* ndevices */ +#endif +); + +extern int XFreeDeviceList( +#if NeedFunctionPrototypes + XDeviceInfo* /* list */ +#endif +); + +extern XDevice *XOpenDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XID /* id */ +#endif +); + +extern int XCloseDevice( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */ +#endif +); + +extern int XSetDeviceMode( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* mode */ +#endif +); + +extern int XSetDeviceValuators( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int* /* valuators */, + int /* first_valuator */, + int /* num_valuators */ +#endif +); + +extern XDeviceControl *XGetDeviceControl( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* control */ +#endif +); + +extern int XChangeDeviceControl( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + int /* control */, + XDeviceControl* /* d */ +#endif +); + +extern int XSelectExtensionEvent( +#if NeedFunctionPrototypes + Display* /* display */, + Window /* w */, + XEventClass* /* event_list */, + int /* count */ +#endif +); + +extern int XGetSelectedExtensionEvents( +#if NeedFunctionPrototypes + Display* /* display */, + Window /* w */, + int* /* this_client_count */, + XEventClass** /* this_client_list */, + int* /* all_clients_count */, + XEventClass** /* all_clients_list */ +#endif +); + +extern int XChangeDeviceDontPropagateList( +#if NeedFunctionPrototypes + Display* /* display */, + Window /* window */, + int /* count */, + XEventClass* /* events */, + int /* mode */ +#endif +); + +extern XEventClass *XGetDeviceDontPropagateList( +#if NeedFunctionPrototypes + Display* /* display */, + Window /* window */, + int* /* count */ +#endif +); + +extern Status XSendExtensionEvent( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Window /* dest */, + Bool /* prop */, + int /* count */, + XEventClass* /* list */, + XEvent* /* event */ +#endif +); + +extern XDeviceTimeCoord *XGetDeviceMotionEvents( +#if NeedFunctionPrototypes + Display* /* display */, + XDevice* /* device */, + Time /* start */, + Time /* stop */, + int* /* nEvents */, + int* /* mode */, + int* /* axis_count */ +#endif +); + +extern int XFreeDeviceMotionEvents( +#if NeedFunctionPrototypes + XDeviceTimeCoord* /* events */ +#endif +); + +extern int XFreeDeviceControl( +#if NeedFunctionPrototypes + XDeviceControl* /* control */ +#endif +); + +_XFUNCPROTOEND + +#endif /* _XINPUT_H_ */ + +/* Definitions used by the server, library and client */ + +#ifndef _XI_H_ + +#define _XI_H_ + +#define sz_xGetExtensionVersionReq 8 +#define sz_xGetExtensionVersionReply 32 +#define sz_xListInputDevicesReq 4 +#define sz_xListInputDevicesReply 32 +#define sz_xOpenDeviceReq 8 +#define sz_xOpenDeviceReply 32 +#define sz_xCloseDeviceReq 8 +#define sz_xSetDeviceModeReq 8 +#define sz_xSetDeviceModeReply 32 +#define sz_xSelectExtensionEventReq 12 +#define sz_xGetSelectedExtensionEventsReq 8 +#define sz_xGetSelectedExtensionEventsReply 32 +#define sz_xChangeDeviceDontPropagateListReq 12 +#define sz_xGetDeviceDontPropagateListReq 8 +#define sz_xGetDeviceDontPropagateListReply 32 +#define sz_xGetDeviceMotionEventsReq 16 +#define sz_xGetDeviceMotionEventsReply 32 +#define sz_xChangeKeyboardDeviceReq 8 +#define sz_xChangeKeyboardDeviceReply 32 +#define sz_xChangePointerDeviceReq 8 +#define sz_xChangePointerDeviceReply 32 +#define sz_xGrabDeviceReq 20 +#define sz_xGrabDeviceReply 32 +#define sz_xUngrabDeviceReq 12 +#define sz_xGrabDeviceKeyReq 20 +#define sz_xGrabDeviceKeyReply 32 +#define sz_xUngrabDeviceKeyReq 16 +#define sz_xGrabDeviceButtonReq 20 +#define sz_xGrabDeviceButtonReply 32 +#define sz_xUngrabDeviceButtonReq 16 +#define sz_xAllowDeviceEventsReq 12 +#define sz_xGetDeviceFocusReq 8 +#define sz_xGetDeviceFocusReply 32 +#define sz_xSetDeviceFocusReq 16 +#define sz_xGetFeedbackControlReq 8 +#define sz_xGetFeedbackControlReply 32 +#define sz_xChangeFeedbackControlReq 12 +#define sz_xGetDeviceKeyMappingReq 8 +#define sz_xGetDeviceKeyMappingReply 32 +#define sz_xChangeDeviceKeyMappingReq 8 +#define sz_xGetDeviceModifierMappingReq 8 +#define sz_xSetDeviceModifierMappingReq 8 +#define sz_xSetDeviceModifierMappingReply 32 +#define sz_xGetDeviceButtonMappingReq 8 +#define sz_xGetDeviceButtonMappingReply 32 +#define sz_xSetDeviceButtonMappingReq 8 +#define sz_xSetDeviceButtonMappingReply 32 +#define sz_xQueryDeviceStateReq 8 +#define sz_xQueryDeviceStateReply 32 +#define sz_xSendExtensionEventReq 16 +#define sz_xDeviceBellReq 8 +#define sz_xSetDeviceValuatorsReq 8 +#define sz_xSetDeviceValuatorsReply 32 +#define sz_xGetDeviceControlReq 8 +#define sz_xGetDeviceControlReply 32 +#define sz_xChangeDeviceControlReq 8 +#define sz_xChangeDeviceControlReply 32 + +#define INAME "XInputExtension" + +#define XI_KEYBOARD "KEYBOARD" +#define XI_MOUSE "MOUSE" +#define XI_TABLET "TABLET" +#define XI_TOUCHSCREEN "TOUCHSCREEN" +#define XI_TOUCHPAD "TOUCHPAD" +#define XI_BARCODE "BARCODE" +#define XI_BUTTONBOX "BUTTONBOX" +#define XI_KNOB_BOX "KNOB_BOX" +#define XI_ONE_KNOB "ONE_KNOB" +#define XI_NINE_KNOB "NINE_KNOB" +#define XI_TRACKBALL "TRACKBALL" +#define XI_QUADRATURE "QUADRATURE" +#define XI_ID_MODULE "ID_MODULE" +#define XI_SPACEBALL "SPACEBALL" +#define XI_DATAGLOVE "DATAGLOVE" +#define XI_EYETRACKER "EYETRACKER" +#define XI_CURSORKEYS "CURSORKEYS" +#define XI_FOOTMOUSE "FOOTMOUSE" + +#define Dont_Check 0 +#define XInput_Initial_Release 1 +#define XInput_Add_XDeviceBell 2 +#define XInput_Add_XSetDeviceValuators 3 +#define XInput_Add_XChangeDeviceControl 4 + +#define XI_Absent 0 +#define XI_Present 1 + +#define XI_Initial_Release_Major 1 +#define XI_Initial_Release_Minor 0 + +#define XI_Add_XDeviceBell_Major 1 +#define XI_Add_XDeviceBell_Minor 1 + +#define XI_Add_XSetDeviceValuators_Major 1 +#define XI_Add_XSetDeviceValuators_Minor 2 + +#define XI_Add_XChangeDeviceControl_Major 1 +#define XI_Add_XChangeDeviceControl_Minor 3 + +#define DEVICE_RESOLUTION 1 + +#define NoSuchExtension 1 + +#define COUNT 0 +#define CREATE 1 + +#define NewPointer 0 +#define NewKeyboard 1 + +#define XPOINTER 0 +#define XKEYBOARD 1 + +#define UseXKeyboard 0xFF + +#define IsXPointer 0 +#define IsXKeyboard 1 +#define IsXExtensionDevice 2 + +#define AsyncThisDevice 0 +#define SyncThisDevice 1 +#define ReplayThisDevice 2 +#define AsyncOtherDevices 3 +#define AsyncAll 4 +#define SyncAll 5 + +#define FollowKeyboard 3 +#define RevertToFollowKeyboard 3 + +#define DvAccelNum (1L << 0) +#define DvAccelDenom (1L << 1) +#define DvThreshold (1L << 2) + +#define DvKeyClickPercent (1L<<0) +#define DvPercent (1L<<1) +#define DvPitch (1L<<2) +#define DvDuration (1L<<3) +#define DvLed (1L<<4) +#define DvLedMode (1L<<5) +#define DvKey (1L<<6) +#define DvAutoRepeatMode (1L<<7) + +#define DvString (1L << 0) + +#define DvInteger (1L << 0) + +#define DeviceMode (1L << 0) +#define Relative 0 +#define Absolute 1 + +#define ProximityState (1L << 1) +#define InProximity (0L << 1) +#define OutOfProximity (1L << 1) + +#define AddToList 0 +#define DeleteFromList 1 + +#define KeyClass 0 +#define ButtonClass 1 +#define ValuatorClass 2 +#define FeedbackClass 3 +#define ProximityClass 4 +#define FocusClass 5 +#define OtherClass 6 + +#define KbdFeedbackClass 0 +#define PtrFeedbackClass 1 +#define StringFeedbackClass 2 +#define IntegerFeedbackClass 3 +#define LedFeedbackClass 4 +#define BellFeedbackClass 5 + +#define _devicePointerMotionHint 0 +#define _deviceButton1Motion 1 +#define _deviceButton2Motion 2 +#define _deviceButton3Motion 3 +#define _deviceButton4Motion 4 +#define _deviceButton5Motion 5 +#define _deviceButtonMotion 6 +#define _deviceButtonGrab 7 +#define _deviceOwnerGrabButton 8 +#define _noExtensionEvent 9 + +#define XI_BadDevice 0 +#define XI_BadEvent 1 +#define XI_BadMode 2 +#define XI_DeviceBusy 3 +#define XI_BadClass 4 + +typedef unsigned long XEventClass; + +/******************************************************************* + * + * Extension version structure. + * + */ + +typedef struct { + int present; + short major_version; + short minor_version; +} XExtensionVersion; + +#endif /* _XI_H_ */ + + + + + + + + + + + + + + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..806265c --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,82 @@ +lib_LTLIBRARIES = libXi.la + +XI2_sources = XIAllowEvents.c \ + XIGrabDevice.c \ + XIQueryVersion.c \ + XIQueryDevice.c \ + XISetDevFocus.c \ + XIGetDevFocus.c \ + XIPassiveGrab.c \ + XIProperties.c \ + XISelEv.c \ + XISetCPtr.c \ + XIWarpPointer.c \ + XIHierarchy.c \ + XIDefineCursor.c \ + XIQueryPointer.c + +libXi_la_SOURCES = \ + XAllowDv.c \ + XChDProp.c \ + XChgDCtl.c \ + XChgFCtl.c \ + XChgKbd.c \ + XChgKMap.c \ + XChgPnt.c \ + XChgProp.c \ + XCloseDev.c \ + XDelDProp.c \ + XDevBell.c \ + XExtToWire.c \ + XGetBMap.c \ + XGetCPtr.c \ + XGetDCtl.c \ + XGetDProp.c \ + XGetFCtl.c \ + XGetKMap.c \ + XGetMMap.c \ + XGetProp.c \ + XGetVers.c \ + XGMotion.c \ + XGrabDev.c \ + XGrDvBut.c \ + XGrDvKey.c \ + XGtFocus.c \ + XGtSelect.c \ + XListDev.c \ + XListDProp.c \ + XOpenDev.c \ + XQueryDv.c \ + XSelect.c \ + XSetBMap.c \ + XSetDVal.c \ + XSetMMap.c \ + XSetMode.c \ + XSndExEv.c \ + XStFocus.c \ + XUngrDev.c \ + XUngrDvB.c \ + XUngrDvK.c \ + XExtInt.c \ + XIint.h \ + $(XI2_sources) + + +libXi_la_LIBADD = $(XI_LIBS) + +AM_CPPFLAGS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/include/X11 \ + -I$(top_srcdir)/include/X11/extensions + +AM_CFLAGS = $(XI_CFLAGS) \ + $(MALLOC_ZERO_CFLAGS) \ + $(CWARNFLAGS) + + +libXi_la_LDFLAGS = -version-number 6:1:0 -no-undefined + +libXiincludedir = $(includedir)/X11/extensions +libXiinclude_HEADERS = $(top_srcdir)/include/X11/extensions/XInput.h \ + $(top_srcdir)/include/X11/extensions/XInput2.h + +EXTRA_DIST = XFreeLst.c diff --git a/src/XAllowDv.c b/src/XAllowDv.c new file mode 100644 index 0000000..ccecead --- /dev/null +++ b/src/XAllowDv.c @@ -0,0 +1,87 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XAllowDeviceEvents - Thaw a frozen extension device. + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XAllowDeviceEvents( + register Display *dpy, + XDevice *dev, + int event_mode, + Time time) +{ + xAllowDeviceEventsReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(AllowDeviceEvents, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_AllowDeviceEvents; + req->deviceid = dev->device_id; + req->mode = event_mode; + req->time = time; + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XChDProp.c b/src/XChDProp.c new file mode 100644 index 0000000..c863cdb --- /dev/null +++ b/src/XChDProp.c @@ -0,0 +1,106 @@ +/************************************************************ + +Copyright 2008 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +*/ + +/*********************************************************************** + * XChangeDeviceProperties - change an input device's properties. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +void +XChangeDeviceProperty(Display* dpy, XDevice* dev, + Atom property, Atom type, + int format, int mode, + _Xconst unsigned char *data, int nelements) +{ + xChangeDevicePropertyReq *req; + int len; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return; + + GetReq(ChangeDeviceProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeDeviceProperty; + req->deviceid = dev->device_id; + req->property = property; + req->type = type; + req->mode = mode; + if (nelements < 0) { + req->nUnits = 0; + req->format = 0; /* ask for garbage, get garbage */ + } else { + req->nUnits = nelements; + req->format = format; + } + + switch (req->format) { + case 8: + len = ((long)nelements + 3) >> 2; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + Data (dpy, (char *)data, nelements); + } /* else force BadLength */ + break; + + case 16: + len = ((long)nelements + 1) >> 1; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + len = (long)nelements << 1; + Data16 (dpy, (short *) data, len); + } /* else force BadLength */ + break; + + case 32: + len = nelements; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + len = (long)nelements << 2; + Data32 (dpy, (long *) data, len); + } /* else force BadLength */ + break; + + default: + /* BadValue will be generated */ ; + } + + UnlockDisplay(dpy); + SyncHandle(); +} + diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c new file mode 100644 index 0000000..41354ce --- /dev/null +++ b/src/XChgDCtl.c @@ -0,0 +1,234 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangeDeviceControl - Change the control attributes of an extension + * input device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangeDeviceControl( + register Display *dpy, + XDevice *dev, + int control, + XDeviceControl *d) +{ + int length; + xChangeDeviceControlReq *req; + xChangeDeviceControlReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeDeviceControl, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeDeviceControl; + req->deviceid = dev->device_id; + req->control = control; + + switch (control) { + case DEVICE_RESOLUTION: + { + XDeviceResolutionControl *R; + xDeviceResolutionCtl r; + + R = (XDeviceResolutionControl *) d; + r.control = DEVICE_RESOLUTION; + r.length = sizeof(xDeviceResolutionCtl) + + R->num_valuators * sizeof(int); + r.first_valuator = R->first_valuator; + r.num_valuators = R->num_valuators; + req->length += ((unsigned)(r.length + 3) >> 2); + length = sizeof(xDeviceResolutionCtl); + Data(dpy, (char *)&r, length); + length = r.num_valuators * sizeof(int); + Data(dpy, (char *)R->resolutions, length); + if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return (NoSuchExtension); + } else { + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); + } + } + case DEVICE_ABS_CALIB: + { + XDeviceAbsCalibControl *C = (XDeviceAbsCalibControl *) d; + xDeviceAbsCalibCtl c; + + c.control = DEVICE_ABS_CALIB; + c.length = sizeof(c); + c.min_x = C->min_x; + c.max_x = C->max_x; + c.min_y = C->min_y; + c.max_y = C->max_y; + c.flip_x = C->flip_x; + c.flip_y = C->flip_y; + c.rotation = C->rotation; + c.button_threshold = C->button_threshold; + + req->length += (sizeof(c) + 3) >> 2; + Data(dpy, (char *) &c, sizeof(c)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + UnlockDisplay(dpy); + SyncHandle(); + return rep.status; + } + } + case DEVICE_ABS_AREA: + { + XDeviceAbsAreaControl *A = (XDeviceAbsAreaControl *) d; + xDeviceAbsAreaCtl a; + + a.control = DEVICE_ABS_AREA; + a.length = sizeof(a); + a.offset_x = A->offset_x; + a.offset_y = A->offset_y; + a.width = A->width; + a.height = A->height; + a.screen = A->screen; + a.following = A->following; + + req->length += (sizeof(a) + 3) >> 2; + Data(dpy, (char *) &a, sizeof(a)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + UnlockDisplay(dpy); + SyncHandle(); + return rep.status; + } + } + case DEVICE_CORE: + { + XDeviceCoreControl *C = (XDeviceCoreControl *) d; + xDeviceCoreCtl c; + + c.control = DEVICE_CORE; + c.length = sizeof(c); + c.status = C->status; + + req->length += (sizeof(c) + 3) >> 2; + Data (dpy, (char *) &c, sizeof(c)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + UnlockDisplay(dpy); + SyncHandle(); + return rep.status; + } + } + case DEVICE_ENABLE: + { + XDeviceEnableControl *E = (XDeviceEnableControl *) d; + xDeviceEnableCtl e; + + e.control = DEVICE_ENABLE; + e.length = sizeof(e); + e.enable = E->enable; + + req->length += (sizeof(e) + 3) >> 2; + Data (dpy, (char *) &e, sizeof(e)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + UnlockDisplay(dpy); + SyncHandle(); + return rep.status; + } + } + default: + { + xDeviceCtl u; + + u.control = d->control; + u.length = d->length - sizeof(int); + length = ((unsigned)(u.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&u, length); + } + } + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XChgFCtl.c b/src/XChgFCtl.c new file mode 100644 index 0000000..d5ec8dc --- /dev/null +++ b/src/XChgFCtl.c @@ -0,0 +1,194 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangeFeedbackControl - Change the control attributes of feedbacks on + * an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangeFeedbackControl( + register Display *dpy, + XDevice *dev, + unsigned long mask, + XFeedbackControl *f) +{ + int length; + xChangeFeedbackControlReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeFeedbackControl, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeFeedbackControl; + req->deviceid = dev->device_id; + req->mask = mask; + req->feedbackid = f->class; + + if (f->class == KbdFeedbackClass) { + XKbdFeedbackControl *K; + xKbdFeedbackCtl k; + + K = (XKbdFeedbackControl *) f; + k.class = KbdFeedbackClass; + k.length = sizeof(xKbdFeedbackCtl); + k.id = K->id; + k.click = K->click; + k.percent = K->percent; + k.pitch = K->pitch; + k.duration = K->duration; + k.led_mask = K->led_mask; + k.led_values = K->led_value; + k.key = K->key; + k.auto_repeat_mode = K->auto_repeat_mode; + length = ((unsigned)(k.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&k, length); + } else if (f->class == PtrFeedbackClass) { + XPtrFeedbackControl *P; + xPtrFeedbackCtl p; + + P = (XPtrFeedbackControl *) f; + p.class = PtrFeedbackClass; + p.length = sizeof(xPtrFeedbackCtl); + p.id = P->id; + p.num = P->accelNum; + p.denom = P->accelDenom; + p.thresh = P->threshold; + length = ((unsigned)(p.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&p, length); + } else if (f->class == IntegerFeedbackClass) { + XIntegerFeedbackControl *I; + xIntegerFeedbackCtl i; + + I = (XIntegerFeedbackControl *) f; + i.class = IntegerFeedbackClass; + i.length = sizeof(xIntegerFeedbackCtl); + i.id = I->id; + i.int_to_display = I->int_to_display; + length = ((unsigned)(i.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&i, length); + } else if (f->class == StringFeedbackClass) { + XStringFeedbackControl *S; + xStringFeedbackCtl s; + + S = (XStringFeedbackControl *) f; + s.class = StringFeedbackClass; + s.length = sizeof(xStringFeedbackCtl) + + (S->num_keysyms * sizeof(KeySym)); + s.id = S->id; + s.num_keysyms = S->num_keysyms; + req->length += ((unsigned)(s.length + 3) >> 2); + length = sizeof(xStringFeedbackCtl); + Data(dpy, (char *)&s, length); + length = (s.num_keysyms * sizeof(KeySym)); + Data(dpy, (char *)S->syms_to_display, length); + } else if (f->class == BellFeedbackClass) { + XBellFeedbackControl *B; + xBellFeedbackCtl b; + + B = (XBellFeedbackControl *) f; + b.class = BellFeedbackClass; + b.length = sizeof(xBellFeedbackCtl); + b.id = B->id; + b.percent = B->percent; + b.pitch = B->pitch; + b.duration = B->duration; + length = ((unsigned)(b.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&b, length); + } else if (f->class == LedFeedbackClass) { + XLedFeedbackControl *L; + xLedFeedbackCtl l; + + L = (XLedFeedbackControl *) f; + l.class = LedFeedbackClass; + l.length = sizeof(xLedFeedbackCtl); + l.id = L->id; + l.led_mask = L->led_mask; + l.led_values = L->led_values; + length = ((unsigned)(l.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&l, length); + } else { + xFeedbackCtl u; + + u.class = f->class; + u.length = f->length - sizeof(int); + u.id = f->id; + length = ((unsigned)(u.length + 3) >> 2); + req->length += length; + length <<= 2; + Data(dpy, (char *)&u, length); + } + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XChgKMap.c b/src/XChgKMap.c new file mode 100644 index 0000000..df301cb --- /dev/null +++ b/src/XChgKMap.c @@ -0,0 +1,95 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangeDeviceKeyMapping - change the keymap of an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangeDeviceKeyMapping( + register Display *dpy, + XDevice *dev, + int first, + int syms_per_code, + KeySym *keysyms, + int count) +{ + register long nbytes; + xChangeDeviceKeyMappingReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeDeviceKeyMapping, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeDeviceKeyMapping; + req->deviceid = dev->device_id; + req->firstKeyCode = first; + req->keyCodes = count; + req->keySymsPerKeyCode = syms_per_code; + req->length += count * syms_per_code; + nbytes = syms_per_code * count * sizeof(CARD32); + Data(dpy, (char *)keysyms, nbytes); + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XChgKbd.c b/src/XChgKbd.c new file mode 100644 index 0000000..3eb46bf --- /dev/null +++ b/src/XChgKbd.c @@ -0,0 +1,88 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangeKeyboardDevice - Change the device used as the X keyboard. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangeKeyboardDevice( + register Display *dpy, + XDevice *dev) +{ + xChangeKeyboardDeviceReq *req; + xChangeKeyboardDeviceReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeKeyboardDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeKeyboardDevice; + req->deviceid = dev->device_id; + rep.status = Success; + + (void)_XReply(dpy, (xReply *) & rep, 0, xTrue); + + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); +} diff --git a/src/XChgPnt.c b/src/XChgPnt.c new file mode 100644 index 0000000..4cb9ee1 --- /dev/null +++ b/src/XChgPnt.c @@ -0,0 +1,92 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangePointerDevice - Change the device used as the X Pointer. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangePointerDevice( + register Display *dpy, + XDevice *dev, + int xaxis, + int yaxis) +{ + xChangePointerDeviceReq *req; + xChangePointerDeviceReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangePointerDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangePointerDevice; + req->deviceid = dev->device_id; + req->xaxis = xaxis; + req->yaxis = yaxis; + rep.status = Success; + + (void)_XReply(dpy, (xReply *) & rep, 0, xTrue); + + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); +} diff --git a/src/XChgProp.c b/src/XChgProp.c new file mode 100644 index 0000000..dfb5186 --- /dev/null +++ b/src/XChgProp.c @@ -0,0 +1,98 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XChangeDeviceDontPropagateList - Get the dont_propagate_list for a + * window. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XChangeDeviceDontPropagateList( + register Display *dpy, + Window window, + int count, + XEventClass *events, + int mode) +{ + xChangeDeviceDontPropagateListReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(ChangeDeviceDontPropagateList, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ChangeDeviceDontPropagateList; + req->window = window; + req->count = count; + req->mode = mode; + req->length += count; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + count <<= 2; + Data32(dpy, (long *)events, count); + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XCloseDev.c b/src/XCloseDev.c new file mode 100644 index 0000000..dbf7e50 --- /dev/null +++ b/src/XCloseDev.c @@ -0,0 +1,85 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XCloseDevice - Request the server to close an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XCloseDevice( + register Display *dpy, + register XDevice *dev) +{ + xCloseDeviceReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(CloseDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_CloseDevice; + req->deviceid = dev->device_id; + + XFree((char *)dev); + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XDelDProp.c b/src/XDelDProp.c new file mode 100644 index 0000000..d6594c4 --- /dev/null +++ b/src/XDelDProp.c @@ -0,0 +1,64 @@ +/************************************************************ + +Copyright 2008 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +*/ + +/*********************************************************************** + * XDeleteDeviceProperties - delete an input device's properties. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +void +XDeleteDeviceProperty(Display* dpy, XDevice* dev, Atom property) +{ + xDeleteDevicePropertyReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return; + + GetReq(DeleteDeviceProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_DeleteDeviceProperty; + req->deviceid = dev->device_id; + req->property = property; + + UnlockDisplay(dpy); + SyncHandle(); + return; +} + diff --git a/src/XDevBell.c b/src/XDevBell.c new file mode 100644 index 0000000..1fe8297 --- /dev/null +++ b/src/XDevBell.c @@ -0,0 +1,90 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XDeviceBell - Ring a bell on an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XDeviceBell( + register Display *dpy, + XDevice *dev, + XID feedbackclass, + XID feedbackid, + int percent) +{ + xDeviceBellReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Add_XDeviceBell, info) == -1) + return (NoSuchExtension); + + GetReq(DeviceBell, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_DeviceBell; + req->deviceid = dev->device_id; + req->feedbackclass = feedbackclass; + req->feedbackid = feedbackid; + req->percent = percent; + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XExtInt.c b/src/XExtInt.c new file mode 100644 index 0000000..27638bd --- /dev/null +++ b/src/XExtInt.c @@ -0,0 +1,1987 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * Input Extension library internal functions. + * + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +#define ENQUEUE_EVENT True +#define DONT_ENQUEUE False +#define FP1616toDBL(x) ((x) * 1.0 / (1 << 16)) + +extern void _xibaddevice( + Display * /* dpy */, + int * /* error */ +); + +extern void _xibadclass( + Display * /* dpy */, + int * /* error */ +); + +extern void _xibadevent( + Display * /* dpy */, + int * /* error */ +); + +extern void _xibadmode( + Display * /* dpy */, + int * /* error */ +); + +extern void _xidevicebusy( + Display * /* dpy */, + int * /* error */ +); + +extern int _XiGetDevicePresenceNotifyEvent( + Display * /* dpy */ +); + +int copy_classes(XIDeviceInfo *to, xXIAnyInfo* from, int *nclasses); +int size_classes(xXIAnyInfo* from, int nclasses); + +static XExtensionInfo *xinput_info; +static /* const */ char *xinput_extension_name = INAME; + +static int XInputClose( + Display * /* dpy */, + XExtCodes * /* codes */ +); + +static char *XInputError( + Display * /* dpy */, + int /* code */, + XExtCodes * /* codes */, + char * /* buf */, + int /* n */ +); + +static Bool XInputWireToEvent( + Display * /* dpy */, + XEvent * /* re */, + xEvent * /* event */ +); +static Bool XInputWireToCookie( + Display* /* display */, + XGenericEventCookie* /* re */, + xEvent* /* event */ +); + +static Bool XInputCopyCookie( + Display* /* display */, + XGenericEventCookie* /* in */, + XGenericEventCookie* /* out */ +); + +static int +wireToDeviceEvent(xXIDeviceEvent *in, XGenericEventCookie* out); +static int +wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie); +static int +wireToHierarchyChangedEvent(xXIHierarchyEvent *in, XGenericEventCookie *cookie); +static int +wireToRawEvent(XExtDisplayInfo *info, xXIRawEvent *in, XGenericEventCookie *cookie); +static int +wireToEnterLeave(xXIEnterEvent *in, XGenericEventCookie *cookie); +static int +wireToPropertyEvent(xXIPropertyEvent *in, XGenericEventCookie *cookie); +static int +wireToTouchOwnershipEvent(xXITouchOwnershipEvent *in, + XGenericEventCookie *cookie); + +static /* const */ XEvent emptyevent; + +typedef Status (*core_event_to_wire)(Display*, XEvent*, xEvent*); + +static /* const */ XExtensionHooks xinput_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + XInputClose, /* close_display */ + XInputWireToEvent, /* wire_to_event */ + (core_event_to_wire)_XiEventToWire, /* event_to_wire */ + NULL, /* error */ + XInputError, /* error_string */ +}; + +static char *XInputErrorList[] = { + "BadDevice, invalid or uninitialized input device", /* BadDevice */ + "BadEvent, invalid event type", /* BadEvent */ + "BadMode, invalid mode parameter", /* BadMode */ + "DeviceBusy, device is busy", /* DeviceBusy */ + "BadClass, invalid event class", /* BadClass */ +}; + +/* Get the version supported by the server to know which number of +* events are support. Otherwise, a wrong number of events may smash +* the Xlib-internal event processing vector. +* +* Since the extension hasn't been initialized yet, we need to +* manually get the opcode, then the version. +*/ +static int +_XiFindEventsSupported(Display *dpy) +{ + XExtCodes codes; + XExtensionVersion *extversion = NULL; + int nevents = 0; + + if (!XQueryExtension(dpy, INAME, &codes.major_opcode, + &codes.first_event, &codes.first_error)) + goto out; + + LockDisplay(dpy); + extversion = _XiGetExtensionVersionRequest(dpy, INAME, codes.major_opcode); + UnlockDisplay(dpy); + SyncHandle(); + + if (!extversion || !extversion->present) + goto out; + + if (extversion->major_version >= 2) + nevents = IEVENTS; /* number is fixed, XI2 adds GenericEvents only */ + else if (extversion->major_version <= 0) + { + printf("XInput_find_display: invalid extension version %d.%d\n", + extversion->major_version, extversion->minor_version); + goto out; + } + else + { + switch(extversion->minor_version) + { + case XI_Add_DeviceProperties_Minor: + nevents = XI_DevicePropertyNotify + 1; + break; + case XI_Add_DevicePresenceNotify_Minor: + nevents = XI_DevicePresenceNotify + 1; + break; + default: + nevents = XI_DeviceButtonstateNotify + 1; + break; + } + } + +out: + if (extversion) + XFree(extversion); + return nevents; +} + + +_X_HIDDEN +XExtDisplayInfo *XInput_find_display (Display *dpy) +{ + XExtDisplayInfo *dpyinfo; + if (!xinput_info) { if (!(xinput_info = XextCreateExtension())) return NULL; } + if (!(dpyinfo = XextFindDisplay (xinput_info, dpy))) + { + int nevents = _XiFindEventsSupported(dpy); + + dpyinfo = XextAddDisplay (xinput_info, dpy, + xinput_extension_name, + &xinput_extension_hooks, + nevents, NULL); + if (dpyinfo->codes) /* NULL if XI doesn't exist on the server */ + { + XESetWireToEventCookie(dpy, dpyinfo->codes->major_opcode, XInputWireToCookie); + XESetCopyEventCookie(dpy, dpyinfo->codes->major_opcode, XInputCopyCookie); + } + } + return dpyinfo; +} + +static XEXT_GENERATE_ERROR_STRING(XInputError, xinput_extension_name, + IERRORS, XInputErrorList) +/******************************************************************* +* +* Input extension versions. +* +*/ +static XExtensionVersion versions[] = { {XI_Absent, 0, 0}, +{XI_Present, XI_Initial_Release_Major, XI_Initial_Release_Minor}, +{XI_Present, XI_Add_XDeviceBell_Major, XI_Add_XDeviceBell_Minor}, +{XI_Present, XI_Add_XSetDeviceValuators_Major, + XI_Add_XSetDeviceValuators_Minor}, +{XI_Present, XI_Add_XChangeDeviceControl_Major, + XI_Add_XChangeDeviceControl_Minor}, +{XI_Present, XI_Add_DevicePresenceNotify_Major, + XI_Add_DevicePresenceNotify_Minor}, +{XI_Present, XI_Add_DeviceProperties_Major, + XI_Add_DeviceProperties_Minor}, +{XI_Present, 2, 0}, +{XI_Present, 2, 1}, +{XI_Present, 2, 2} +}; + +/*********************************************************************** + * + * Return errors reported by this extension. + * + */ + +void +_xibaddevice( + Display *dpy, + int *error) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + *error = info->codes->first_error + XI_BadDevice; +} + +void +_xibadclass( + Display *dpy, + int *error) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + *error = info->codes->first_error + XI_BadClass; +} + +void +_xibadevent( + Display *dpy, + int *error) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + *error = info->codes->first_error + XI_BadEvent; +} + +void +_xibadmode( + Display *dpy, + int *error) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + *error = info->codes->first_error + XI_BadMode; +} + +void +_xidevicebusy( + Display *dpy, + int *error) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + *error = info->codes->first_error + XI_DeviceBusy; +} + +static int XInputCheckExtension(Display *dpy, XExtDisplayInfo *info) +{ + XextCheckExtension (dpy, info, xinput_extension_name, 0); + return 1; +} + +/***************************************************************** + * Compare version numbers between info and the built-in version table. + * Returns + * -1 if info's version is less than version_index's version, + * 0 if equal (or DontCheck), + * 1 if info's version is greater than version_index's version. + * Returns -2 on initialization errors which shouldn't happen if you call it + * correctly. + */ +_X_HIDDEN int +_XiCheckVersion(XExtDisplayInfo *info, + int version_index) +{ + XExtensionVersion *ext; + + if (versions[version_index].major_version == Dont_Check) + return 0; + + if (!info->data) + return -2; + + ext = ((XInputData *) info->data)->vers; + if (!ext) + return -2; + + if (ext->major_version == versions[version_index].major_version && + ext->minor_version == versions[version_index].minor_version) + return 0; + + if (ext->major_version < versions[version_index].major_version || + (ext->major_version == versions[version_index].major_version && + ext->minor_version < versions[version_index].minor_version)) + return -1; + else + return 1; +} + +/*********************************************************************** + * + * Check to see if the input extension is installed in the server. + * Also check to see if the version is >= the requested version. + * + */ + +_X_HIDDEN int +_XiCheckExtInit( + register Display *dpy, + register int version_index, + XExtDisplayInfo *info) +{ + if (!XInputCheckExtension(dpy, info)) { + UnlockDisplay(dpy); + return (-1); + } + + if (info->data == NULL) { + info->data = (XPointer) Xmalloc(sizeof(XInputData)); + if (!info->data) { + UnlockDisplay(dpy); + return (-1); + } + ((XInputData *) info->data)->vers = + _XiGetExtensionVersion(dpy, "XInputExtension", info); + } + + if (_XiCheckVersion(info, version_index) < 0) { + UnlockDisplay(dpy); + return -1; + } + + return (0); +} + +/*********************************************************************** + * + * Close display routine. + * + */ + +static int +XInputClose( + Display *dpy, + XExtCodes *codes) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + if (info->data != NULL) { + XFree((char *)((XInputData *) info->data)->vers); + XFree((char *)info->data); + } + + if (!XextRemoveDisplay(xinput_info, dpy)) + return 0; + + if (xinput_info->ndisplays == 0) { + XextDestroyExtension(xinput_info); + xinput_info = NULL; + } + + return 1; +} + +static int +Ones(Mask mask) +{ + register Mask y; + + y = (mask >> 1) & 033333333333; + y = mask - y - ((y >> 1) & 033333333333); + return (((y + (y >> 3)) & 030707070707) % 077); +} + +static int count_bits(unsigned char* ptr, int len) +{ + int bits = 0; + unsigned int i; + unsigned char x; + + for (i = 0; i < len; i++) + { + x = ptr[i]; + while(x > 0) + { + bits += (x & 0x1); + x >>= 1; + } + } + return bits; +} + +int +_XiGetDevicePresenceNotifyEvent(Display * dpy) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + + return info->codes->first_event + XI_DevicePresenceNotify; +} + +/*********************************************************************** + * + * Handle Input extension events. + * Reformat a wire event into an XEvent structure of the right type. + * + */ + +static Bool +XInputWireToEvent( + Display *dpy, + XEvent *re, + xEvent *event) +{ + unsigned int type, reltype; + unsigned int i, j; + XExtDisplayInfo *info = XInput_find_display(dpy); + XEvent *save = (XEvent *) info->data; + + type = event->u.u.type & 0x7f; + reltype = (type - info->codes->first_event); + + if (type == GenericEvent || + (reltype != XI_DeviceValuator && + reltype != XI_DeviceKeystateNotify && + reltype != XI_DeviceButtonstateNotify)) { + *save = emptyevent; + save->type = type; + ((XAnyEvent *) save)->serial = _XSetLastRequestRead(dpy, + (xGenericReply *) + event); + ((XAnyEvent *) save)->send_event = ((event->u.u.type & 0x80) != 0); + ((XAnyEvent *) save)->display = dpy; + } + + /* Process traditional events */ + if (type != GenericEvent) + { + switch (reltype) { + case XI_DeviceMotionNotify: + { + register XDeviceMotionEvent *ev = (XDeviceMotionEvent *) save; + deviceKeyButtonPointer *ev2 = (deviceKeyButtonPointer *) event; + + ev->root = ev2->root; + ev->window = ev2->event; + ev->subwindow = ev2->child; + ev->time = ev2->time; + ev->x_root = ev2->root_x; + ev->y_root = ev2->root_y; + ev->x = ev2->event_x; + ev->y = ev2->event_y; + ev->state = ev2->state; + ev->same_screen = ev2->same_screen; + ev->is_hint = ev2->detail; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + return (DONT_ENQUEUE); + } + break; + case XI_DeviceKeyPress: + case XI_DeviceKeyRelease: + { + register XDeviceKeyEvent *ev = (XDeviceKeyEvent *) save; + deviceKeyButtonPointer *ev2 = (deviceKeyButtonPointer *) event; + + ev->root = ev2->root; + ev->window = ev2->event; + ev->subwindow = ev2->child; + ev->time = ev2->time; + ev->x_root = ev2->root_x; + ev->y_root = ev2->root_y; + ev->x = ev2->event_x; + ev->y = ev2->event_y; + ev->state = ev2->state; + ev->same_screen = ev2->same_screen; + ev->keycode = ev2->detail; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + if (ev2->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_DeviceButtonPress: + case XI_DeviceButtonRelease: + { + register XDeviceButtonEvent *ev = (XDeviceButtonEvent *) save; + deviceKeyButtonPointer *ev2 = (deviceKeyButtonPointer *) event; + + ev->root = ev2->root; + ev->window = ev2->event; + ev->subwindow = ev2->child; + ev->time = ev2->time; + ev->x_root = ev2->root_x; + ev->y_root = ev2->root_y; + ev->x = ev2->event_x; + ev->y = ev2->event_y; + ev->state = ev2->state; + ev->same_screen = ev2->same_screen; + ev->button = ev2->detail; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + if (ev2->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_ProximityIn: + case XI_ProximityOut: + { + register XProximityNotifyEvent *ev = (XProximityNotifyEvent *) save; + deviceKeyButtonPointer *ev2 = (deviceKeyButtonPointer *) event; + + ev->root = ev2->root; + ev->window = ev2->event; + ev->subwindow = ev2->child; + ev->time = ev2->time; + ev->x_root = ev2->root_x; + ev->y_root = ev2->root_y; + ev->x = ev2->event_x; + ev->y = ev2->event_y; + ev->state = ev2->state; + ev->same_screen = ev2->same_screen; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + if (ev2->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_DeviceValuator: + { + deviceValuator *xev = (deviceValuator *) event; + int save_type = save->type - info->codes->first_event; + + if (save_type == XI_DeviceKeyPress || save_type == XI_DeviceKeyRelease) { + XDeviceKeyEvent *kev = (XDeviceKeyEvent *) save; + + kev->device_state = xev->device_state; + kev->axes_count = xev->num_valuators; + kev->first_axis = xev->first_valuator; + i = xev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + kev->axis_data[5] = xev->valuator5; + case 5: + kev->axis_data[4] = xev->valuator4; + case 4: + kev->axis_data[3] = xev->valuator3; + case 3: + kev->axis_data[2] = xev->valuator2; + case 2: + kev->axis_data[1] = xev->valuator1; + case 1: + kev->axis_data[0] = xev->valuator0; + } + } else if (save_type == XI_DeviceButtonPress || + save_type == XI_DeviceButtonRelease) { + XDeviceButtonEvent *bev = (XDeviceButtonEvent *) save; + + bev->device_state = xev->device_state; + bev->axes_count = xev->num_valuators; + bev->first_axis = xev->first_valuator; + i = xev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + bev->axis_data[5] = xev->valuator5; + case 5: + bev->axis_data[4] = xev->valuator4; + case 4: + bev->axis_data[3] = xev->valuator3; + case 3: + bev->axis_data[2] = xev->valuator2; + case 2: + bev->axis_data[1] = xev->valuator1; + case 1: + bev->axis_data[0] = xev->valuator0; + } + } else if (save_type == XI_DeviceMotionNotify) { + XDeviceMotionEvent *mev = (XDeviceMotionEvent *) save; + + mev->device_state = xev->device_state; + mev->axes_count = xev->num_valuators; + mev->first_axis = xev->first_valuator; + i = xev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + mev->axis_data[5] = xev->valuator5; + case 5: + mev->axis_data[4] = xev->valuator4; + case 4: + mev->axis_data[3] = xev->valuator3; + case 3: + mev->axis_data[2] = xev->valuator2; + case 2: + mev->axis_data[1] = xev->valuator1; + case 1: + mev->axis_data[0] = xev->valuator0; + } + } else if (save_type == XI_ProximityIn || save_type == XI_ProximityOut) { + XProximityNotifyEvent *pev = (XProximityNotifyEvent *) save; + + pev->device_state = xev->device_state; + pev->axes_count = xev->num_valuators; + pev->first_axis = xev->first_valuator; + i = xev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + pev->axis_data[5] = xev->valuator5; + case 5: + pev->axis_data[4] = xev->valuator4; + case 4: + pev->axis_data[3] = xev->valuator3; + case 3: + pev->axis_data[2] = xev->valuator2; + case 2: + pev->axis_data[1] = xev->valuator1; + case 1: + pev->axis_data[0] = xev->valuator0; + } + } else if (save_type == XI_DeviceStateNotify) { + XDeviceStateNotifyEvent *sev = (XDeviceStateNotifyEvent *) save; + XInputClass *any = (XInputClass *) & sev->data[0]; + XValuatorStatus *v; + + for (i = 0; i < sev->num_classes; i++) + if (any->class != ValuatorClass) + any = (XInputClass *) ((char *)any + any->length); + v = (XValuatorStatus *) any; + i = v->num_valuators; + j = xev->num_valuators; + if (j > 3) + j = 3; + switch (j) { + case 3: + v->valuators[i + 2] = xev->valuator2; + case 2: + v->valuators[i + 1] = xev->valuator1; + case 1: + v->valuators[i + 0] = xev->valuator0; + } + v->num_valuators += j; + + } + *re = *save; + return (ENQUEUE_EVENT); + } + break; + case XI_DeviceFocusIn: + case XI_DeviceFocusOut: + { + register XDeviceFocusChangeEvent *ev = (XDeviceFocusChangeEvent *) re; + deviceFocus *fev = (deviceFocus *) event; + + *ev = *((XDeviceFocusChangeEvent *) save); + ev->window = fev->window; + ev->time = fev->time; + ev->mode = fev->mode; + ev->detail = fev->detail; + ev->deviceid = fev->deviceid & DEVICE_BITS; + return (ENQUEUE_EVENT); + } + break; + case XI_DeviceStateNotify: + { + XDeviceStateNotifyEvent *stev = (XDeviceStateNotifyEvent *) save; + deviceStateNotify *sev = (deviceStateNotify *) event; + char *data; + + stev->window = None; + stev->deviceid = sev->deviceid & DEVICE_BITS; + stev->time = sev->time; + stev->num_classes = Ones((Mask) sev->classes_reported & InputClassBits); + data = (char *)&stev->data[0]; + if (sev->classes_reported & (1 << KeyClass)) { + register XKeyStatus *kstev = (XKeyStatus *) data; + + kstev->class = KeyClass; + kstev->length = sizeof(XKeyStatus); + kstev->num_keys = sev->num_keys; + memcpy((char *)&kstev->keys[0], (char *)&sev->keys[0], 4); + data += sizeof(XKeyStatus); + } + if (sev->classes_reported & (1 << ButtonClass)) { + register XButtonStatus *bev = (XButtonStatus *) data; + + bev->class = ButtonClass; + bev->length = sizeof(XButtonStatus); + bev->num_buttons = sev->num_buttons; + memcpy((char *)bev->buttons, (char *)sev->buttons, 4); + data += sizeof(XButtonStatus); + } + if (sev->classes_reported & (1 << ValuatorClass)) { + register XValuatorStatus *vev = (XValuatorStatus *) data; + + vev->class = ValuatorClass; + vev->length = sizeof(XValuatorStatus); + vev->num_valuators = sev->num_valuators; + vev->mode = sev->classes_reported >> ModeBitsShift; + j = sev->num_valuators; + if (j > 3) + j = 3; + switch (j) { + case 3: + vev->valuators[2] = sev->valuator2; + case 2: + vev->valuators[1] = sev->valuator1; + case 1: + vev->valuators[0] = sev->valuator0; + } + data += sizeof(XValuatorStatus); + } + if (sev->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_DeviceKeystateNotify: + { + int i; + XInputClass *anyclass; + register XKeyStatus *kv; + deviceKeyStateNotify *ksev = (deviceKeyStateNotify *) event; + XDeviceStateNotifyEvent *kstev = (XDeviceStateNotifyEvent *) save; + + anyclass = (XInputClass *) & kstev->data[0]; + for (i = 0; i < kstev->num_classes; i++) + if (anyclass->class == KeyClass) + break; + else + anyclass = (XInputClass *) ((char *)anyclass + + anyclass->length); + + kv = (XKeyStatus *) anyclass; + kv->num_keys = 256; + memcpy((char *)&kv->keys[4], (char *)ksev->keys, 28); + if (ksev->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_DeviceButtonstateNotify: + { + int i; + XInputClass *anyclass; + register XButtonStatus *bv; + deviceButtonStateNotify *bsev = (deviceButtonStateNotify *) event; + XDeviceStateNotifyEvent *bstev = (XDeviceStateNotifyEvent *) save; + + anyclass = (XInputClass *) & bstev->data[0]; + for (i = 0; i < bstev->num_classes; i++) + if (anyclass->class == ButtonClass) + break; + else + anyclass = (XInputClass *) ((char *)anyclass + + anyclass->length); + + bv = (XButtonStatus *) anyclass; + bv->num_buttons = 256; + memcpy((char *)&bv->buttons[4], (char *)bsev->buttons, 28); + if (bsev->deviceid & MORE_EVENTS) + return (DONT_ENQUEUE); + else { + *re = *save; + return (ENQUEUE_EVENT); + } + } + break; + case XI_DeviceMappingNotify: + { + register XDeviceMappingEvent *ev = (XDeviceMappingEvent *) re; + deviceMappingNotify *ev2 = (deviceMappingNotify *) event; + + *ev = *((XDeviceMappingEvent *) save); + ev->window = 0; + ev->first_keycode = ev2->firstKeyCode; + ev->request = ev2->request; + ev->count = ev2->count; + ev->time = ev2->time; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + return (ENQUEUE_EVENT); + } + break; + case XI_ChangeDeviceNotify: + { + register XChangeDeviceNotifyEvent *ev = (XChangeDeviceNotifyEvent *) re; + changeDeviceNotify *ev2 = (changeDeviceNotify *) event; + + *ev = *((XChangeDeviceNotifyEvent *) save); + ev->window = 0; + ev->request = ev2->request; + ev->time = ev2->time; + ev->deviceid = ev2->deviceid & DEVICE_BITS; + return (ENQUEUE_EVENT); + } + break; + + case XI_DevicePresenceNotify: + { + XDevicePresenceNotifyEvent *ev = (XDevicePresenceNotifyEvent *) re; + devicePresenceNotify *ev2 = (devicePresenceNotify *) event; + + *ev = *(XDevicePresenceNotifyEvent *) save; + ev->window = 0; + ev->time = ev2->time; + ev->devchange = ev2->devchange; + ev->deviceid = ev2->deviceid; + ev->control = ev2->control; + return (ENQUEUE_EVENT); + } + break; + case XI_DevicePropertyNotify: + { + XDevicePropertyNotifyEvent* ev = (XDevicePropertyNotifyEvent*)re; + devicePropertyNotify *ev2 = (devicePropertyNotify*)event; + + *ev = *(XDevicePropertyNotifyEvent*)save; + ev->time = ev2->time; + ev->deviceid = ev2->deviceid; + ev->atom = ev2->atom; + ev->state = ev2->state; + return ENQUEUE_EVENT; + } + break; + default: + printf("XInputWireToEvent: UNKNOWN WIRE EVENT! type=%d\n", type); + break; + } + } + return (DONT_ENQUEUE); +} + +static void xge_copy_to_cookie(xGenericEvent* ev, + XGenericEventCookie *cookie) +{ + cookie->type = ev->type; + cookie->evtype = ev->evtype; + cookie->extension = ev->extension; +} + +static Bool +XInputWireToCookie( + Display *dpy, + XGenericEventCookie *cookie, + xEvent *event) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + XEvent *save = (XEvent *) info->data; + xGenericEvent* ge = (xGenericEvent*)event; + + if (ge->extension != info->codes->major_opcode) + { + printf("XInputWireToCookie: wrong extension opcode %d\n", + ge->extension); + return DONT_ENQUEUE; + } + + *save = emptyevent; + save->type = event->u.u.type; + ((XAnyEvent*)save)->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event); + ((XAnyEvent*)save)->send_event = ((event->u.u.type & 0x80) != 0); + ((XAnyEvent*)save)->display = dpy; + + xge_copy_to_cookie((xGenericEvent*)event, (XGenericEventCookie*)save); + switch(ge->evtype) + { + case XI_Motion: + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_KeyPress: + case XI_KeyRelease: + case XI_TouchBegin: + case XI_TouchUpdate: + case XI_TouchEnd: + *cookie = *(XGenericEventCookie*)save; + if (!wireToDeviceEvent((xXIDeviceEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + case XI_DeviceChanged: + *cookie = *(XGenericEventCookie*)save; + if (!wireToDeviceChangedEvent((xXIDeviceChangedEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + case XI_HierarchyChanged: + *cookie = *(XGenericEventCookie*)save; + if (!wireToHierarchyChangedEvent((xXIHierarchyEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + case XI_TouchOwnership: + *cookie = *(XGenericEventCookie*)save; + if (!wireToTouchOwnershipEvent((xXITouchOwnershipEvent*)event, + cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + + case XI_RawKeyPress: + case XI_RawKeyRelease: + case XI_RawButtonPress: + case XI_RawButtonRelease: + case XI_RawMotion: + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: + *cookie = *(XGenericEventCookie*)save; + if (!wireToRawEvent(info, (xXIRawEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + case XI_Enter: + case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: + *cookie = *(XGenericEventCookie*)save; + if (!wireToEnterLeave((xXIEnterEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + case XI_PropertyEvent: + *cookie = *(XGenericEventCookie*)save; + if (!wireToPropertyEvent((xXIPropertyEvent*)event, cookie)) + { + printf("XInputWireToCookie: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; + default: + printf("XInputWireToCookie: Unknown generic event. type %d\n", ge->evtype); + + } + return DONT_ENQUEUE; +} + +/** + * Calculate length in bytes needed for the device event with the given + * button mask length, valuator mask length + valuator mask. All parameters + * in bytes. + */ +static inline int +sizeDeviceEvent(int buttons_len, int valuators_len, + unsigned char *valuators_mask) +{ + int len; + + len = sizeof(XIDeviceEvent); + len += sizeof(XIButtonState) + buttons_len; + len += sizeof(XIValuatorState) + valuators_len; + len += count_bits(valuators_mask, valuators_len) * sizeof(double); + len += sizeof(XIModifierState) + sizeof(XIGroupState); + + return len; +} + +/* Return the size with added padding so next element would be + double-aligned unless the architecture is known to allow unaligned + data accesses. Not doing this can cause a bus error on + MIPS N32. */ +static int +pad_to_double(int size) +{ +#if !defined(__i386__) && !defined(__sh__) + if (size % sizeof(double) != 0) + size += sizeof(double) - size % sizeof(double); +#endif + return size; +} + +/** + * Set structure and atoms to size in bytes of XIButtonClassInfo, its + * button state mask and labels array. + */ +static void +sizeXIButtonClassType(int num_buttons, int* structure, int* state, int* atoms) +{ + int size; + int labels; + + *structure = pad_to_double(sizeof(XIButtonClassInfo)); + size = ((((num_buttons + 7)/8) + 3)/4); + + /* Force mask alignment with longs to avoid unaligned + * access when accessing the atoms. */ + *state = pad_to_double(size * 4); + labels = num_buttons * sizeof(Atom); + + /* Force mask alignment with longs to avoid + * unaligned access when accessing the atoms. */ + labels += ((((num_buttons + 7)/8) + 3)/4) * sizeof(Atom); + *atoms = pad_to_double(labels); +} + +/** + * Set structure and keycodes to size in bytes of XIKeyClassInfo and + * its keycodes array. + */ +static void +sizeXIKeyClassType(int num_keycodes, int* structure, int* keycodes) +{ + *structure = pad_to_double(sizeof(XIKeyClassInfo)); + *keycodes = pad_to_double(num_keycodes * sizeof(int)); +} + +/** + * Return the size in bytes required to store the matching class type + * num_elements is num_buttons for XIButtonClass or num_keycodes for + * XIKeyClass. + * + * Also used from copy_classes in XIQueryDevice.c + */ +static int +sizeDeviceClassType(int type, int num_elements) +{ + int l = 0; + int extra1 = 0; + int extra2 = 0; + switch(type) + { + case XIButtonClass: + sizeXIButtonClassType(num_elements, &l, &extra1, &extra2); + l += extra1 + extra2; + break; + case XIKeyClass: + sizeXIKeyClassType(num_elements, &l, &extra1); + l += extra1; + break; + case XIValuatorClass: + l = pad_to_double(sizeof(XIValuatorClassInfo)); + break; + case XIScrollClass: + l = pad_to_double(sizeof(XIScrollClassInfo)); + break; + case XITouchClass: + l = pad_to_double(sizeof(XITouchClassInfo)); + break; + default: + printf("sizeDeviceClassType: unknown type %d\n", type); + break; + } + return l; +} + +static Bool +copyHierarchyEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + XIHierarchyEvent *in, *out; + void *ptr; + + in = cookie_in->data; + + ptr = cookie_out->data = malloc(sizeof(XIHierarchyEvent) + + in->num_info * sizeof(XIHierarchyInfo)); + if (!ptr) + return False; + + out = next_block(&ptr, sizeof(XIHierarchyEvent)); + *out = *in; + out->info = next_block(&ptr, in->num_info * sizeof(XIHierarchyInfo)); + memcpy(out->info, in->info, in->num_info * sizeof(XIHierarchyInfo)); + + return True; +} + +static Bool +copyDeviceChangedEvent(XGenericEventCookie *in_cookie, + XGenericEventCookie *out_cookie) +{ + int len, i; + XIDeviceChangedEvent *in, *out; + XIAnyClassInfo *any; + void *ptr; + + in = in_cookie->data; + + len = sizeof(XIDeviceChangedEvent); + len += in->num_classes * sizeof(XIAnyClassInfo*); + + for (i = 0; i < in->num_classes; i++) + { + any = in->classes[i]; + switch(any->type) + { + case XIButtonClass: + len += sizeDeviceClassType(XIButtonClass, + ((XIButtonClassInfo*)any)->num_buttons); + break; + case XIKeyClass: + len += sizeDeviceClassType(XIKeyClass, + ((XIKeyClassInfo*)any)->num_keycodes); + break; + case XIValuatorClass: + len += sizeDeviceClassType(XIValuatorClass, 0); + break; + case XIScrollClass: + len += sizeDeviceClassType(XIScrollClass, 0); + break; + default: + printf("copyDeviceChangedEvent: unknown type %d\n", + any->type); + break; + } + + } + + ptr = out_cookie->data = malloc(len); + if (!ptr) + return False; + out = next_block(&ptr, sizeof(XIDeviceChangedEvent)); + *out = *in; + + out->classes = next_block(&ptr, + out->num_classes * sizeof(XIAnyClassInfo*)); + + for (i = 0; i < in->num_classes; i++) + { + any = in->classes[i]; + + switch(any->type) + { + case XIButtonClass: + { + int struct_size; + int state_size; + int labels_size; + XIButtonClassInfo *bin, *bout; + bin = (XIButtonClassInfo*)any; + sizeXIButtonClassType(bin->num_buttons, &struct_size, + &state_size, &labels_size); + bout = next_block(&ptr, struct_size); + + *bout = *bin; + bout->state.mask = next_block(&ptr, state_size); + memcpy(bout->state.mask, bin->state.mask, + bout->state.mask_len); + + bout->labels = next_block(&ptr, labels_size); + memcpy(bout->labels, bin->labels, bout->num_buttons * sizeof(Atom)); + out->classes[i] = (XIAnyClassInfo*)bout; + break; + } + case XIKeyClass: + { + XIKeyClassInfo *kin, *kout; + int struct_size; + int keycodes_size; + kin = (XIKeyClassInfo*)any; + sizeXIKeyClassType(kin->num_keycodes, &struct_size, + &keycodes_size); + + kout = next_block(&ptr, struct_size); + *kout = *kin; + kout->keycodes = next_block(&ptr, keycodes_size); + memcpy(kout->keycodes, kin->keycodes, kout->num_keycodes * sizeof(int)); + out->classes[i] = (XIAnyClassInfo*)kout; + break; + } + case XIValuatorClass: + { + XIValuatorClassInfo *vin, *vout; + vin = (XIValuatorClassInfo*)any; + vout = next_block(&ptr, + sizeDeviceClassType(XIValuatorClass, 0)); + *vout = *vin; + out->classes[i] = (XIAnyClassInfo*)vout; + break; + } + case XIScrollClass: + { + XIScrollClassInfo *sin, *sout; + sin = (XIScrollClassInfo*)any; + sout = next_block(&ptr, + sizeDeviceClassType(XIScrollClass, 0)); + *sout = *sin; + out->classes[i] = (XIAnyClassInfo*)sout; + break; + } + } + } + + return True; +} + +static Bool +copyDeviceEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + int len; + XIDeviceEvent *in, *out; + int bits; /* valuator bits */ + void *ptr; + + in = cookie_in->data; + bits = count_bits(in->valuators.mask, in->valuators.mask_len); + + len = sizeDeviceEvent(in->buttons.mask_len, in->valuators.mask_len, + in->valuators.mask); + + ptr = cookie_out->data = malloc(len); + if (!ptr) + return False; + + out = next_block(&ptr, sizeof(XIDeviceEvent)); + *out = *in; + + out->buttons.mask = next_block(&ptr, in->buttons.mask_len); + memcpy(out->buttons.mask, in->buttons.mask, + out->buttons.mask_len); + out->valuators.mask = next_block(&ptr, in->valuators.mask_len); + memcpy(out->valuators.mask, in->valuators.mask, + out->valuators.mask_len); + out->valuators.values = next_block(&ptr, bits * sizeof(double)); + memcpy(out->valuators.values, in->valuators.values, + bits * sizeof(double)); + + return True; +} + +static Bool +copyEnterEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + int len; + XIEnterEvent *in, *out; + void *ptr; + + in = cookie_in->data; + + len = sizeof(XIEnterEvent) + in->buttons.mask_len; + + ptr = cookie_out->data = malloc(len); + if (!ptr) + return False; + + out = next_block(&ptr, sizeof(XIEnterEvent)); + *out = *in; + + out->buttons.mask = next_block(&ptr, in->buttons.mask_len); + memcpy(out->buttons.mask, in->buttons.mask, out->buttons.mask_len); + + return True; +} + +static Bool +copyPropertyEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + XIPropertyEvent *in, *out; + + in = cookie_in->data; + + out = cookie_out->data = malloc(sizeof(XIPropertyEvent)); + if (!out) + return False; + + *out = *in; + return True; +} + +static Bool +copyTouchOwnershipEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + XITouchOwnershipEvent *in, *out; + + in = cookie_in->data; + + out = cookie_out->data = malloc(sizeof(XITouchOwnershipEvent)); + if (!out) + return False; + + *out = *in; + return True; +} + +static Bool +copyRawEvent(XGenericEventCookie *cookie_in, + XGenericEventCookie *cookie_out) +{ + XIRawEvent *in, *out; + void *ptr; + int len; + int bits; + + in = cookie_in->data; + + bits = count_bits(in->valuators.mask, in->valuators.mask_len); + len = sizeof(XIRawEvent) + in->valuators.mask_len; + len += bits * sizeof(double) * 2; + + ptr = cookie_out->data = malloc(len); + if (!ptr) + return False; + + out = next_block(&ptr, sizeof(XIRawEvent)); + *out = *in; + out->valuators.mask = next_block(&ptr, out->valuators.mask_len); + memcpy(out->valuators.mask, in->valuators.mask, out->valuators.mask_len); + + out->valuators.values = next_block(&ptr, bits * sizeof(double)); + memcpy(out->valuators.values, in->valuators.values, bits * sizeof(double)); + + out->raw_values = next_block(&ptr, bits * sizeof(double)); + memcpy(out->raw_values, in->raw_values, bits * sizeof(double)); + + return True; +} + + + +static Bool +XInputCopyCookie(Display *dpy, XGenericEventCookie *in, XGenericEventCookie *out) +{ + int ret = True; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + if (in->extension != info->codes->major_opcode) + { + printf("XInputCopyCookie: wrong extension opcode %d\n", + in->extension); + return False; + } + + *out = *in; + out->data = NULL; + out->cookie = 0; + + switch(in->evtype) { + case XI_Motion: + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_KeyPress: + case XI_KeyRelease: + case XI_TouchBegin: + case XI_TouchUpdate: + case XI_TouchEnd: + ret = copyDeviceEvent(in, out); + break; + case XI_DeviceChanged: + ret = copyDeviceChangedEvent(in, out); + break; + case XI_HierarchyChanged: + ret = copyHierarchyEvent(in, out); + break; + case XI_Enter: + case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: + ret = copyEnterEvent(in, out); + break; + case XI_PropertyEvent: + ret = copyPropertyEvent(in, out); + break; + case XI_TouchOwnership: + ret = copyTouchOwnershipEvent(in, out); + break; + case XI_RawKeyPress: + case XI_RawKeyRelease: + case XI_RawButtonPress: + case XI_RawButtonRelease: + case XI_RawMotion: + ret = copyRawEvent(in, out); + break; + default: + printf("XInputCopyCookie: unknown evtype %d\n", in->evtype); + ret = False; + } + + if (!ret) + printf("XInputCopyCookie: Failed to copy evtype %d", in->evtype); + return ret; +} + +static int +wireToDeviceEvent(xXIDeviceEvent *in, XGenericEventCookie* cookie) +{ + int len, i; + unsigned char *ptr; + void *ptr_lib; + FP3232 *values; + XIDeviceEvent *out; + + ptr = (unsigned char*)&in[1] + in->buttons_len * 4; + + len = sizeDeviceEvent(in->buttons_len * 4, in->valuators_len * 4, ptr); + + cookie->data = ptr_lib = malloc(len); + + out = next_block(&ptr_lib, sizeof(XIDeviceEvent)); + out->display = cookie->display; + out->type = in->type; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->deviceid = in->deviceid; + out->sourceid = in->sourceid; + out->detail = in->detail; + out->root = in->root; + out->event = in->event; + out->child = in->child; + out->root_x = FP1616toDBL(in->root_x); + out->root_y = FP1616toDBL(in->root_y); + out->event_x = FP1616toDBL(in->event_x); + out->event_y = FP1616toDBL(in->event_y); + out->flags = in->flags; + out->mods.base = in->mods.base_mods; + out->mods.locked = in->mods.locked_mods; + out->mods.latched = in->mods.latched_mods; + out->mods.effective = in->mods.effective_mods; + out->group.base = in->group.base_group; + out->group.locked = in->group.locked_group; + out->group.latched = in->group.latched_group; + out->group.effective = in->group.effective_group; + out->buttons.mask_len = in->buttons_len * 4; + out->valuators.mask_len = in->valuators_len * 4; + + out->buttons.mask = next_block(&ptr_lib, out->buttons.mask_len); + + /* buttons */ + ptr = (unsigned char*)&in[1]; + memcpy(out->buttons.mask, ptr, out->buttons.mask_len); + ptr += in->buttons_len * 4; + + /* valuators */ + out->valuators.mask = next_block(&ptr_lib, out->valuators.mask_len); + memcpy(out->valuators.mask, ptr, out->valuators.mask_len); + ptr += in->valuators_len * 4; + + len = count_bits(out->valuators.mask, out->valuators.mask_len); + out->valuators.values = next_block(&ptr_lib, len * sizeof(double)); + + values = (FP3232*)ptr; + for (i = 0; i < len; i++, values++) + { + out->valuators.values[i] = values->integral; + out->valuators.values[i] += ((double)values->frac / (1 << 16) / (1 << 16)); + } + + + return 1; +} + +_X_HIDDEN int +size_classes(xXIAnyInfo* from, int nclasses) +{ + int len, i; + xXIAnyInfo *any_wire; + char *ptr_wire; + + /* len for to->classes */ + len = pad_to_double(nclasses * sizeof(XIAnyClassInfo*)); + ptr_wire = (char*)from; + for (i = 0; i < nclasses; i++) + { + int l = 0; + any_wire = (xXIAnyInfo*)ptr_wire; + switch(any_wire->type) + { + case XIButtonClass: + l = sizeDeviceClassType(XIButtonClass, + ((xXIButtonInfo*)any_wire)->num_buttons); + break; + case XIKeyClass: + l = sizeDeviceClassType(XIKeyClass, + ((xXIKeyInfo*)any_wire)->num_keycodes); + break; + case XIValuatorClass: + l = sizeDeviceClassType(XIValuatorClass, 0); + break; + case XIScrollClass: + l = sizeDeviceClassType(XIScrollClass, 0); + break; + case XITouchClass: + l = sizeDeviceClassType(XITouchClass, 0); + break; + } + + len += l; + ptr_wire += any_wire->length * 4; + } + + return len; +} + +/* Copy classes from any into to->classes and return the number of bytes + * copied. Memory layout of to->classes is + * [clsptr][clsptr][clsptr][classinfo][classinfo]... + * |________|___________^ + * |______________________^ + */ +_X_HIDDEN int +copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses) +{ + XIAnyClassInfo *any_lib; + xXIAnyInfo *any_wire; + void *ptr_lib; + char *ptr_wire; + int i, len; + int cls_idx = 0; + + if (!to->classes) + return -1; + + ptr_wire = (char*)from; + ptr_lib = to->classes; + to->classes = next_block(&ptr_lib, + pad_to_double((*nclasses) * sizeof(XIAnyClassInfo*))); + memset(to->classes, 0, (*nclasses) * sizeof(XIAnyClassInfo*)); + len = 0; /* count wire length */ + + for (i = 0; i < *nclasses; i++) + { + any_lib = (XIAnyClassInfo*)ptr_lib; + any_wire = (xXIAnyInfo*)ptr_wire; + + switch(any_wire->type) + { + case XIButtonClass: + { + XIButtonClassInfo *cls_lib; + xXIButtonInfo *cls_wire; + uint32_t *atoms; + int j; + int struct_size; + int state_size; + int labels_size; + int wire_mask_size; + + cls_wire = (xXIButtonInfo*)any_wire; + sizeXIButtonClassType(cls_wire->num_buttons, + &struct_size, &state_size, + &labels_size); + cls_lib = next_block(&ptr_lib, struct_size); + wire_mask_size = ((cls_wire->num_buttons + 7)/8 + 3)/4 * 4; + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->num_buttons = cls_wire->num_buttons; + cls_lib->state.mask_len = state_size; + cls_lib->state.mask = next_block(&ptr_lib, state_size); + memcpy(cls_lib->state.mask, &cls_wire[1], + wire_mask_size); + if (state_size != wire_mask_size) + memset(&cls_lib->state.mask[wire_mask_size], 0, + state_size - wire_mask_size); + + cls_lib->labels = next_block(&ptr_lib, labels_size); + + atoms =(uint32_t*)((char*)&cls_wire[1] + wire_mask_size); + for (j = 0; j < cls_lib->num_buttons; j++) + cls_lib->labels[j] = *atoms++; + + to->classes[cls_idx++] = any_lib; + break; + } + case XIKeyClass: + { + XIKeyClassInfo *cls_lib; + xXIKeyInfo *cls_wire; + int struct_size; + int keycodes_size; + + cls_wire = (xXIKeyInfo*)any_wire; + sizeXIKeyClassType(cls_wire->num_keycodes, + &struct_size, &keycodes_size); + cls_lib = next_block(&ptr_lib, struct_size); + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->num_keycodes = cls_wire->num_keycodes; + cls_lib->keycodes = next_block(&ptr_lib, keycodes_size); + memcpy(cls_lib->keycodes, &cls_wire[1], + cls_lib->num_keycodes); + + to->classes[cls_idx++] = any_lib; + break; + } + case XIValuatorClass: + { + XIValuatorClassInfo *cls_lib; + xXIValuatorInfo *cls_wire; + + cls_lib = + next_block(&ptr_lib, + sizeDeviceClassType(XIValuatorClass, 0)); + cls_wire = (xXIValuatorInfo*)any_wire; + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->number = cls_wire->number; + cls_lib->label = cls_wire->label; + cls_lib->resolution = cls_wire->resolution; + cls_lib->min = cls_wire->min.integral; + cls_lib->max = cls_wire->max.integral; + cls_lib->value = cls_wire->value.integral; + /* FIXME: fractional parts */ + cls_lib->mode = cls_wire->mode; + + to->classes[cls_idx++] = any_lib; + } + break; + case XIScrollClass: + { + XIScrollClassInfo *cls_lib; + xXIScrollInfo *cls_wire; + + cls_lib = + next_block(&ptr_lib, + sizeDeviceClassType(XIScrollClass, 0)); + cls_wire = (xXIScrollInfo*)any_wire; + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->number = cls_wire->number; + cls_lib->scroll_type= cls_wire->scroll_type; + cls_lib->flags = cls_wire->flags; + cls_lib->increment = cls_wire->increment.integral; + cls_lib->increment += (unsigned int)cls_wire->increment.frac/(double)(1ULL << 32); + + to->classes[cls_idx++] = any_lib; + } + break; + case XITouchClass: + { + XITouchClassInfo *cls_lib; + xXITouchInfo *cls_wire; + + cls_wire = (xXITouchInfo*)any_wire; + cls_lib = next_block(&ptr_lib, sizeof(XITouchClassInfo)); + + cls_lib->type = cls_wire->type; + cls_lib->sourceid = cls_wire->sourceid; + cls_lib->mode = cls_wire->mode; + cls_lib->num_touches = cls_wire->num_touches; + + to->classes[cls_idx++] = any_lib; + } + break; + } + len += any_wire->length * 4; + ptr_wire += any_wire->length * 4; + } + + /* we may have skipped unknown classes, reset nclasses */ + *nclasses = cls_idx; + return len; +} + + +static int +wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie) +{ + XIDeviceChangedEvent *out; + XIDeviceInfo info; + int len; + int nclasses = in->num_classes; + + len = size_classes((xXIAnyInfo*)&in[1], in->num_classes); + + cookie->data = out = malloc(sizeof(XIDeviceChangedEvent) + len); + + out->type = in->type; + out->display = cookie->display; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->deviceid = in->deviceid; + out->sourceid = in->sourceid; + out->reason = in->reason; + + out->classes = (XIAnyClassInfo**)&out[1]; + + info.classes = out->classes; + + copy_classes(&info, (xXIAnyInfo*)&in[1], &nclasses); + out->num_classes = nclasses; + + return 1; +} + +static int +wireToHierarchyChangedEvent(xXIHierarchyEvent *in, XGenericEventCookie *cookie) +{ + int i; + XIHierarchyInfo *info_out; + xXIHierarchyInfo *info_in; + XIHierarchyEvent *out; + + cookie->data = out = malloc(sizeof(XIHierarchyEvent) + in->num_info * sizeof(XIHierarchyInfo));; + + out->info = (XIHierarchyInfo*)&out[1]; + out->display = cookie->display; + out->type = in->type; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->flags = in->flags; + out->num_info = in->num_info; + + info_out = out->info; + info_in = (xXIHierarchyInfo*)&in[1]; + + for (i = 0; i < out->num_info; i++, info_out++, info_in++) + { + info_out->deviceid = info_in->deviceid; + info_out->attachment = info_in->attachment; + info_out->use = info_in->use; + info_out->enabled = info_in->enabled; + info_out->flags = info_in->flags; + } + + return 1; +} + +static int +wireToRawEvent(XExtDisplayInfo *info, xXIRawEvent *in, XGenericEventCookie *cookie) +{ + int len, i, bits; + FP3232 *values; + XIRawEvent *out; + void *ptr; + + len = sizeof(XIRawEvent) + in->valuators_len * 4; + bits = count_bits((unsigned char*)&in[1], in->valuators_len * 4); + len += bits * sizeof(double) * 2; /* raw + normal */ + + cookie->data = ptr = calloc(1, len); + if (!ptr) + return 0; + + out = next_block(&ptr, sizeof(XIRawEvent)); + out->type = in->type; + out->display = cookie->display; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->detail = in->detail; + out->deviceid = in->deviceid; + out->flags = in->flags; + + /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */ + if (_XiCheckVersion(info, XInput_2_2) >= 0) + out->sourceid = in->sourceid; + else + out->sourceid = 0; + + out->valuators.mask_len = in->valuators_len * 4; + out->valuators.mask = next_block(&ptr, out->valuators.mask_len); + memcpy(out->valuators.mask, &in[1], out->valuators.mask_len); + + out->valuators.values = next_block(&ptr, bits * sizeof(double)); + out->raw_values = next_block(&ptr, bits * sizeof(double)); + + values = (FP3232*)(((char*)&in[1]) + in->valuators_len * 4); + for (i = 0; i < bits; i++) + { + out->valuators.values[i] = values->integral; + out->valuators.values[i] += ((double)values->frac / (1 << 16) / (1 << 16)); + out->raw_values[i] = (values + bits)->integral; + out->raw_values[i] += ((double)(values + bits)->frac / (1 << 16) / (1 << 16)); + values++; + } + + return 1; +} + +/* Memory layout of XIEnterEvents: + [event][modifiers][group][button] + */ +static int +wireToEnterLeave(xXIEnterEvent *in, XGenericEventCookie *cookie) +{ + int len; + XIEnterEvent *out; + + len = sizeof(XIEnterEvent) + in->buttons_len * 4; + + cookie->data = out = malloc(len); + out->buttons.mask = (unsigned char*)&out[1]; + + out->type = in->type; + out->display = cookie->display; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->detail = in->detail; + out->deviceid = in->deviceid; + out->root = in->root; + out->event = in->event; + out->child = in->child; + out->sourceid = in->sourceid; + out->root_x = FP1616toDBL(in->root_x); + out->root_y = FP1616toDBL(in->root_y); + out->event_x = FP1616toDBL(in->event_x); + out->event_y = FP1616toDBL(in->event_y); + out->mode = in->mode; + out->focus = in->focus; + out->same_screen = in->same_screen; + + out->mods.base = in->mods.base_mods; + out->mods.locked = in->mods.locked_mods; + out->mods.latched = in->mods.latched_mods; + out->mods.effective = in->mods.effective_mods; + out->group.base = in->group.base_group; + out->group.locked = in->group.locked_group; + out->group.latched = in->group.latched_group; + out->group.effective = in->group.effective_group; + + out->buttons.mask_len = in->buttons_len * 4; + memcpy(out->buttons.mask, &in[1], out->buttons.mask_len); + + return 1; +} + +static int +wireToPropertyEvent(xXIPropertyEvent *in, XGenericEventCookie *cookie) +{ + XIPropertyEvent *out = malloc(sizeof(XIPropertyEvent)); + + cookie->data = out; + + out->type = in->type; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->property = in->property; + out->what = in->what; + out->deviceid = in->deviceid; + + return 1; +} + +static int +wireToTouchOwnershipEvent(xXITouchOwnershipEvent *in, + XGenericEventCookie *cookie) +{ + XITouchOwnershipEvent *out = malloc(sizeof(XITouchOwnershipEvent)); + + cookie->data = out; + + out->type = in->type; + out->display = cookie->display; + out->extension = in->extension; + out->evtype = in->evtype; + out->send_event = ((in->type & 0x80) != 0); + out->time = in->time; + out->deviceid = in->deviceid; + out->sourceid = in->sourceid; + out->touchid = in->touchid; + out->root = in->root; + out->event = in->event; + out->child = in->child; + out->flags = in->flags; + + return 1; +} diff --git a/src/XExtToWire.c b/src/XExtToWire.c new file mode 100644 index 0000000..5f84574 --- /dev/null +++ b/src/XExtToWire.c @@ -0,0 +1,487 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/**************************************************************** + * + * XExtToWire.c - reformat an XEvent into a wire event. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +_X_HIDDEN Status +_XiEventToWire( + register Display *dpy, /* pointer to display structure */ + register XEvent *re, /* pointer to client event */ + register xEvent **event, /* wire protocol event */ + register int *count) +{ + XExtDisplayInfo *info = XInput_find_display(dpy); + int i; + + if ((re->type & 0x7f) != GenericEvent) { + switch ((re->type & 0x7f) - info->codes->first_event) { + case XI_DeviceKeyPress: + case XI_DeviceKeyRelease: + { + register XDeviceKeyEvent *ev = (XDeviceKeyEvent *) re; + register deviceKeyButtonPointer *kev; + register deviceValuator *vev; + + *count = 2; + kev = (deviceKeyButtonPointer *) Xmalloc(*count * sizeof(xEvent)); + if (!kev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) kev; + + kev->type = ev->type; + kev->root = ev->root; + kev->event = ev->window; + kev->child = ev->subwindow; + kev->time = ev->time; + kev->event_x = ev->x; + kev->event_y = ev->y; + kev->root_x = ev->x_root; + kev->root_y = ev->y_root; + kev->state = ev->state; + kev->same_screen = ev->same_screen; + kev->detail = ev->keycode; + kev->deviceid = ev->deviceid | MORE_EVENTS; + + vev = (deviceValuator *)++ kev; + vev->type = info->codes->first_event + XI_DeviceValuator; + vev->deviceid = ev->deviceid; + vev->device_state = ev->device_state; + vev->first_valuator = ev->first_axis; + vev->num_valuators = ev->axes_count; + i = vev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + vev->valuator5 = ev->axis_data[5]; + case 5: + vev->valuator4 = ev->axis_data[4]; + case 4: + vev->valuator3 = ev->axis_data[3]; + case 3: + vev->valuator2 = ev->axis_data[2]; + case 2: + vev->valuator1 = ev->axis_data[1]; + case 1: + vev->valuator0 = ev->axis_data[0]; + } + break; + } + case XI_ProximityIn: + case XI_ProximityOut: + { + register XProximityNotifyEvent *ev = (XProximityNotifyEvent *) re; + register deviceKeyButtonPointer *pev; + register deviceValuator *vev; + + *count = 2; + pev = (deviceKeyButtonPointer *) Xmalloc(*count * sizeof(xEvent)); + if (!pev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) pev; + + pev->type = ev->type; + pev->root = ev->root; + pev->event = ev->window; + pev->child = ev->subwindow; + pev->time = ev->time; + pev->event_x = ev->x; + pev->event_y = ev->y; + pev->root_x = ev->x_root; + pev->root_y = ev->y_root; + pev->state = ev->state; + pev->same_screen = ev->same_screen; + pev->deviceid = ev->deviceid | MORE_EVENTS; + + vev = (deviceValuator *)++ pev; + vev->type = info->codes->first_event + XI_DeviceValuator; + vev->deviceid = ev->deviceid; + vev->device_state = ev->device_state; + vev->first_valuator = ev->first_axis; + vev->num_valuators = ev->axes_count; + + i = vev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + vev->valuator5 = ev->axis_data[5]; + case 5: + vev->valuator4 = ev->axis_data[4]; + case 4: + vev->valuator3 = ev->axis_data[3]; + case 3: + vev->valuator2 = ev->axis_data[2]; + case 2: + vev->valuator1 = ev->axis_data[1]; + case 1: + vev->valuator0 = ev->axis_data[0]; + } + break; + } + case XI_DeviceButtonPress: + case XI_DeviceButtonRelease: + { + register XDeviceButtonEvent *ev = (XDeviceButtonEvent *) re; + register deviceKeyButtonPointer *bev; + register deviceValuator *vev; + + *count = 2; + bev = (deviceKeyButtonPointer *) Xmalloc(*count * sizeof(xEvent)); + if (!bev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) bev; + + bev->type = ev->type; + bev->root = ev->root; + bev->event = ev->window; + bev->child = ev->subwindow; + bev->time = ev->time; + bev->event_x = ev->x; + bev->event_y = ev->y; + bev->root_x = ev->x_root; + bev->root_y = ev->y_root; + bev->state = ev->state; + bev->same_screen = ev->same_screen; + bev->detail = ev->button; + bev->deviceid = ev->deviceid | MORE_EVENTS; + + vev = (deviceValuator *)++ bev; + vev->type = info->codes->first_event + XI_DeviceValuator; + vev->deviceid = ev->deviceid; + vev->device_state = ev->device_state; + vev->first_valuator = ev->first_axis; + vev->num_valuators = ev->axes_count; + + i = vev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + vev->valuator5 = ev->axis_data[5]; + case 5: + vev->valuator4 = ev->axis_data[4]; + case 4: + vev->valuator3 = ev->axis_data[3]; + case 3: + vev->valuator2 = ev->axis_data[2]; + case 2: + vev->valuator1 = ev->axis_data[1]; + case 1: + vev->valuator0 = ev->axis_data[0]; + } + break; + } + case XI_DeviceMotionNotify: + { + register XDeviceMotionEvent *ev = (XDeviceMotionEvent *) re; + register deviceKeyButtonPointer *mev; + register deviceValuator *vev; + + *count = 2; + mev = (deviceKeyButtonPointer *) Xmalloc(*count * sizeof(xEvent)); + if (!mev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) mev; + + mev->type = ev->type; + mev->root = ev->root; + mev->event = ev->window; + mev->child = ev->subwindow; + mev->time = ev->time; + mev->event_x = ev->x; + mev->event_y = ev->y; + mev->root_x = ev->x_root; + mev->root_y = ev->y_root; + mev->state = ev->state; + mev->same_screen = ev->same_screen; + mev->detail = ev->is_hint; + mev->deviceid = ev->deviceid | MORE_EVENTS; + + vev = (deviceValuator *)++ mev; + vev->type = info->codes->first_event + XI_DeviceValuator; + vev->deviceid = ev->deviceid; + vev->device_state = ev->device_state; + vev->first_valuator = ev->first_axis; + vev->num_valuators = ev->axes_count; + + i = vev->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + vev->valuator5 = ev->axis_data[5]; + case 5: + vev->valuator4 = ev->axis_data[4]; + case 4: + vev->valuator3 = ev->axis_data[3]; + case 3: + vev->valuator2 = ev->axis_data[2]; + case 2: + vev->valuator1 = ev->axis_data[1]; + case 1: + vev->valuator0 = ev->axis_data[0]; + } + break; + } + case XI_DeviceFocusIn: + case XI_DeviceFocusOut: + { + register XDeviceFocusChangeEvent *ev = (XDeviceFocusChangeEvent *) re; + register deviceFocus *fev; + + *count = 1; + fev = (deviceFocus *) Xmalloc(*count * sizeof(xEvent)); + if (!fev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) fev; + + fev->type = ev->type; + fev->window = ev->window; + fev->mode = ev->mode; + fev->detail = ev->detail; + fev->time = ev->time; + fev->deviceid = ev->deviceid; + break; + } + case XI_DeviceMappingNotify: + { + register XDeviceMappingEvent *ev = (XDeviceMappingEvent *) re; + register deviceMappingNotify *mev; + + *count = 1; + mev = (deviceMappingNotify *) Xmalloc(*count * sizeof(xEvent)); + if (!mev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) mev; + + mev->type = ev->type; + mev->firstKeyCode = ev->first_keycode; + mev->request = ev->request; + mev->count = ev->count; + mev->time = ev->time; + mev->deviceid = ev->deviceid; + break; + } + case XI_DeviceStateNotify: + { + register XDeviceStateNotifyEvent *ev = (XDeviceStateNotifyEvent *) re; + register deviceStateNotify *sev; + register xEvent *tev; + XInputClass *any = (XInputClass *) & ev->data[0]; + unsigned char *sav_id; + + *count = 1; + + for (i = 0; i < ev->num_classes; i++) { + if (any->class == KeyClass) { + XKeyStatus *k = (XKeyStatus *) any; + + if (k->num_keys > 32) + (*count)++; + } else if (any->class == ButtonClass) { + XButtonStatus *b = (XButtonStatus *) any; + + if (b->num_buttons > 32) + (*count)++; + } else if (any->class == ValuatorClass) { + XValuatorStatus *v = (XValuatorStatus *) any; + + if (v->num_valuators > 3) + (*count)++; + } + any = (XInputClass *) ((char *)any + any->length); + } + + sev = (deviceStateNotify *) Xmalloc(*count * sizeof(xEvent)); + if (!sev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) sev; + tev = (xEvent *) (sev + 1); + + sev->type = ev->type; + sev->deviceid = ev->deviceid; + sav_id = &(sev->deviceid); + sev->time = ev->time; + sev->classes_reported = 0; + + any = (XInputClass *) & ev->data[0]; + for (i = 0; i < ev->num_classes; i++) { + if (any->class == KeyClass) { + XKeyStatus *k = (XKeyStatus *) any; + register deviceKeyStateNotify *kev; + + sev->classes_reported |= (1 << KeyClass); + sev->num_keys = k->num_keys; + memcpy((char *)(sev->keys), (char *)(k->keys), 4); + if (k->num_keys > 32) { + kev = (deviceKeyStateNotify *) tev++; + kev->type = info->codes->first_event + + XI_DeviceKeystateNotify; + kev->deviceid = ev->deviceid; + *sav_id |= MORE_EVENTS; + sav_id = &(kev->deviceid); + memcpy((char *)(kev->keys), (char *)(&k->keys[4]), 28); + } + } else if (any->class == ButtonClass) { + XButtonStatus *b = (XButtonStatus *) any; + register deviceButtonStateNotify *bev; + + sev->classes_reported |= (1 << ButtonClass); + sev->num_buttons = b->num_buttons; + memcpy((char *)(sev->buttons), (char *)(b->buttons), 4); + if (b->num_buttons > 32) { + bev = (deviceButtonStateNotify *) tev++; + bev->type = info->codes->first_event + + XI_DeviceButtonstateNotify; + bev->deviceid = ev->deviceid; + *sav_id |= MORE_EVENTS; + sav_id = &(bev->deviceid); + memcpy((char *)(bev->buttons), (char *)(&b->buttons[4]), + 28); + } + } else if (any->class == ValuatorClass) { + XValuatorStatus *val = (XValuatorStatus *) any; + register deviceValuator *vev; + + sev->classes_reported |= (1 << ValuatorClass); + sev->num_valuators = val->num_valuators < 3 ? + val->num_valuators : 3; + switch (sev->num_valuators) { + case 3: + sev->valuator2 = val->valuators[2]; + case 2: + sev->valuator1 = val->valuators[1]; + case 1: + sev->valuator0 = val->valuators[0]; + } + if (val->num_valuators > 3) { + vev = (deviceValuator *) tev++; + vev->type = info->codes->first_event + XI_DeviceValuator; + vev->deviceid = ev->deviceid; + vev->first_valuator = 3; + vev->num_valuators = val->num_valuators - 3; + *sav_id |= MORE_EVENTS; + sav_id = &(vev->deviceid); + i = val->num_valuators; + if (i > 6) + i = 6; + switch (i) { + case 6: + vev->valuator2 = val->valuators[5]; + case 5: + vev->valuator1 = val->valuators[4]; + case 4: + vev->valuator0 = val->valuators[3]; + } + } + } + any = (XInputClass *) ((char *)any + any->length); + } + break; + } + case XI_ChangeDeviceNotify: + { + register XChangeDeviceNotifyEvent *ev = (XChangeDeviceNotifyEvent *) re; + register changeDeviceNotify *cev; + + *count = 1; + cev = (changeDeviceNotify *) Xmalloc(*count * sizeof(xEvent)); + if (!cev) + return (_XUnknownNativeEvent(dpy, re, *event)); + *event = (xEvent *) cev; + + cev->type = ev->type; + cev->request = ev->request; + cev->time = ev->time; + cev->deviceid = ev->deviceid; + break; + } + default: + return (_XUnknownNativeEvent(dpy, re, *event)); + } /* switch */ + } else /* if type != GenericEvent */ + { +#if 0 + switch (((XGenericEvent*)re)->evtype) + { + case XI_HierarchyChangedNotify: + { + XDeviceHierarchyChangedEvent *ev = + (XDeviceHierarchyChangedEvent*)re; + XIDeviceHierarchyEvent *dhcev; + *count = 1; + dhcev = (XIDeviceHierarchyEvent *)Xmalloc(*count * sizeof(xEvent)); + if (!dhcev) + return (_XUnknownNativeEvent(dpy, re, *event)); + + *event = (xEvent *) dhcev; + dhcev->type = ev->type; + dhcev->time = ev->time; + break; + } + default: + return (_XUnknownNativeEvent(dpy, re, *event)); + } +#endif + } + return (1); +} diff --git a/src/XFreeLst.c b/src/XFreeLst.c new file mode 100644 index 0000000..02cdcf7 --- /dev/null +++ b/src/XFreeLst.c @@ -0,0 +1,72 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XFreeDeviceList - free the input device list. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/*********************************************************************** + * + * Free the list of input devices. + * + */ + +XFreeDeviceList(XDeviceList *list) +{ + if (list != NULL) { + XFree((list->name) - sizeof(XDeviceList)); + XFree((XDeviceList *) list); + } +} diff --git a/src/XGMotion.c b/src/XGMotion.c new file mode 100644 index 0000000..99b1c44 --- /dev/null +++ b/src/XGMotion.c @@ -0,0 +1,140 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceMotionEvents - Get the motion history of an input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XDeviceTimeCoord * +XGetDeviceMotionEvents( + register Display *dpy, + XDevice *dev, + Time start, + Time stop, + int *nEvents, + int *mode, + int *axis_count) +{ + xGetDeviceMotionEventsReq *req; + xGetDeviceMotionEventsReply rep; + XDeviceTimeCoord *tc; + int *data, *bufp, *readp, *savp; + long size, size2; + int i, j; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XDeviceTimeCoord *) NoSuchExtension); + + GetReq(GetDeviceMotionEvents, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceMotionEvents; + req->start = start; + req->stop = stop; + req->deviceid = dev->device_id; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + *nEvents = 0; + return (NULL); + } + + *mode = rep.mode; + *axis_count = rep.axes; + *nEvents = rep.nEvents; + if (!rep.nEvents) { + UnlockDisplay(dpy); + SyncHandle(); + return (NULL); + } + size = rep.length << 2; + size2 = rep.nEvents * (sizeof(XDeviceTimeCoord) + (rep.axes * sizeof(int))); + savp = readp = (int *)Xmalloc(size); + bufp = (int *)Xmalloc(size2); + if (!bufp || !savp) { + Xfree(bufp); + Xfree(savp); + *nEvents = 0; + _XEatData(dpy, (unsigned long)size); + UnlockDisplay(dpy); + SyncHandle(); + return (NULL); + } + _XRead(dpy, (char *)readp, size); + + tc = (XDeviceTimeCoord *) bufp; + data = (int *)(tc + rep.nEvents); + for (i = 0; i < *nEvents; i++, tc++) { + tc->time = *readp++; + tc->data = data; + for (j = 0; j < *axis_count; j++) + *data++ = *readp++; + } + XFree((char *)savp); + UnlockDisplay(dpy); + SyncHandle(); + return ((XDeviceTimeCoord *) bufp); +} + +void +XFreeDeviceMotionEvents(XDeviceTimeCoord *events) +{ + XFree((char *)events); +} diff --git a/src/XGetBMap.c b/src/XGetBMap.c new file mode 100644 index 0000000..211c9ca --- /dev/null +++ b/src/XGetBMap.c @@ -0,0 +1,107 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceButtonMapping - Get the button mapping of an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +#ifdef MIN /* some systems define this in */ +#undef MIN +#endif +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +int +XGetDeviceButtonMapping( + register Display *dpy, + XDevice *device, + unsigned char map[], + unsigned int nmap) +{ + int status = 0; + unsigned char mapping[256]; /* known fixed size */ + long nbytes; + XExtDisplayInfo *info = XInput_find_display(dpy); + + register xGetDeviceButtonMappingReq *req; + xGetDeviceButtonMappingReply rep; + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(GetDeviceButtonMapping, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceButtonMapping; + req->deviceid = device->device_id; + + status = _XReply(dpy, (xReply *) & rep, 0, xFalse); + if (status == 1) { + nbytes = (long)rep.length << 2; + _XRead(dpy, (char *)mapping, nbytes); + + /* don't return more data than the user asked for. */ + if (rep.nElts) + memcpy((char *)map, (char *)mapping, MIN((int)rep.nElts, nmap)); + status = rep.nElts; + } else + status = 0; + UnlockDisplay(dpy); + SyncHandle(); + return (status); +} diff --git a/src/XGetCPtr.c b/src/XGetCPtr.c new file mode 100644 index 0000000..a6a44b7 --- /dev/null +++ b/src/XGetCPtr.c @@ -0,0 +1,70 @@ +/************************************************************ + +Copyright 2007 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XIGetClientPointer - Get the clientPointer setting for a client. + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Bool +XIGetClientPointer(Display* dpy, Window win, int *deviceid) +{ + xXIGetClientPointerReq *req; + xXIGetClientPointerReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, Dont_Check, info) == -1) + return (NoSuchExtension); + + GetReq(XIGetClientPointer, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIGetClientPointer; + req->win = win; + + if (!_XReply(dpy, (xReply*) &rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + *deviceid = rep.deviceid; + + UnlockDisplay(dpy); + SyncHandle(); + return rep.set; +} diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c new file mode 100644 index 0000000..c66212d --- /dev/null +++ b/src/XGetDCtl.c @@ -0,0 +1,242 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceControl - get the Device control state of an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +XDeviceControl * +XGetDeviceControl( + register Display *dpy, + XDevice *dev, + int control) +{ + int size = 0; + int nbytes, i; + XDeviceControl *Device = NULL; + XDeviceControl *Sav = NULL; + xDeviceState *d = NULL; + xDeviceState *sav = NULL; + xGetDeviceControlReq *req; + xGetDeviceControlReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl, info) == -1) + return ((XDeviceControl *) NoSuchExtension); + + GetReq(GetDeviceControl, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceControl; + req->deviceid = dev->device_id; + req->control = control; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) + goto out; + + if (rep.length > 0) { + nbytes = (long)rep.length << 2; + d = (xDeviceState *) Xmalloc((unsigned)nbytes); + if (!d) { + _XEatData(dpy, (unsigned long)nbytes); + goto out; + } + sav = d; + _XRead(dpy, (char *)d, nbytes); + + /* In theory, we should just be able to use d->length to get the size. + * Turns out that a number of X servers (up to and including server + * 1.4) sent the wrong length value down the wire. So to not break + * apps that run against older servers, we have to calculate the size + * manually. + */ + switch (d->control) { + case DEVICE_RESOLUTION: + { + xDeviceResolutionState *r; + + r = (xDeviceResolutionState *) d; + size += sizeof(XDeviceResolutionState) + + (3 * sizeof(int) * r->num_valuators); + break; + } + case DEVICE_ABS_CALIB: + { + size += sizeof(XDeviceAbsCalibState); + break; + } + case DEVICE_ABS_AREA: + { + size += sizeof(XDeviceAbsAreaState); + break; + } + case DEVICE_CORE: + { + size += sizeof(XDeviceCoreState); + break; + } + default: + size += d->length; + break; + } + + Device = (XDeviceControl *) Xmalloc((unsigned)size); + if (!Device) + goto out; + + Sav = Device; + + d = sav; + switch (control) { + case DEVICE_RESOLUTION: + { + int *iptr, *iptr2; + xDeviceResolutionState *r; + XDeviceResolutionState *R; + + r = (xDeviceResolutionState *) d; + R = (XDeviceResolutionState *) Device; + + R->control = DEVICE_RESOLUTION; + R->length = sizeof(XDeviceResolutionState); + R->num_valuators = r->num_valuators; + iptr = (int *)(R + 1); + iptr2 = (int *)(r + 1); + R->resolutions = iptr; + R->min_resolutions = iptr + R->num_valuators; + R->max_resolutions = iptr + (2 * R->num_valuators); + for (i = 0; i < (3 * R->num_valuators); i++) + *iptr++ = *iptr2++; + break; + } + case DEVICE_ABS_CALIB: + { + xDeviceAbsCalibState *c = (xDeviceAbsCalibState *) d; + XDeviceAbsCalibState *C = (XDeviceAbsCalibState *) Device; + + C->control = DEVICE_ABS_CALIB; + C->length = sizeof(XDeviceAbsCalibState); + C->min_x = c->min_x; + C->max_x = c->max_x; + C->min_y = c->min_y; + C->max_y = c->max_y; + C->flip_x = c->flip_x; + C->flip_y = c->flip_y; + C->rotation = c->rotation; + C->button_threshold = c->button_threshold; + + break; + } + case DEVICE_ABS_AREA: + { + xDeviceAbsAreaState *a = (xDeviceAbsAreaState *) d; + XDeviceAbsAreaState *A = (XDeviceAbsAreaState *) Device; + + A->control = DEVICE_ABS_AREA; + A->length = sizeof(XDeviceAbsAreaState); + A->offset_x = a->offset_x; + A->offset_y = a->offset_y; + A->width = a->width; + A->height = a->height; + A->screen = a->screen; + A->following = a->following; + + break; + } + case DEVICE_CORE: + { + xDeviceCoreState *c = (xDeviceCoreState *) d; + XDeviceCoreState *C = (XDeviceCoreState *) Device; + + C->control = DEVICE_CORE; + C->length = sizeof(XDeviceCoreState); + C->status = c->status; + C->iscore = c->iscore; + + break; + } + case DEVICE_ENABLE: + { + xDeviceEnableState *e = (xDeviceEnableState *) d; + XDeviceEnableState *E = (XDeviceEnableState *) Device; + + E->control = DEVICE_ENABLE; + E->length = sizeof(E); + E->enable = e->enable; + + break; + } + default: + break; + } + } +out: + XFree(sav); + + UnlockDisplay(dpy); + SyncHandle(); + return (Sav); +} + +void +XFreeDeviceControl(XDeviceControl *control) +{ + XFree(control); +} diff --git a/src/XGetDProp.c b/src/XGetDProp.c new file mode 100644 index 0000000..5d44f91 --- /dev/null +++ b/src/XGetDProp.c @@ -0,0 +1,139 @@ +/************************************************************ + +Copyright 2008 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +*/ + +/*********************************************************************** + * XGetDeviceProperties - get an input device's properties. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGetDeviceProperty(Display* dpy, XDevice* dev, + Atom property, long offset, long length, Bool delete, + Atom req_type, Atom *actual_type, int *actual_format, + unsigned long *nitems, unsigned long *bytes_after, + unsigned char **prop) +{ + xGetDevicePropertyReq *req; + xGetDevicePropertyReply rep; + long nbytes, rbytes; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return 1; + + GetReq(GetDeviceProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceProperty; + req->deviceid = dev->device_id; + req->property = property; + req->type = req_type; + req->longOffset = offset; + req->longLength = length; + req->delete = delete; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) + { + UnlockDisplay (dpy); + SyncHandle (); + return 1; + } + + *prop = (unsigned char *) NULL; + + if (rep.propertyType != None) { + /* + * One extra byte is malloced than is needed to contain the property + * data, but this last byte is null terminated and convenient for + * returning string properties, so the client doesn't then have to + * recopy the string to make it null terminated. + */ + switch (rep.format) { + case 8: + nbytes = rep.nItems; + rbytes = rep.nItems + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XReadPad (dpy, (char *) *prop, nbytes); + break; + + case 16: + nbytes = rep.nItems << 1; + rbytes = rep.nItems * sizeof (short) + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XRead16Pad (dpy, (short *) *prop, nbytes); + break; + + case 32: + nbytes = rep.nItems << 2; + rbytes = rep.nItems * sizeof (long) + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XRead32 (dpy, (long *) *prop, nbytes); + break; + + default: + /* + * This part of the code should never be reached. If it is, + * the server sent back a property with an invalid format. + */ + nbytes = rep.length << 2; + _XEatData(dpy, (unsigned long) nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadImplementation); + } + if (! *prop) { + _XEatData(dpy, (unsigned long) nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadAlloc); + } + (*prop)[rbytes - 1] = '\0'; + } + + *actual_type = rep.propertyType; + *actual_format = rep.format; + *nitems = rep.nItems; + *bytes_after = rep.bytesAfter; + UnlockDisplay (dpy); + SyncHandle (); + + return Success; +} + diff --git a/src/XGetFCtl.c b/src/XGetFCtl.c new file mode 100644 index 0000000..2961034 --- /dev/null +++ b/src/XGetFCtl.c @@ -0,0 +1,267 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetFeedbackControl - get the feedback attributes of an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +XFeedbackState * +XGetFeedbackControl( + register Display *dpy, + XDevice *dev, + int *num_feedbacks) +{ + int size = 0; + int nbytes, i; + XFeedbackState *Feedback = NULL; + XFeedbackState *Sav = NULL; + xFeedbackState *f = NULL; + xFeedbackState *sav = NULL; + xGetFeedbackControlReq *req; + xGetFeedbackControlReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XFeedbackState *) NoSuchExtension); + + GetReq(GetFeedbackControl, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetFeedbackControl; + req->deviceid = dev->device_id; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) + goto out; + + if (rep.length > 0) { + *num_feedbacks = rep.num_feedbacks; + nbytes = (long)rep.length << 2; + f = (xFeedbackState *) Xmalloc((unsigned)nbytes); + if (!f) { + _XEatData(dpy, (unsigned long)nbytes); + goto out; + } + sav = f; + _XRead(dpy, (char *)f, nbytes); + + for (i = 0; i < *num_feedbacks; i++) { + switch (f->class) { + case KbdFeedbackClass: + size += sizeof(XKbdFeedbackState); + break; + case PtrFeedbackClass: + size += sizeof(XPtrFeedbackState); + break; + case IntegerFeedbackClass: + size += sizeof(XIntegerFeedbackState); + break; + case StringFeedbackClass: + { + xStringFeedbackState *strf = (xStringFeedbackState *) f; + + size += sizeof(XStringFeedbackState) + + (strf->num_syms_supported * sizeof(KeySym)); + } + break; + case LedFeedbackClass: + size += sizeof(XLedFeedbackState); + break; + case BellFeedbackClass: + size += sizeof(XBellFeedbackState); + break; + default: + size += f->length; + break; + } + f = (xFeedbackState *) ((char *)f + f->length); + } + + Feedback = (XFeedbackState *) Xmalloc((unsigned)size); + if (!Feedback) + goto out; + + Sav = Feedback; + + f = sav; + for (i = 0; i < *num_feedbacks; i++) { + switch (f->class) { + case KbdFeedbackClass: + { + xKbdFeedbackState *k; + XKbdFeedbackState *K; + + k = (xKbdFeedbackState *) f; + K = (XKbdFeedbackState *) Feedback; + + K->class = k->class; + K->length = sizeof(XKbdFeedbackState); + K->id = k->id; + K->click = k->click; + K->percent = k->percent; + K->pitch = k->pitch; + K->duration = k->duration; + K->led_mask = k->led_mask; + K->global_auto_repeat = k->global_auto_repeat; + memcpy((char *)&K->auto_repeats[0], + (char *)&k->auto_repeats[0], 32); + break; + } + case PtrFeedbackClass: + { + xPtrFeedbackState *p; + XPtrFeedbackState *P; + + p = (xPtrFeedbackState *) f; + P = (XPtrFeedbackState *) Feedback; + + P->class = p->class; + P->length = sizeof(XPtrFeedbackState); + P->id = p->id; + P->accelNum = p->accelNum; + P->accelDenom = p->accelDenom; + P->threshold = p->threshold; + break; + } + case IntegerFeedbackClass: + { + xIntegerFeedbackState *i; + XIntegerFeedbackState *I; + + i = (xIntegerFeedbackState *) f; + I = (XIntegerFeedbackState *) Feedback; + + I->class = i->class; + I->length = sizeof(XIntegerFeedbackState); + I->id = i->id; + I->resolution = i->resolution; + I->minVal = i->min_value; + I->maxVal = i->max_value; + break; + } + case StringFeedbackClass: + { + xStringFeedbackState *s; + XStringFeedbackState *S; + + s = (xStringFeedbackState *) f; + S = (XStringFeedbackState *) Feedback; + + S->class = s->class; + S->length = sizeof(XStringFeedbackState) + + (s->num_syms_supported * sizeof(KeySym)); + S->id = s->id; + S->max_symbols = s->max_symbols; + S->num_syms_supported = s->num_syms_supported; + S->syms_supported = (KeySym *) (S + 1); + memcpy((char *)S->syms_supported, (char *)(s + 1), + (S->num_syms_supported * sizeof(KeySym))); + break; + } + case LedFeedbackClass: + { + xLedFeedbackState *l; + XLedFeedbackState *L; + + l = (xLedFeedbackState *) f; + L = (XLedFeedbackState *) Feedback; + + L->class = l->class; + L->length = sizeof(XLedFeedbackState); + L->id = l->id; + L->led_values = l->led_values; + L->led_mask = l->led_mask; + break; + } + case BellFeedbackClass: + { + xBellFeedbackState *b; + XBellFeedbackState *B; + + b = (xBellFeedbackState *) f; + B = (XBellFeedbackState *) Feedback; + + B->class = b->class; + B->length = sizeof(XBellFeedbackState); + B->id = b->id; + B->percent = b->percent; + B->pitch = b->pitch; + B->duration = b->duration; + break; + } + default: + break; + } + f = (xFeedbackState *) ((char *)f + f->length); + Feedback = (XFeedbackState *) ((char *)Feedback + Feedback->length); + } + } +out: + XFree((char *)sav); + + UnlockDisplay(dpy); + SyncHandle(); + return (Sav); +} + +void +XFreeFeedbackList(XFeedbackState *list) +{ + XFree((char *)list); +} diff --git a/src/XGetKMap.c b/src/XGetKMap.c new file mode 100644 index 0000000..9431fbb --- /dev/null +++ b/src/XGetKMap.c @@ -0,0 +1,108 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceKeyMapping - get the keymap of an extension device. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +KeySym * +XGetDeviceKeyMapping(register Display * dpy, XDevice * dev, +#if NeedWidePrototypes + unsigned int first, +#else + KeyCode first, +#endif + int keycount, int *syms_per_code) +{ + long nbytes; + register KeySym *mapping = NULL; + xGetDeviceKeyMappingReq *req; + xGetDeviceKeyMappingReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((KeySym *) NoSuchExtension); + + GetReq(GetDeviceKeyMapping, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceKeyMapping; + req->deviceid = dev->device_id; + req->firstKeyCode = first; + req->count = keycount; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return (KeySym *) NULL; + } + if (rep.length > 0) { + *syms_per_code = rep.keySymsPerKeyCode; + nbytes = (long)rep.length << 2; + mapping = (KeySym *) Xmalloc((unsigned)nbytes); + if (mapping) + _XRead(dpy, (char *)mapping, nbytes); + else + _XEatData(dpy, (unsigned long)nbytes); + } + + UnlockDisplay(dpy); + SyncHandle(); + return (mapping); +} diff --git a/src/XGetMMap.c b/src/XGetMMap.c new file mode 100644 index 0000000..8a1cdb2 --- /dev/null +++ b/src/XGetMMap.c @@ -0,0 +1,102 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceModifierMapping - get the modifier map of an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XModifierKeymap * +XGetDeviceModifierMapping( + register Display *dpy, + XDevice *dev) +{ + unsigned long nbytes; + XModifierKeymap *res; + xGetDeviceModifierMappingReq *req; + xGetDeviceModifierMappingReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XModifierKeymap *) NoSuchExtension); + + GetReq(GetDeviceModifierMapping, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceModifierMapping; + req->deviceid = dev->device_id; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return (XModifierKeymap *) NULL; + } + nbytes = (unsigned long)rep.length << 2; + res = (XModifierKeymap *) Xmalloc(sizeof(XModifierKeymap)); + if (res) { + res->modifiermap = (KeyCode *) Xmalloc(nbytes); + if (res->modifiermap) + _XReadPad(dpy, (char *)res->modifiermap, nbytes); + else + _XEatData(dpy, (unsigned long)nbytes); + res->max_keypermod = rep.numKeyPerModifier; + } + + UnlockDisplay(dpy); + SyncHandle(); + return (res); +} diff --git a/src/XGetProp.c b/src/XGetProp.c new file mode 100644 index 0000000..c5d088b --- /dev/null +++ b/src/XGetProp.c @@ -0,0 +1,114 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceDontPropagateList - Get the dont_propagate_list for a + * window. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XEventClass * +XGetDeviceDontPropagateList( + register Display *dpy, + Window window, + int *count) +{ + XEventClass *list = NULL; + int rlen; + xGetDeviceDontPropagateListReq *req; + xGetDeviceDontPropagateListReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XEventClass *) NoSuchExtension); + + GetReq(GetDeviceDontPropagateList, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceDontPropagateList; + req->window = window; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return (XEventClass *) NULL; + } + *count = rep.count; + + if (*count) { + rlen = rep.length << 2; + list = (XEventClass *) Xmalloc(rep.length * sizeof(XEventClass)); + if (list) { + int i; + CARD32 ec; + + /* read and assign each XEventClass separately because + * the library representation may not be the same size + * as the wire representation (64 bit machines) + */ + for (i = 0; i < rep.length; i++) { + _XRead(dpy, (char *)(&ec), sizeof(CARD32)); + list[i] = (XEventClass) ec; + } + } else + _XEatData(dpy, (unsigned long)rlen); + } + + UnlockDisplay(dpy); + SyncHandle(); + return (list); +} diff --git a/src/XGetVers.c b/src/XGetVers.c new file mode 100644 index 0000000..0751b98 --- /dev/null +++ b/src/XGetVers.c @@ -0,0 +1,117 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetExtensionVersion - Get the version of the input extension. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XExtensionVersion * +XGetExtensionVersion(register Display * dpy, _Xconst char *name) +{ + XExtensionVersion *ext; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + ext = _XiGetExtensionVersion(dpy, name, info); + if (ext != (XExtensionVersion *) NoSuchExtension) { + UnlockDisplay(dpy); + SyncHandle(); + } + return (ext); +} + +_X_HIDDEN XExtensionVersion* +_XiGetExtensionVersionRequest(Display *dpy, _Xconst char *name, int xi_opcode) +{ + xGetExtensionVersionReq *req; + xGetExtensionVersionReply rep; + XExtensionVersion *ext; + + GetReq(GetExtensionVersion, req); + req->reqType = xi_opcode; + req->ReqType = X_GetExtensionVersion; + req->nbytes = strlen(name); + req->length += (unsigned)(req->nbytes + 3) >> 2; + _XSend(dpy, name, (long)req->nbytes); + + if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) { + return (XExtensionVersion *) NULL; + } + + ext = (XExtensionVersion *) Xmalloc(sizeof(XExtensionVersion)); + if (ext) { + ext->present = rep.present; + if (ext->present) { + ext->major_version = rep.major_version; + ext->minor_version = rep.minor_version; + } + } + + return ext; +} + +_X_HIDDEN XExtensionVersion * +_XiGetExtensionVersion(register Display * dpy, _Xconst char *name, + XExtDisplayInfo *info) +{ + if (_XiCheckExtInit(dpy, Dont_Check, info) == -1) + return ((XExtensionVersion *) NoSuchExtension); + + return _XiGetExtensionVersionRequest(dpy, name, info->codes->major_opcode); +} diff --git a/src/XGrDvBut.c b/src/XGrDvBut.c new file mode 100644 index 0000000..312ff20 --- /dev/null +++ b/src/XGrDvBut.c @@ -0,0 +1,112 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGrabDeviceBut - Grab a button on an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGrabDeviceButton( + register Display *dpy, + XDevice *dev, + unsigned int button, /* CARD8 */ + unsigned int modifiers, /* CARD16 */ + XDevice *modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode) +{ + register xGrabDeviceButtonReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(GrabDeviceButton, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_GrabDeviceButton; + req->grabbed_device = dev->device_id; + req->button = button; + req->modifiers = modifiers; + if (modifier_device) + req->modifier_device = modifier_device->device_id; + else + req->modifier_device = UseXKeyboard; + req->grabWindow = grab_window; + req->ownerEvents = owner_events; + req->event_count = event_count; + req->this_device_mode = this_device_mode; + req->other_devices_mode = other_devices_mode; + req->length += event_count; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + event_count <<= 2; + Data32(dpy, (long *)event_list, event_count); + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XGrDvKey.c b/src/XGrDvKey.c new file mode 100644 index 0000000..7f6571b --- /dev/null +++ b/src/XGrDvKey.c @@ -0,0 +1,114 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGrabDeviceKey - Grab a key on an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGrabDeviceKey( + register Display *dpy, + XDevice *dev, + unsigned int key, /* CARD8 */ + unsigned int modifiers, /* CARD16 */ + XDevice *modifier_device, + Window grab_window, + Bool owner_events, + unsigned int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode) +{ + register xGrabDeviceKeyReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(GrabDeviceKey, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_GrabDeviceKey; + req->grabbed_device = dev->device_id; + req->key = key; + req->modifiers = modifiers; + if (modifier_device) + req->modifier_device = modifier_device->device_id; + else + req->modifier_device = UseXKeyboard; + req->grabWindow = grab_window; + req->ownerEvents = owner_events; + req->event_count = event_count; + req->this_device_mode = this_device_mode; + req->other_devices_mode = other_devices_mode; + req->length += event_count; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + if (event_count) { + event_count <<= 2; + Data32(dpy, (long *)event_list, event_count); + } + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XGrabDev.c b/src/XGrabDev.c new file mode 100644 index 0000000..ce4613e --- /dev/null +++ b/src/XGrabDev.c @@ -0,0 +1,108 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGrabDevice - grab an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGrabDevice( + register Display *dpy, + XDevice *dev, + Window grab_window, + Bool ownerEvents, + int event_count, + XEventClass *event_list, + int this_device_mode, + int other_devices_mode, + Time time) +{ + xGrabDeviceReply rep; + register xGrabDeviceReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(GrabDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GrabDevice; + + req->deviceid = dev->device_id; + req->grabWindow = grab_window; + req->ownerEvents = ownerEvents; + req->event_count = event_count; + req->this_device_mode = this_device_mode; + req->other_devices_mode = other_devices_mode; + req->time = time; + req->length += event_count; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + event_count <<= 2; + Data32(dpy, (long *)event_list, event_count); + + if (_XReply(dpy, (xReply *) & rep, 0, xTrue) == 0) + rep.status = GrabSuccess; + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); +} diff --git a/src/XGtFocus.c b/src/XGtFocus.c new file mode 100644 index 0000000..b4c4bd9 --- /dev/null +++ b/src/XGtFocus.c @@ -0,0 +1,91 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetDeviceFocus - Get the focus of an input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGetDeviceFocus( + register Display *dpy, + XDevice *dev, + Window *focus, + int *revert_to, + Time *time) +{ + xGetDeviceFocusReq *req; + xGetDeviceFocusReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(GetDeviceFocus, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetDeviceFocus; + req->deviceid = dev->device_id; + + (void)_XReply(dpy, (xReply *) & rep, 0, xTrue); + *focus = rep.focus; + *revert_to = rep.revertTo; + *time = rep.time; + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XGtSelect.c b/src/XGtSelect.c new file mode 100644 index 0000000..f890db7 --- /dev/null +++ b/src/XGtSelect.c @@ -0,0 +1,142 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XGetSelectedExtensionEvents - return a list of currently selected events. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XGetSelectedExtensionEvents( + register Display *dpy, + Window w, + int *this_client_count, + XEventClass **this_client_list, + int *all_clients_count, + XEventClass **all_clients_list) +{ + int tlen, alen; + register xGetSelectedExtensionEventsReq *req; + xGetSelectedExtensionEventsReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(GetSelectedExtensionEvents, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_GetSelectedExtensionEvents; + req->window = w; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return Success; + } + + *this_client_count = rep.this_client_count; + *all_clients_count = rep.all_clients_count; + + if (rep.length) { + int i; + CARD32 ec; + + tlen = (*this_client_count) * sizeof(CARD32); + alen = (rep.length << 2) - tlen; + + if (tlen) { + *this_client_list = + (XEventClass *) Xmalloc(*this_client_count * + sizeof(XEventClass)); + if (!*this_client_list) { + _XEatData(dpy, (unsigned long)tlen + alen); + UnlockDisplay(dpy); + SyncHandle(); + return (Success); + } + for (i = 0; i < *this_client_count; i++) { + _XRead(dpy, (char *)(&ec), sizeof(CARD32)); + (*this_client_list)[i] = (XEventClass) ec; + } + } else + *this_client_list = (XEventClass *) NULL; + if (alen) { + *all_clients_list = + (XEventClass *) Xmalloc(*all_clients_count * + sizeof(XEventClass)); + if (!*all_clients_list) { + Xfree((char *)*this_client_list); + *this_client_list = NULL; + _XEatData(dpy, (unsigned long)alen); + UnlockDisplay(dpy); + SyncHandle(); + return (Success); + } + for (i = 0; i < *all_clients_count; i++) { + _XRead(dpy, (char *)(&ec), sizeof(CARD32)); + (*all_clients_list)[i] = (XEventClass) ec; + } + } else + *all_clients_list = (XEventClass *) NULL; + + } + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XIAllowEvents.c b/src/XIAllowEvents.c new file mode 100644 index 0000000..c8d997a --- /dev/null +++ b/src/XIAllowEvents.c @@ -0,0 +1,102 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +/* for GetRequest() to work */ +#define X_XI2_2AllowEvents X_XIAllowEvents + +static Status +_XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time, + unsigned int touchid, Window grab_window) +{ + Bool have_XI22 = True; + xXIAllowEventsReq *req; + xXI2_2AllowEventsReq *req_XI22; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return (NoSuchExtension); + + if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == 0) + have_XI22 = True; + + if (have_XI22) + { + GetReq(XI2_2AllowEvents, req_XI22); + req = (xXIAllowEventsReq*)req_XI22; + } else + GetReq(XIAllowEvents, req); + + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIAllowEvents; + req->deviceid = deviceid; + req->mode = event_mode; + req->time = time; + + if (have_XI22) { + req_XI22->touchid = touchid; + req_XI22->grab_window = grab_window; + } + + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} + +Status +XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time) +{ + return _XIAllowEvents(dpy, deviceid, event_mode, time, 0, None); +} + +Status +XIAllowTouchEvents(Display *dpy, int deviceid, unsigned int touchid, + Window grab_window, int event_mode) +{ + int status; + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == -1) + return (NoSuchExtension); + + status = _XIAllowEvents(dpy, deviceid, event_mode, CurrentTime, touchid, grab_window); + + UnlockDisplay(dpy); + SyncHandle(); + + return status; +} diff --git a/src/XIDefineCursor.c b/src/XIDefineCursor.c new file mode 100644 index 0000000..6308945 --- /dev/null +++ b/src/XIDefineCursor.c @@ -0,0 +1,69 @@ +/************************************************************ + +Copyright 2006 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XIDefineCursor - Change the cursor of an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + + +int XIDefineCursor(Display *dpy, int deviceid, Window w, Cursor cursor) +{ + xXIChangeCursorReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + LockDisplay(dpy); + + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return (NoSuchExtension); + + GetReq(XIChangeCursor, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIChangeCursor; + req->deviceid = deviceid; + req->win = w; + req->cursor = cursor; + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} + +int XIUndefineCursor(Display *dpy, int deviceid, Window w) +{ + return XIDefineCursor(dpy, deviceid, w, None); +} + diff --git a/src/XIGetDevFocus.c b/src/XIGetDevFocus.c new file mode 100644 index 0000000..172f93e --- /dev/null +++ b/src/XIGetDevFocus.c @@ -0,0 +1,65 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Status +XIGetFocus(Display *dpy, int deviceid, Window *focus_return) +{ + xXIGetFocusReq *req; + xXIGetFocusReply reply; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return (NoSuchExtension); + + GetReq(XIGetFocus, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIGetFocus; + req->deviceid = deviceid; + + if (!_XReply(dpy, (xReply*) &reply, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + *focus_return = reply.focus; + + UnlockDisplay(dpy); + SyncHandle(); + return Success; + +} + diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c new file mode 100644 index 0000000..dd1bd10 --- /dev/null +++ b/src/XIGrabDevice.c @@ -0,0 +1,108 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + + +Status +XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time, + Cursor cursor, int grab_mode, int paired_device_mode, + Bool owner_events, XIEventMask *mask) +{ + xXIGrabDeviceReq *req; + xXIGrabDeviceReply reply; + char* buff; + int len; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return (NoSuchExtension); + + GetReq(XIGrabDevice, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIGrabDevice; + req->deviceid = deviceid; + req->grab_window = grab_window; + req->time = time; + req->grab_mode = grab_mode; + req->paired_device_mode = paired_device_mode; + req->owner_events = owner_events; + req->mask_len = (mask->mask_len + 3)/4; + req->cursor = cursor; + + + /* mask->mask_len is in bytes, but we need 4-byte units on the wire, + * and they need to be padded with 0 */ + len = req->mask_len; + buff = calloc(1, len * 4); + memcpy(buff, mask->mask, mask->mask_len); + + SetReqLen(req, len, len); + Data(dpy, buff, len * 4); + free(buff); + + if (_XReply(dpy, (xReply *)&reply, 0, xTrue) == 0) + reply.status = GrabSuccess; + + UnlockDisplay(dpy); + SyncHandle(); + + return reply.status; +} + +Status +XIUngrabDevice(Display* dpy, int deviceid, Time time) +{ + xXIUngrabDeviceReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return (NoSuchExtension); + + GetReq(XIUngrabDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIUngrabDevice; + + req->deviceid = deviceid; + req->time = time; + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} + + diff --git a/src/XIHierarchy.c b/src/XIHierarchy.c new file mode 100644 index 0000000..39c3d1b --- /dev/null +++ b/src/XIHierarchy.c @@ -0,0 +1,162 @@ +/************************************************************ + +Copyright 2007 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XIChangeHierarchy - change the device hierarchy, i.e. which slave + * device is attached to which master, etc. + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XIChangeHierarchy(Display* dpy, + XIAnyHierarchyChangeInfo* changes, + int num_changes) +{ + XIAnyHierarchyChangeInfo* any; + xXIChangeHierarchyReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + char *data = NULL, *dptr; + int dlen = 0, i; + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return (NoSuchExtension); + + if (num_changes <= 0) + return Success; + + GetReq(XIChangeHierarchy, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIChangeHierarchy; + req->num_changes = num_changes; + + /* alloc required memory */ + for (i = 0, any = changes; i < num_changes; i++, any++) + { + switch(any->type) + { + case XIAddMaster: + { + int slen = (strlen(any->add.name)); + dlen += sizeof(xXIAddMasterInfo) + + slen + (4 - (slen % 4)); + } + break; + case XIRemoveMaster: + dlen += sizeof(xXIRemoveMasterInfo); + break; + case XIAttachSlave: + dlen += sizeof(xXIAttachSlaveInfo); + break; + case XIDetachSlave: + dlen += sizeof(xXIDetachSlaveInfo); + break; + default: + return BadValue; + } + } + + req->length += dlen / 4; /* dlen is 4-byte aligned */ + data = Xmalloc(dlen); + if (!data) + return BadAlloc; + + dptr = data; + for (i = 0, any = changes; i < num_changes; i++, any++) + { + switch(any->type) + { + case XIAddMaster: + { + XIAddMasterInfo* C = &any->add; + xXIAddMasterInfo* c = (xXIAddMasterInfo*)dptr; + c->type = C->type; + c->send_core = C->send_core; + c->enable = C->enable; + c->name_len = strlen(C->name); + c->length = (sizeof(xXIAddMasterInfo) + c->name_len + 3)/4; + strncpy((char*)&c[1], C->name, c->name_len); + dptr += c->length; + } + break; + case XIRemoveMaster: + { + XIRemoveMasterInfo* R = &any->remove; + xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)dptr; + r->type = R->type; + r->return_mode = R->return_mode; + r->deviceid = R->deviceid; + r->length = sizeof(xXIRemoveMasterInfo)/4; + if (r->return_mode == XIAttachToMaster) + { + r->return_pointer = R->return_pointer; + r->return_keyboard = R->return_keyboard; + } + dptr += sizeof(xXIRemoveMasterInfo); + } + break; + case XIAttachSlave: + { + XIAttachSlaveInfo* C = &any->attach; + xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)dptr; + + c->type = C->type; + c->deviceid = C->deviceid; + c->length = sizeof(xXIAttachSlaveInfo)/4; + c->new_master = C->new_master; + + dptr += sizeof(xXIAttachSlaveInfo); + } + break; + case XIDetachSlave: + { + XIDetachSlaveInfo *D = &any->detach; + xXIDetachSlaveInfo *d = (xXIDetachSlaveInfo*)dptr; + + d->type = D->type; + d->deviceid = D->deviceid; + d->length = sizeof(xXIDetachSlaveInfo)/4; + dptr += sizeof(xXIDetachSlaveInfo); + } + } + } + + Data(dpy, data, dlen); + Xfree(data); + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} diff --git a/src/XIPassiveGrab.c b/src/XIPassiveGrab.c new file mode 100644 index 0000000..ac17c01 --- /dev/null +++ b/src/XIPassiveGrab.c @@ -0,0 +1,246 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +static int +_XIPassiveGrabDevice(Display* dpy, int deviceid, int grabtype, int detail, + Window grab_window, Cursor cursor, + int grab_mode, int paired_device_mode, + Bool owner_events, XIEventMask *mask, + int num_modifiers, XIGrabModifiers *modifiers_inout) +{ + xXIPassiveGrabDeviceReq *req; + xXIPassiveGrabDeviceReply reply; + xXIGrabModifierInfo *failed_mods; + int len = 0, i; + char *buff; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return -1; + + GetReq(XIPassiveGrabDevice, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIPassiveGrabDevice; + req->deviceid = deviceid; + req->grab_mode = grab_mode; + req->paired_device_mode = paired_device_mode; + req->owner_events = owner_events; + req->grab_window = grab_window; + req->cursor = cursor; + req->detail = detail; + req->num_modifiers = num_modifiers; + req->mask_len = (mask->mask_len + 3)/4; + req->grab_type = grabtype; + + len = req->mask_len + num_modifiers; + SetReqLen(req, len, len); + + buff = calloc(4, req->mask_len); + memcpy(buff, mask->mask, mask->mask_len); + Data(dpy, buff, req->mask_len * 4); + for (i = 0; i < num_modifiers; i++) + Data(dpy, (char*)&modifiers_inout[i].modifiers, 4); + + free(buff); + + if (!_XReply(dpy, (xReply *)&reply, 0, xFalse)) + { + UnlockDisplay(dpy); + SyncHandle(); + return -1; + } + + failed_mods = calloc(reply.num_modifiers, sizeof(xXIGrabModifierInfo)); + if (!failed_mods) + return -1; + _XRead(dpy, (char*)failed_mods, reply.num_modifiers * sizeof(xXIGrabModifierInfo)); + + for (i = 0; i < reply.num_modifiers; i++) + { + modifiers_inout[i].status = failed_mods[i].status; + modifiers_inout[i].modifiers = failed_mods[i].modifiers; + } + free(failed_mods); + + UnlockDisplay(dpy); + SyncHandle(); + return reply.num_modifiers; +} + +int +XIGrabButton(Display* dpy, int deviceid, int button, + Window grab_window, Cursor cursor, + int grab_mode, int paired_device_mode, + Bool owner_events, XIEventMask *mask, + int num_modifiers, XIGrabModifiers *modifiers_inout) +{ + return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeButton, button, + grab_window, cursor, grab_mode, + paired_device_mode, owner_events, mask, + num_modifiers, modifiers_inout); +} + +int +XIGrabKeycode(Display* dpy, int deviceid, int keycode, + Window grab_window, int grab_mode, int paired_device_mode, + Bool owner_events, XIEventMask *mask, + int num_modifiers, XIGrabModifiers *modifiers_inout) +{ + return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeKeycode, keycode, + grab_window, None, grab_mode, paired_device_mode, + owner_events, mask, num_modifiers, + modifiers_inout); +} + +int +XIGrabEnter(Display *dpy, int deviceid, Window grab_window, Cursor cursor, + int grab_mode, int paired_device_mode, Bool owner_events, + XIEventMask *mask, int num_modifiers, + XIGrabModifiers *modifiers_inout) +{ + return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeEnter, 0, + grab_window, cursor, grab_mode, paired_device_mode, + owner_events, mask, num_modifiers, + modifiers_inout); +} + +int +XIGrabFocusIn(Display *dpy, int deviceid, Window grab_window, int grab_mode, + int paired_device_mode, Bool owner_events, XIEventMask *mask, + int num_modifiers, XIGrabModifiers *modifiers_inout) +{ + return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeFocusIn, 0, + grab_window, None, grab_mode, paired_device_mode, + owner_events, mask, num_modifiers, + modifiers_inout); +} + +int +XIGrabTouchBegin(Display *dpy, int deviceid, Window grab_window, + Bool owner_events, XIEventMask *mask, + int num_modifiers, XIGrabModifiers *modifiers_inout) +{ + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == -1) + return -1; + + /* FIXME: allow selection of GrabMode for paired devices? */ + return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeTouchBegin, 0, + grab_window, None, XIGrabModeTouch, + GrabModeAsync, owner_events, mask, + num_modifiers, modifiers_inout); +} + + +static int +_XIPassiveUngrabDevice(Display* dpy, int deviceid, int grabtype, int detail, + Window grab_window, int num_modifiers, XIGrabModifiers *modifiers) +{ + xXIPassiveUngrabDeviceReq *req; + int i; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return -1; + + GetReq(XIPassiveUngrabDevice, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIPassiveUngrabDevice; + req->deviceid = deviceid; + req->grab_window = grab_window; + req->detail = detail; + req->num_modifiers = num_modifiers; + req->grab_type = grabtype; + + SetReqLen(req, num_modifiers, num_modifiers); + for (i = 0; i < num_modifiers; i++) + Data32(dpy, &modifiers[i].modifiers, 4); + + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} + +int +XIUngrabButton(Display* display, int deviceid, int button,Window grab_window, + int num_modifiers, XIGrabModifiers *modifiers) +{ + return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeButton, button, + grab_window, num_modifiers, modifiers); +} + +int +XIUngrabKeycode(Display* display, int deviceid, int keycode, Window grab_window, + int num_modifiers, XIGrabModifiers *modifiers) +{ + return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeKeycode, keycode, + grab_window, num_modifiers, modifiers); +} + + +int +XIUngrabEnter(Display* display, int deviceid, Window grab_window, + int num_modifiers, XIGrabModifiers *modifiers) +{ + return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeEnter, 0, + grab_window, num_modifiers, modifiers); +} + +int +XIUngrabFocusIn(Display* display, int deviceid, Window grab_window, + int num_modifiers, XIGrabModifiers *modifiers) +{ + return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeFocusIn, 0, + grab_window, num_modifiers, modifiers); +} + +int +XIUngrabTouchBegin(Display* display, int deviceid, Window grab_window, + int num_modifiers, XIGrabModifiers *modifiers) +{ + XExtDisplayInfo *extinfo = XInput_find_display(display); + + LockDisplay(display); + if (_XiCheckExtInit(display, XInput_2_2, extinfo) == -1) + return -1; + + return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeTouchBegin, 0, + grab_window, num_modifiers, modifiers); +} diff --git a/src/XIProperties.c b/src/XIProperties.c new file mode 100644 index 0000000..83a7a68 --- /dev/null +++ b/src/XIProperties.c @@ -0,0 +1,242 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +/*********************************************************************** + * XI2 property requests, list, change, delete and get properties. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +Atom* +XIListProperties(Display* dpy, int deviceid, int *num_props_return) +{ + xXIListPropertiesReq *req; + xXIListPropertiesReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + Atom *props = NULL; + + LockDisplay(dpy); + *num_props_return = 0; + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + goto cleanup; + + GetReq(XIListProperties, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIListProperties; + req->deviceid = deviceid; + + if (!_XReply(dpy, (xReply*)&rep, 0, xFalse)) + goto cleanup; + + if (rep.num_properties) { + props = (Atom*)Xmalloc(rep.num_properties * sizeof(Atom)); + if (!props) + { + _XEatData(dpy, rep.num_properties << 2); + goto cleanup; + } + + _XRead32(dpy, (long*)props, rep.num_properties << 2); + } + + *num_props_return = rep.num_properties; + +cleanup: + UnlockDisplay(dpy); + SyncHandle(); + return props; +} + + +void +XIDeleteProperty(Display* dpy, int deviceid, Atom property) +{ + xXIDeletePropertyReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return; + + GetReq(XIDeleteProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIDeleteProperty; + req->deviceid = deviceid; + req->property = property; + + UnlockDisplay(dpy); + SyncHandle(); +} + +void +XIChangeProperty(Display* dpy, int deviceid, Atom property, Atom type, + int format, int mode, unsigned char *data, int num_items) +{ + xXIChangePropertyReq *req; + int len; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return; + + GetReq(XIChangeProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIChangeProperty; + req->deviceid = deviceid; + req->property = property; + req->type = type; + req->mode = mode; + if (num_items < 0) { + req->num_items = 0; + req->format = 0; /* ask for garbage, get garbage */ + } else { + req->num_items = num_items; + req->format = format; + } + + switch (req->format) { + case 8: + len = (num_items + 3)/4; + SetReqLen(req, len, len); + len = num_items; + break; + + case 16: + len = (num_items + 1)/2; + SetReqLen(req, len, len); + len = num_items * 2; + break; + + case 32: + len = num_items; + SetReqLen(req, len, len); + len = num_items * 4; + break; + + default: + /* BadValue will be generated */ ; + len = 0; + } + + /* we use data instead of Data32 and friends to avoid Xlib's braindead + * 64 bit handling.*/ + + Data(dpy, (const char*)data, len); + UnlockDisplay(dpy); + SyncHandle(); +} + +Status +XIGetProperty(Display* dpy, int deviceid, Atom property, long offset, + long length, Bool delete_property, Atom type, + Atom *type_return, int *format_return, + unsigned long *num_items_return,unsigned long *bytes_after_return, + unsigned char **data) +{ + xXIGetPropertyReq *req; + xXIGetPropertyReply rep; + long nbytes, rbytes; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return 1; + + GetReq(XIGetProperty, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIGetProperty; + req->deviceid = deviceid; + req->property = property; + req->type = type; + req->offset = offset; + req->len = length; + req->delete = delete_property; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) + { + UnlockDisplay (dpy); + SyncHandle (); + return 1; + } + + *data = NULL; + + if (rep.type != None) { + if (rep.format != 8 && rep.format != 16 && rep.format != 32) { + /* + * This part of the code should never be reached. If it is, + * the server sent back a property with an invalid format. + */ + nbytes = rep.length << 2; + _XEatData(dpy, nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadImplementation); + } + + /* + * One extra byte is malloced than is needed to contain the property + * data, but this last byte is null terminated and convenient for + * returning string properties, so the client doesn't then have to + * recopy the string to make it null terminated. + */ + + nbytes = rep.num_items * rep.format/8; + rbytes = nbytes + 1; + *data = Xmalloc(rbytes); + + if (!(*data)) { + _XEatData(dpy, nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadAlloc); + } + + _XReadPad (dpy, (char *)*data, nbytes); + (*data)[rbytes - 1] = '\0'; + } + + *type_return = rep.type; + *format_return = rep.format; + *num_items_return = rep.num_items; + *bytes_after_return = rep.bytes_after; + UnlockDisplay (dpy); + SyncHandle(); + return Success; +} diff --git a/src/XIQueryDevice.c b/src/XIQueryDevice.c new file mode 100644 index 0000000..4be1eca --- /dev/null +++ b/src/XIQueryDevice.c @@ -0,0 +1,124 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +extern int copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses); +extern int size_classes(xXIAnyInfo* from, int nclasses); + +XIDeviceInfo* +XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return) +{ + XIDeviceInfo *info = NULL; + xXIQueryDeviceReq *req; + xXIQueryDeviceReply reply; + char *ptr; + int i; + char *buf; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + goto error; + + GetReq(XIQueryDevice, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XIQueryDevice; + req->deviceid = deviceid; + + if (!_XReply(dpy, (xReply*) &reply, 0, xFalse)) + goto error; + + *ndevices_return = reply.num_devices; + info = Xmalloc((reply.num_devices + 1) * sizeof(XIDeviceInfo)); + if (!info) + goto error; + + buf = Xmalloc(reply.length * 4); + _XRead(dpy, buf, reply.length * 4); + ptr = buf; + + /* info is a null-terminated array */ + info[reply.num_devices].name = NULL; + + for (i = 0; i < reply.num_devices; i++) + { + int nclasses; + size_t sz; + XIDeviceInfo *lib = &info[i]; + xXIDeviceInfo *wire = (xXIDeviceInfo*)ptr; + + lib->deviceid = wire->deviceid; + lib->use = wire->use; + lib->attachment = wire->attachment; + lib->enabled = wire->enabled; + nclasses = wire->num_classes; + + ptr += sizeof(xXIDeviceInfo); + + lib->name = Xcalloc(wire->name_len + 1, 1); + strncpy(lib->name, ptr, wire->name_len); + ptr += ((wire->name_len + 3)/4) * 4; + + sz = size_classes((xXIAnyInfo*)ptr, nclasses); + lib->classes = Xmalloc(sz); + ptr += copy_classes(lib, (xXIAnyInfo*)ptr, &nclasses); + /* We skip over unused classes */ + lib->num_classes = nclasses; + } + + Xfree(buf); + UnlockDisplay(dpy); + SyncHandle(); + return info; + +error: + UnlockDisplay(dpy); + SyncHandle(); + *ndevices_return = -1; + return NULL; +} + +void +XIFreeDeviceInfo(XIDeviceInfo* info) +{ + XIDeviceInfo *ptr = info; + while(ptr->name) + { + Xfree(ptr->classes); + Xfree(ptr->name); + ptr++; + } + Xfree(info); +} diff --git a/src/XIQueryPointer.c b/src/XIQueryPointer.c new file mode 100644 index 0000000..6666d1a --- /dev/null +++ b/src/XIQueryPointer.c @@ -0,0 +1,107 @@ +/************************************************************ + +Copyright 2006 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XIQueryPointer - Query the pointer of an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +#define FP1616toDBL(x) ((x) * 1.0 / (1 << 16)) + +Bool +XIQueryPointer(Display *dpy, + int deviceid, + Window w, + Window *root, + Window *child, + double *root_x, + double *root_y, + double *win_x, + double *win_y, + XIButtonState *buttons, + XIModifierState *mods, + XIGroupState *group) +{ + xXIQueryPointerReq *req; + xXIQueryPointerReply rep; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return False; + + GetReq(XIQueryPointer, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIQueryPointer; + req->deviceid = deviceid; + req->win = w; + + if (!_XReply(dpy, (xReply *)&rep, + (sizeof(xXIQueryPointerReply) - sizeof(xReply))/4, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + + *root = rep.root; + *child = rep.child; + *root_x = FP1616toDBL(cvtINT16toInt(rep.root_x)); + *root_y = FP1616toDBL(cvtINT16toInt(rep.root_y)); + *win_x = FP1616toDBL(cvtINT16toInt(rep.win_x)); + *win_y = FP1616toDBL(cvtINT16toInt(rep.win_y)); + + mods->base = rep.mods.base_mods; + mods->latched = rep.mods.latched_mods; + mods->locked = rep.mods.locked_mods; + mods->effective = mods->base | mods->latched | mods->locked; + + group->base = rep.group.base_group; + group->latched = rep.group.latched_group; + group->locked = rep.group.locked_group; + group->effective = group->base | group->latched | group->locked; + + buttons->mask_len = rep.buttons_len * 4; + buttons->mask = malloc(buttons->mask_len); + if (buttons->mask) + _XRead(dpy, (char*)buttons->mask, buttons->mask_len); + + UnlockDisplay(dpy); + SyncHandle(); + return rep.same_screen; +} diff --git a/src/XIQueryVersion.c b/src/XIQueryVersion.c new file mode 100644 index 0000000..225737f --- /dev/null +++ b/src/XIQueryVersion.c @@ -0,0 +1,90 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Status +XIQueryVersion(Display *dpy, int *major_inout, int *minor_inout) +{ + int rc = Success; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + rc = _xiQueryVersion(dpy, major_inout, minor_inout, info); + + UnlockDisplay(dpy); + SyncHandle(); + return rc; +} + +_X_HIDDEN Status +_xiQueryVersion(Display * dpy, int *major, int *minor, XExtDisplayInfo *info) +{ + xXIQueryVersionReq *req; + xXIQueryVersionReply rep; + + /* This could mean either a malloc problem, or supported + version < XInput_2_0 */ + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + { + XExtensionVersion *ext; + XExtDisplayInfo *info = XInput_find_display(dpy); + + if (!info || !info->data) { + *major = 0; + *minor = 0; + return BadRequest; + } + + ext = ((XInputData*)info->data)->vers; + + *major = ext->major_version; + *minor = ext->minor_version; + return BadRequest; + } + + GetReq(XIQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIQueryVersion; + req->major_version = *major; + req->minor_version = *minor; + + if (!_XReply(dpy, (xReply*)&rep, 0, xTrue)) { + return BadImplementation; + } + *major = rep.major_version; + *minor = rep.minor_version; + return Success; +} diff --git a/src/XISelEv.c b/src/XISelEv.c new file mode 100644 index 0000000..fa7eb54 --- /dev/null +++ b/src/XISelEv.c @@ -0,0 +1,176 @@ +/************************************************************ + +Copyright 2009 Red Hat, Inc. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +*/ + +/*********************************************************************** + * + * XISelectEvent - Select for XI2 events. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XISelectEvents(Display* dpy, Window win, XIEventMask* masks, int num_masks) +{ + XIEventMask *current; + xXISelectEventsReq *req; + xXIEventMask mask; + int i; + int len = 0; + int r = Success; + + XExtDisplayInfo *info = XInput_find_display(dpy); + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) { + r = NoSuchExtension; + goto out; + } + GetReq(XISelectEvents, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_XISelectEvents; + req->win = win; + req->num_masks = num_masks; + + /* get the right length */ + for (i = 0; i < num_masks; i++) + { + len++; + current = &masks[i]; + len += (current->mask_len + 3)/4; + } + + SetReqLen(req, len, len); + + for (i = 0; i < num_masks; i++) + { + char *buff; + current = &masks[i]; + mask.deviceid = current->deviceid; + mask.mask_len = (current->mask_len + 3)/4; + /* masks.mask_len is in bytes, but we need 4-byte units on the wire, + * and they need to be padded with 0 */ + buff = calloc(1, mask.mask_len * 4); + memcpy(buff, current->mask, current->mask_len); + Data(dpy, (char*)&mask, sizeof(xXIEventMask)); + Data(dpy, buff, mask.mask_len * 4); + free(buff); + } + +out: + UnlockDisplay(dpy); + SyncHandle(); + return r; + +} + +XIEventMask* +XIGetSelectedEvents(Display* dpy, Window win, int *num_masks_return) +{ + int i, len = 0; + unsigned char *mask; + XIEventMask *mask_out = NULL; + xXIEventMask *mask_in = NULL, *mi; + xXIGetSelectedEventsReq *req; + xXIGetSelectedEventsReply reply; + XExtDisplayInfo *info = XInput_find_display(dpy); + + *num_masks_return = -1; + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + goto out; + + GetReq(XIGetSelectedEvents, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIGetSelectedEvents; + req->win = win; + + if (!_XReply(dpy, (xReply *) &reply, 0, xFalse)) + goto out; + + if (reply.num_masks == 0) + { + *num_masks_return = 0; + goto out; + } + + mask_in = Xmalloc(reply.length * 4); + if (!mask_in) + goto out; + + _XRead(dpy, (char*)mask_in, reply.length * 4); + + /* Memory layout of the XIEventMask for a 3 mask reply: + * [struct a][struct b][struct c][masks a][masks b][masks c] + */ + len = reply.num_masks * sizeof(XIEventMask); + + for (i = 0, mi = mask_in; i < reply.num_masks; i++) + { + len += mi->mask_len * 4; + mi = (xXIEventMask*)((char*)mi + mi->mask_len * 4); + mi++; + } + + mask_out = Xmalloc(len); + if (!mask_out) + goto out; + + mi = mask_in; + mask = (unsigned char*)&mask_out[reply.num_masks]; + for (i = 0; i < reply.num_masks; i++) + { + mask_out[i].deviceid = mi->deviceid; + mask_out[i].mask_len = mi->mask_len * 4; + mask_out[i].mask = mask; + memcpy(mask_out[i].mask, &mi[1], mask_out[i].mask_len); + mask += mask_out[i].mask_len; + mi = (xXIEventMask*)((char*)mi + mi->mask_len * 4); + mi++; + } + + *num_masks_return = reply.num_masks; + +out: + Xfree(mask_in); + + UnlockDisplay(dpy); + SyncHandle(); + + return mask_out; +} diff --git a/src/XISetCPtr.c b/src/XISetCPtr.c new file mode 100644 index 0000000..8537d8a --- /dev/null +++ b/src/XISetCPtr.c @@ -0,0 +1,65 @@ +/************************************************************ + +Copyright 2007 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XISetClientPointer - Sets the default pointer for a client. This call is + * important for legacy applications that may send ambiguous requests to the + * server where the server has to randomly pick a device. + * Ideally, the window manager will always send a SetClientPointer request + * before the client interacts with an application. + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Status +XISetClientPointer(Display* dpy, Window win, int deviceid) +{ + xXISetClientPointerReq* req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return (NoSuchExtension); + + GetReq(XISetClientPointer, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XISetClientPointer; + req->win = win; + req->deviceid = deviceid; + + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} diff --git a/src/XISetDevFocus.c b/src/XISetDevFocus.c new file mode 100644 index 0000000..6208000 --- /dev/null +++ b/src/XISetDevFocus.c @@ -0,0 +1,59 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Status +XISetFocus(Display *dpy, int deviceid, Window focus, Time time) +{ + xXISetFocusReq *req; + + XExtDisplayInfo *extinfo = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1) + return (NoSuchExtension); + + GetReq(XISetFocus, req); + req->reqType = extinfo->codes->major_opcode; + req->ReqType = X_XISetFocus; + req->deviceid = deviceid; + req->focus = focus; + req->time = time; + + UnlockDisplay(dpy); + SyncHandle(); + return Success; + +} + diff --git a/src/XIWarpPointer.c b/src/XIWarpPointer.c new file mode 100644 index 0000000..426bf3b --- /dev/null +++ b/src/XIWarpPointer.c @@ -0,0 +1,80 @@ +/************************************************************ + +Copyright 2006 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/*********************************************************************** + * + * XIWarpPointer - Warp the pointer of an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XIWarpPointer(Display *dpy, + int deviceid, + Window src_win, + Window dst_win, + double src_x, + double src_y, + unsigned int src_width, + unsigned int src_height, + double dst_x, + double dst_y) +{ + xXIWarpPointerReq *req; + + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1) + return (NoSuchExtension); + + GetReq(XIWarpPointer, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_XIWarpPointer; + req->deviceid = deviceid; + req->src_win = src_win; + req->dst_win = dst_win; + req->src_x = (int)(src_x * 65536.0); + req->src_y = (int)(src_y * 65536.0); + req->src_width = src_width; + req->src_height = src_height; + req->dst_x = (int)(dst_x * 65536.0); + req->dst_y = (int)(dst_y * 65536.0); + + + UnlockDisplay(dpy); + SyncHandle(); + return Success; +} diff --git a/src/XIint.h b/src/XIint.h new file mode 100644 index 0000000..be4eafb --- /dev/null +++ b/src/XIint.h @@ -0,0 +1,85 @@ +/* + * XIint.h - Header definition and support file for the internal + * support routines used by the Xi library. + */ + +#ifndef _XIINT_H_ +#define _XIINT_H_ +#include + +/* inputproto 2.0 still shipped with these defined in the proto headers */ +#ifndef XInput_Initial_Release +/* Indices into the versions[] array (XExtInt.c). Used as a index to + * retrieve the minimum version of XI from _XiCheckExtInit */ +#define Dont_Check 0 +#define XInput_Initial_Release 1 +#define XInput_Add_XDeviceBell 2 +#define XInput_Add_XSetDeviceValuators 3 +#define XInput_Add_XChangeDeviceControl 4 +#define XInput_Add_DevicePresenceNotify 5 +#define XInput_Add_DeviceProperties 6 +#define XInput_2_0 7 +#endif +#define XInput_2_1 8 +#define XInput_2_2 9 + +extern XExtDisplayInfo *XInput_find_display(Display *); + +extern int _XiCheckExtInit(Display *, int, XExtDisplayInfo *); +extern int _XiCheckVersion(XExtDisplayInfo *info, int version_index); + +extern XExtensionVersion *_XiGetExtensionVersion(Display *, _Xconst char *, XExtDisplayInfo *); +extern XExtensionVersion* _XiGetExtensionVersionRequest(Display *dpy, _Xconst char *name, int xi_opcode); +extern Status _xiQueryVersion(Display *dpy, int*, int*, XExtDisplayInfo *); + +extern Status _XiEventToWire( + register Display * /* dpy */, + register XEvent * /* re */, + register xEvent ** /* event */, + register int * /* count */ +); + +typedef struct _XInputData +{ + XEvent data; + XExtensionVersion *vers; +} XInputData; + + +/** + * Returns the next valid memory block of the given size within the block + * previously allocated. + * Use letting pointers inside a struct point to bytes after the same + * struct, e.g. during protocol parsing etc. + * + * Caller is responsible for allocating enough memory. + * + * Example: + * void *ptr; + * struct foo { + * int num_a; + * int num_b; + * int *a; + * int *b; + * } bar; + * + * ptr = malloc(large_enough); + * bar = next_block(&ptr, sizeof(struct foo)); + * bar->num_a = 10; + * bar->num_b = 20; + * bar->a = next_block(&ptr, bar->num_a); + * bar->b = next_block(&ptr, bar->num_b); + */ +static inline void* +next_block(void **ptr, int size) { + void *ret = *ptr; + + if (!*ptr) + return NULL; + + *(unsigned char**)ptr += size; + + return ret; +} + +#endif diff --git a/src/XListDProp.c b/src/XListDProp.c new file mode 100644 index 0000000..8667350 --- /dev/null +++ b/src/XListDProp.c @@ -0,0 +1,82 @@ +/************************************************************ + +Copyright 2008 Peter Hutterer + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the author shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the author. + +*/ + +/*********************************************************************** + * XListDeviceProperties - List an input device's properties. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +Atom* +XListDeviceProperties(Display* dpy, XDevice* dev, int *nprops_return) +{ + xListDevicePropertiesReq *req; + xListDevicePropertiesReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + Atom *props = NULL; + + LockDisplay(dpy); + *nprops_return = 0; + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + goto cleanup; + + GetReq(ListDeviceProperties, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ListDeviceProperties; + req->deviceid = dev->device_id; + + if (!_XReply(dpy, (xReply*)&rep, 0, xFalse)) + goto cleanup; + + if (rep.nAtoms) { + props = (Atom*)Xmalloc(rep.nAtoms * sizeof(Atom)); + if (!props) + { + _XEatData(dpy, rep.nAtoms << 2); + goto cleanup; + } + + _XRead32(dpy, (long*)props, rep.nAtoms << 2); + } + + *nprops_return = rep.nAtoms; + +cleanup: + UnlockDisplay(dpy); + SyncHandle(); + return props; +} + diff --git a/src/XListDev.c b/src/XListDev.c new file mode 100644 index 0000000..6b91238 --- /dev/null +++ b/src/XListDev.c @@ -0,0 +1,274 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XListInputDevices - Request the server to return a list of + * available input devices. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +/* Calculate length field to a multiples of sizeof(XID). XIDs are typedefs + * to ulong and thus may be 8 bytes on some platforms. This can trigger a + * SIGBUS if a class ends up not being 8-aligned (e.g. after XAxisInfo). + */ +static int pad_to_xid(int base_size) +{ + int padsize = sizeof(XID); + + return ((base_size + padsize - 1)/padsize) * padsize; +} + +static int +SizeClassInfo(xAnyClassPtr *any, int num_classes) +{ + int size = 0; + int j; + for (j = 0; j < num_classes; j++) { + switch ((*any)->class) { + case KeyClass: + size += pad_to_xid(sizeof(XKeyInfo)); + break; + case ButtonClass: + size += pad_to_xid(sizeof(XButtonInfo)); + break; + case ValuatorClass: + { + xValuatorInfoPtr v; + + v = (xValuatorInfoPtr) *any; + size += pad_to_xid(sizeof(XValuatorInfo) + + (v->num_axes * sizeof(XAxisInfo))); + break; + } + default: + break; + } + *any = (xAnyClassPtr) ((char *)(*any) + (*any)->length); + } + + return size; +} + +static void +ParseClassInfo(xAnyClassPtr *any, XAnyClassPtr *Any, int num_classes) +{ + int j, k; + + for (j = 0; j < num_classes; j++) { + switch ((*any)->class) { + case KeyClass: + { + XKeyInfoPtr K = (XKeyInfoPtr) *Any; + xKeyInfoPtr k = (xKeyInfoPtr) *any; + + K->class = KeyClass; + K->length = pad_to_xid(sizeof(XKeyInfo)); + K->min_keycode = k->min_keycode; + K->max_keycode = k->max_keycode; + K->num_keys = k->num_keys; + break; + } + case ButtonClass: + { + XButtonInfoPtr B = (XButtonInfoPtr) *Any; + xButtonInfoPtr b = (xButtonInfoPtr) *any; + + B->class = ButtonClass; + B->length = pad_to_xid(sizeof(XButtonInfo)); + B->num_buttons = b->num_buttons; + break; + } + case ValuatorClass: + { + XValuatorInfoPtr V = (XValuatorInfoPtr) *Any; + xValuatorInfoPtr v = (xValuatorInfoPtr) *any; + XAxisInfoPtr A; + xAxisInfoPtr a; + + V->class = ValuatorClass; + V->length = pad_to_xid(sizeof(XValuatorInfo) + + (v->num_axes * sizeof(XAxisInfo))); + V->num_axes = v->num_axes; + V->motion_buffer = v->motion_buffer_size; + V->mode = v->mode; + A = (XAxisInfoPtr) ((char *)V + sizeof(XValuatorInfo)); + V->axes = A; + a = (xAxisInfoPtr) ((char *)(*any) + sizeof(xValuatorInfo)); + for (k = 0; k < (int)v->num_axes; k++, a++, A++) { + A->min_value = a->min_value; + A->max_value = a->max_value; + A->resolution = a->resolution; + } + break; + } + default: + break; + } + *any = (xAnyClassPtr) ((char *)(*any) + (*any)->length); + *Any = (XAnyClassPtr) ((char *)(*Any) + (*Any)->length); + } +} + +XDeviceInfo * +XListInputDevices( + register Display *dpy, + int *ndevices) +{ + int size; + xListInputDevicesReq *req; + xListInputDevicesReply rep; + xDeviceInfo *list, *slist = NULL; + XDeviceInfo *sclist = NULL; + XDeviceInfo *clist = NULL; + xAnyClassPtr any, sav_any; + XAnyClassPtr Any; + char *nptr, *Nptr; + int i; + long rlen; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XDeviceInfo *) NULL); + + GetReq(ListInputDevices, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_ListInputDevices; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return (XDeviceInfo *) NULL; + } + + if ((*ndevices = rep.ndevices)) { /* at least 1 input device */ + size = *ndevices * sizeof(XDeviceInfo); + rlen = rep.length << 2; /* multiply length by 4 */ + list = (xDeviceInfo *) Xmalloc(rlen); + slist = list; + if (!slist) { + _XEatData(dpy, (unsigned long)rlen); + UnlockDisplay(dpy); + SyncHandle(); + return (XDeviceInfo *) NULL; + } + _XRead(dpy, (char *)list, rlen); + + any = (xAnyClassPtr) ((char *)list + (*ndevices * sizeof(xDeviceInfo))); + sav_any = any; + for (i = 0; i < *ndevices; i++, list++) { + size += SizeClassInfo(&any, (int)list->num_classes); + } + + for (i = 0, nptr = (char *)any; i < *ndevices; i++) { + size += *nptr + 1; + nptr += (*nptr + 1); + } + + clist = (XDeviceInfoPtr) Xmalloc(size); + if (!clist) { + XFree((char *)slist); + UnlockDisplay(dpy); + SyncHandle(); + return (XDeviceInfo *) NULL; + } + sclist = clist; + Any = (XAnyClassPtr) ((char *)clist + + (*ndevices * sizeof(XDeviceInfo))); + list = slist; + any = sav_any; + for (i = 0; i < *ndevices; i++, list++, clist++) { + clist->type = list->type; + clist->id = list->id; + clist->use = list->use; + clist->num_classes = list->num_classes; + clist->inputclassinfo = Any; + + ParseClassInfo(&any, &Any, (int)list->num_classes); + } + + clist = sclist; + nptr = (char *)any; + Nptr = (char *)Any; + for (i = 0; i < *ndevices; i++, clist++) { + clist->name = (char *)Nptr; + memcpy(Nptr, nptr + 1, *nptr); + Nptr += (*nptr); + *Nptr++ = '\0'; + nptr += (*nptr + 1); + } + } + + XFree((char *)slist); + UnlockDisplay(dpy); + SyncHandle(); + return (sclist); +} + +/*********************************************************************** + * + * Free the list of input devices. + * + */ + +void +XFreeDeviceList(XDeviceInfo *list) +{ + if (list != NULL) { + XFree((char *)list); + } +} diff --git a/src/XOpenDev.c b/src/XOpenDev.c new file mode 100644 index 0000000..74f18ac --- /dev/null +++ b/src/XOpenDev.c @@ -0,0 +1,109 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XOpenDevice - Request the server to open and extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XDevice * +XOpenDevice( + register Display *dpy, + register XID id) +{ + register long rlen; /* raw length */ + xOpenDeviceReq *req; + xOpenDeviceReply rep; + XDevice *dev; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XDevice *) NoSuchExtension); + + GetReq(OpenDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_OpenDevice; + req->deviceid = id; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return (XDevice *) NULL; + } + + rlen = rep.length << 2; + dev = (XDevice *) Xmalloc(sizeof(XDevice) + rep.num_classes * + sizeof(XInputClassInfo)); + if (dev) { + int dlen; /* data length */ + + dev->device_id = req->deviceid; + dev->num_classes = rep.num_classes; + dev->classes = (XInputClassInfo *) ((char *)dev + sizeof(XDevice)); + dlen = rep.num_classes * sizeof(xInputClassInfo); + _XRead(dpy, (char *)dev->classes, dlen); + /* could be padding that we still need to eat (yummy!) */ + if (rlen - dlen > 0) + _XEatData(dpy, (unsigned long)rlen - dlen); + } else + _XEatData(dpy, (unsigned long)rlen); + + UnlockDisplay(dpy); + SyncHandle(); + return (dev); +} diff --git a/src/XQueryDv.c b/src/XQueryDv.c new file mode 100644 index 0000000..24d4e4e --- /dev/null +++ b/src/XQueryDv.c @@ -0,0 +1,187 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XQueryDeviceState - Query the state of an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +XDeviceState * +XQueryDeviceState( + register Display *dpy, + XDevice *dev) +{ + int i, j; + int rlen; + int size = 0; + xQueryDeviceStateReq *req; + xQueryDeviceStateReply rep; + XDeviceState *state = NULL; + XInputClass *any, *Any; + char *data = NULL; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return ((XDeviceState *) NoSuchExtension); + + GetReq(QueryDeviceState, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_QueryDeviceState; + req->deviceid = dev->device_id; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) + goto out; + + rlen = rep.length << 2; + if (rlen > 0) { + data = Xmalloc(rlen); + if (!data) { + _XEatData(dpy, (unsigned long)rlen); + goto out; + } + _XRead(dpy, data, rlen); + + for (i = 0, any = (XInputClass *) data; i < (int)rep.num_classes; i++) { + switch (any->class) { + case KeyClass: + size += sizeof(XKeyState); + break; + case ButtonClass: + size += sizeof(XButtonState); + break; + case ValuatorClass: + { + xValuatorState *v = (xValuatorState *) any; + size += (sizeof(XValuatorState) + + (v->num_valuators * sizeof(int))); + } + break; + } + any = (XInputClass *) ((char *)any + any->length); + } + state = (XDeviceState *) Xmalloc(size + sizeof(XDeviceState)); + if (!state) + goto out; + + state->device_id = dev->device_id; + state->num_classes = rep.num_classes; + state->data = (XInputClass *) (state + 1); + + Any = state->data; + for (i = 0, any = (XInputClass *) data; i < (int)rep.num_classes; i++) { + switch (any->class) { + case KeyClass: + { + xKeyState *k = (xKeyState *) any; + XKeyState *K = (XKeyState *) Any; + + K->class = k->class; + K->length = sizeof(XKeyState); + K->num_keys = k->num_keys; + memcpy((char *)&K->keys[0], (char *)&k->keys[0], 32); + Any = (XInputClass *) (K + 1); + } + break; + case ButtonClass: + { + xButtonState *b = (xButtonState *) any; + XButtonState *B = (XButtonState *) Any; + + B->class = b->class; + B->length = sizeof(XButtonState); + B->num_buttons = b->num_buttons; + memcpy((char *)&B->buttons[0], (char *)&b->buttons[0], 32); + Any = (XInputClass *) (B + 1); + } + break; + case ValuatorClass: + { + xValuatorState *v = (xValuatorState *) any; + XValuatorState *V = (XValuatorState *) Any; + CARD32 *valuators = (CARD32 *) (v + 1); + + V->class = v->class; + V->length = sizeof(XValuatorState) + + v->num_valuators * sizeof(int); + V->num_valuators = v->num_valuators; + V->mode = v->mode; + Any = (XInputClass *) (V + 1); + V->valuators = (int *)Any; + for (j = 0; j < (int)V->num_valuators; j++) + *(V->valuators + j) = *valuators++; + Any = (XInputClass *) ((char *)Any + + V->num_valuators * sizeof(int)); + } + break; + } + any = (XInputClass *) ((char *)any + any->length); + } + } +out: + Xfree(data); + + UnlockDisplay(dpy); + SyncHandle(); + return (state); +} + +void +XFreeDeviceState(XDeviceState *list) +{ + XFree((char *)list); +} diff --git a/src/XSelect.c b/src/XSelect.c new file mode 100644 index 0000000..ec5ba57 --- /dev/null +++ b/src/XSelect.c @@ -0,0 +1,94 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSelectExtensionEvent - Select input from an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XSelectExtensionEvent( + register Display *dpy, + Window w, + XEventClass *event_list, + int count) +{ + register xSelectExtensionEventReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(SelectExtensionEvent, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_SelectExtensionEvent; + req->window = w; + req->count = count; + req->length += count; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + count <<= 2; + Data32(dpy, (long *)event_list, count); + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XSetBMap.c b/src/XSetBMap.c new file mode 100644 index 0000000..8aea9fb --- /dev/null +++ b/src/XSetBMap.c @@ -0,0 +1,92 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSetDeviceButtonMapping - Set the button mapping of an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +/* returns either DeviceMappingSuccess or DeviceMappingBusy */ + +int +XSetDeviceButtonMapping( + register Display *dpy, + XDevice *device, + unsigned char map[], + int nmap) +{ + register xSetDeviceButtonMappingReq *req; + xSetDeviceButtonMappingReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(SetDeviceButtonMapping, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SetDeviceButtonMapping; + req->map_length = nmap; + req->length += (nmap + 3) >> 2; + req->deviceid = device->device_id; + + Data(dpy, (char *)map, (long)nmap); /* note that map is char[] */ + if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) /* suppress error */ + rep.status = MappingSuccess; + UnlockDisplay(dpy); + SyncHandle(); + return ((int)rep.status); +} diff --git a/src/XSetDVal.c b/src/XSetDVal.c new file mode 100644 index 0000000..431887b --- /dev/null +++ b/src/XSetDVal.c @@ -0,0 +1,99 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSetDeviceValuators - Set the value of valuators on an extension input + * device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XSetDeviceValuators( + register Display *dpy, + XDevice *dev, + int *valuators, + int first_valuator, + int num_valuators) +{ + xSetDeviceValuatorsReq *req; + xSetDeviceValuatorsReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Add_XSetDeviceValuators, info) == -1) + return (NoSuchExtension); + + GetReq(SetDeviceValuators, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SetDeviceValuators; + req->deviceid = dev->device_id; + req->first_valuator = first_valuator; + req->num_valuators = num_valuators; + req->length += num_valuators; + + /* note: Data is a macro that uses its arguments multiple + * times, so "nvalues" is changed in a separate assignment + * statement */ + + num_valuators <<= 2; + Data(dpy, (char *)valuators, num_valuators); + + (void)_XReply(dpy, (xReply *) & rep, 0, xTrue); + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); +} diff --git a/src/XSetMMap.c b/src/XSetMMap.c new file mode 100644 index 0000000..7361f62 --- /dev/null +++ b/src/XSetMMap.c @@ -0,0 +1,92 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSetDeviceModifierMapping - set the modifier map of an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XSetDeviceModifierMapping( + register Display *dpy, + XDevice *dev, + XModifierKeymap *modmap) +{ + int mapSize = modmap->max_keypermod << 3; /* 8 modifiers */ + xSetDeviceModifierMappingReq *req; + xSetDeviceModifierMappingReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReqExtra(SetDeviceModifierMapping, mapSize, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SetDeviceModifierMapping; + req->deviceid = dev->device_id; + req->numKeyPerModifier = modmap->max_keypermod; + memcpy((char *)&req[1], modmap->modifiermap, mapSize); + + (void)_XReply(dpy, (xReply *) & rep, + (sizeof(xSetDeviceModifierMappingReply) - + sizeof(xReply)) >> 2, xTrue); + + UnlockDisplay(dpy); + SyncHandle(); + return (rep.success); +} diff --git a/src/XSetMode.c b/src/XSetMode.c new file mode 100644 index 0000000..9204a8e --- /dev/null +++ b/src/XSetMode.c @@ -0,0 +1,87 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSetDeviceMode - Set the mode of an extension input device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XSetDeviceMode( + register Display *dpy, + XDevice *dev, + int mode) +{ + xSetDeviceModeReq *req; + xSetDeviceModeReply rep; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(SetDeviceMode, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SetDeviceMode; + req->deviceid = dev->device_id; + req->mode = mode; + + (void)_XReply(dpy, (xReply *) & rep, 0, xTrue); + UnlockDisplay(dpy); + SyncHandle(); + return (rep.status); +} diff --git a/src/XSndExEv.c b/src/XSndExEv.c new file mode 100644 index 0000000..5c0775f --- /dev/null +++ b/src/XSndExEv.c @@ -0,0 +1,124 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSendExtensionEvent - send an extension event to a client. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +/* Xlib's wire_vec is defined for a single event only, libXi may return + * multiple events. + */ +typedef Status (*ext_event_to_wire)(Display*, XEvent*, xEvent**, int*); + +Status +XSendExtensionEvent( + register Display *dpy, + XDevice *dev, + Window dest, + Bool prop, + int count, + XEventClass *list, + XEvent *event) +{ + int num_events; + int ev_size; + xSendExtensionEventReq *req; + xEvent *ev; + ext_event_to_wire *fp; + Status status; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + /* call through display to find proper conversion routine */ + + fp = (ext_event_to_wire*)&dpy->wire_vec[event->type & 0177]; + if (*fp == NULL) + *fp = _XiEventToWire; + status = (*fp) (dpy, event, &ev, &num_events); + + if (status) { + GetReq(SendExtensionEvent, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SendExtensionEvent; + req->deviceid = dev->device_id; + req->destination = dest; + req->propagate = prop; + req->count = count; + req->num_events = num_events; + ev_size = num_events * sizeof(xEvent); + req->length += (count + (ev_size >> 2)); + + /* note: Data is a macro that uses its arguments multiple + * times, so "count" is changed in a separate assignment + * statement. Any extra events must be sent before the event + * list, in order to ensure quad alignment. */ + + Data(dpy, (char *)ev, ev_size); + + count <<= 2; + Data32(dpy, (long *)list, count); + XFree((char *)ev); + } + + UnlockDisplay(dpy); + SyncHandle(); + return (status); +} diff --git a/src/XStFocus.c b/src/XStFocus.c new file mode 100644 index 0000000..abc0bdc --- /dev/null +++ b/src/XStFocus.c @@ -0,0 +1,89 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XSetDeviceFocus - Set the focus of an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XSetDeviceFocus( + register Display *dpy, + XDevice *dev, + Window focus, + int revert_to, + Time time) +{ + xSetDeviceFocusReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(SetDeviceFocus, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_SetDeviceFocus; + req->device = dev->device_id; + req->focus = focus; + req->revertTo = revert_to; + req->time = time; + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XUngrDev.c b/src/XUngrDev.c new file mode 100644 index 0000000..2d12718 --- /dev/null +++ b/src/XUngrDev.c @@ -0,0 +1,86 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XUngrabDevice - Ungrab an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XUngrabDevice( + register Display *dpy, + XDevice *dev, + Time time) +{ + register xUngrabDeviceReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + + GetReq(UngrabDevice, req); + req->reqType = info->codes->major_opcode; + req->ReqType = X_UngrabDevice; + + req->deviceid = dev->device_id; + req->time = time; + + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XUngrDvB.c b/src/XUngrDvB.c new file mode 100644 index 0000000..baa12fb --- /dev/null +++ b/src/XUngrDvB.c @@ -0,0 +1,93 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XUngrabDeviceButton - Ungrab a button on an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XUngrabDeviceButton( + register Display *dpy, + XDevice *dev, + unsigned int button, /* CARD8 */ + unsigned int modifiers, /* CARD16 */ + XDevice *modifier_dev, + Window grab_window) +{ + register xUngrabDeviceButtonReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(UngrabDeviceButton, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_UngrabDeviceButton; + req->grabbed_device = dev->device_id; + req->button = button; + req->modifiers = modifiers; + if (modifier_dev) + req->modifier_device = modifier_dev->device_id; + else + req->modifier_device = UseXKeyboard; + req->grabWindow = grab_window; + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/src/XUngrDvK.c b/src/XUngrDvK.c new file mode 100644 index 0000000..cab45a4 --- /dev/null +++ b/src/XUngrDvK.c @@ -0,0 +1,93 @@ +/************************************************************ + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Hewlett-Packard not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +/*********************************************************************** + * + * XUngrabDeviceKey - Ungrab a key on an extension device. + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include "XIint.h" + +int +XUngrabDeviceKey( + register Display *dpy, + XDevice *dev, + unsigned int key, /* CARD8 */ + unsigned int modifiers, /* CARD16 */ + XDevice *modifier_dev, + Window grab_window) +{ + register xUngrabDeviceKeyReq *req; + XExtDisplayInfo *info = XInput_find_display(dpy); + + LockDisplay(dpy); + if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) + return (NoSuchExtension); + GetReq(UngrabDeviceKey, req); + + req->reqType = info->codes->major_opcode; + req->ReqType = X_UngrabDeviceKey; + req->grabbed_device = dev->device_id; + req->key = key; + req->modifiers = modifiers; + if (modifier_dev) + req->modifier_device = modifier_dev->device_id; + else + req->modifier_device = UseXKeyboard; + req->grabWindow = grab_window; + UnlockDisplay(dpy); + SyncHandle(); + return (Success); +} diff --git a/xi.pc.in b/xi.pc.in new file mode 100644 index 0000000..3f05dd8 --- /dev/null +++ b/xi.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Xi +Description: X Input Extension Library +Version: @VERSION@ +Requires: inputproto +Requires.private: x11 xext +Cflags: -I${includedir} +Libs: -L${libdir} -lXi -- 2.7.4