summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applewmproto/.gitignore78
-rw-r--r--applewmproto/COPYING27
-rw-r--r--applewmproto/Makefile.am19
-rw-r--r--applewmproto/README31
-rw-r--r--applewmproto/applewmconst.h107
-rw-r--r--applewmproto/applewmproto.h293
-rw-r--r--applewmproto/applewmproto.pc.in9
-rwxr-xr-xapplewmproto/autogen.sh12
-rw-r--r--applewmproto/configure.ac13
-rw-r--r--bigreqsproto/.gitignore78
-rw-r--r--bigreqsproto/COPYING21
-rw-r--r--bigreqsproto/Makefile.am20
-rw-r--r--bigreqsproto/README30
-rwxr-xr-xbigreqsproto/autogen.sh12
-rw-r--r--bigreqsproto/bigreqsproto.h67
-rw-r--r--bigreqsproto/bigreqsproto.pc.in9
-rw-r--r--bigreqsproto/bigreqstr.h3
-rw-r--r--bigreqsproto/configure.ac13
-rw-r--r--calibrateproto/Makefile.am39
-rwxr-xr-xcalibrateproto/autogen.sh12
-rw-r--r--calibrateproto/configure.ac6
-rw-r--r--calibrateproto/xcalibrateproto.h120
-rw-r--r--calibrateproto/xcalibrateproto.pc.in9
-rw-r--r--calibrateproto/xcalibratewire.h44
-rw-r--r--compositeproto/.gitignore78
-rw-r--r--compositeproto/AUTHORS1
-rw-r--r--compositeproto/COPYING41
-rw-r--r--compositeproto/Makefile.am43
-rw-r--r--compositeproto/README33
-rwxr-xr-xcompositeproto/autogen.sh12
-rw-r--r--compositeproto/composite.h71
-rw-r--r--compositeproto/compositeproto.h192
-rw-r--r--compositeproto/compositeproto.pc.in9
-rw-r--r--compositeproto/compositeproto.txt339
-rw-r--r--compositeproto/configure.ac37
-rw-r--r--damageproto/.gitignore78
-rw-r--r--damageproto/AUTHORS2
-rw-r--r--damageproto/COPYING23
-rw-r--r--damageproto/Makefile.am43
-rw-r--r--damageproto/NEWS2
-rw-r--r--damageproto/README34
-rwxr-xr-xdamageproto/autogen.sh12
-rw-r--r--damageproto/configure.ac37
-rw-r--r--damageproto/damageproto.h158
-rw-r--r--damageproto/damageproto.pc.in9
-rw-r--r--damageproto/damageproto.txt222
-rw-r--r--damageproto/damagewire.h56
-rw-r--r--dmxproto/.gitignore78
-rw-r--r--dmxproto/COPYING24
-rw-r--r--dmxproto/Makefile.am20
-rw-r--r--dmxproto/README31
-rwxr-xr-xdmxproto/autogen.sh12
-rw-r--r--dmxproto/configure.ac13
-rw-r--r--dmxproto/dmx.h68
-rw-r--r--dmxproto/dmxproto.h445
-rw-r--r--dmxproto/dmxproto.pc.in9
-rw-r--r--dri2proto/.gitignore78
-rw-r--r--dri2proto/COPYING29
-rw-r--r--dri2proto/Makefile.am20
-rw-r--r--dri2proto/README30
-rwxr-xr-xdri2proto/autogen.sh12
-rw-r--r--dri2proto/configure.ac13
-rw-r--r--dri2proto/dri2proto.h317
-rw-r--r--dri2proto/dri2proto.pc.in9
-rw-r--r--dri2proto/dri2proto.txt873
-rw-r--r--dri2proto/dri2tokens.h55
-rw-r--r--evieproto/.gitignore78
-rw-r--r--evieproto/COPYING20
-rw-r--r--evieproto/Makefile.am21
-rw-r--r--evieproto/README31
-rw-r--r--evieproto/Xeviestr.h3
-rwxr-xr-xevieproto/autogen.sh12
-rw-r--r--evieproto/configure.ac13
-rw-r--r--evieproto/evieproto.h156
-rw-r--r--evieproto/evieproto.pc.in9
-rw-r--r--fixesproto/.gitignore78
-rw-r--r--fixesproto/AUTHORS1
-rw-r--r--fixesproto/COPYING41
-rw-r--r--fixesproto/Makefile.am43
-rw-r--r--fixesproto/README31
-rwxr-xr-xfixesproto/autogen.sh12
-rw-r--r--fixesproto/configure.ac37
-rw-r--r--fixesproto/fixesproto.pc.in10
-rw-r--r--fixesproto/fixesproto.txt577
-rw-r--r--fixesproto/xfixesproto.h518
-rw-r--r--fixesproto/xfixeswire.h127
-rw-r--r--fontcacheproto/.gitignore78
-rw-r--r--fontcacheproto/COPYING24
-rw-r--r--fontcacheproto/Makefile.am22
-rw-r--r--fontcacheproto/README30
-rwxr-xr-xfontcacheproto/autogen.sh12
-rw-r--r--fontcacheproto/configure.ac13
-rw-r--r--fontcacheproto/fontcache.h106
-rw-r--r--fontcacheproto/fontcacheP.h40
-rw-r--r--fontcacheproto/fontcacheproto.pc.in9
-rw-r--r--fontcacheproto/fontcachstr.h130
-rw-r--r--fontsproto/.gitignore78
-rw-r--r--fontsproto/COPYING86
-rw-r--r--fontsproto/FS.h129
-rw-r--r--fontsproto/FSproto.h814
-rw-r--r--fontsproto/Makefile.am24
-rw-r--r--fontsproto/README25
-rwxr-xr-xfontsproto/autogen.sh12
-rw-r--r--fontsproto/configure.ac13
-rw-r--r--fontsproto/font.h166
-rw-r--r--fontsproto/fontproto.h91
-rw-r--r--fontsproto/fontsproto.pc.in9
-rw-r--r--fontsproto/fontstruct.h293
-rw-r--r--fontsproto/fsmasks.h97
-rw-r--r--glproto/.gitignore78
-rw-r--r--glproto/COPYING27
-rw-r--r--glproto/Makefile.am26
-rw-r--r--glproto/README30
-rwxr-xr-xglproto/autogen.sh12
-rw-r--r--glproto/configure.ac13
-rw-r--r--glproto/glcore.h181
-rw-r--r--glproto/glproto.pc.in9
-rw-r--r--glproto/glxint.h137
-rw-r--r--glproto/glxmd.h54
-rw-r--r--glproto/glxproto.h2613
-rw-r--r--glproto/glxtokens.h285
-rw-r--r--inputproto/.gitignore78
-rw-r--r--inputproto/COPYING63
-rw-r--r--inputproto/Makefile.am24
-rw-r--r--inputproto/README30
-rw-r--r--inputproto/XI.h308
-rw-r--r--inputproto/XI2.h181
-rw-r--r--inputproto/XI2proto.h976
-rw-r--r--inputproto/XI2proto.txt1677
-rw-r--r--inputproto/XIproto.h1756
-rw-r--r--inputproto/XIproto.txt2542
-rwxr-xr-xinputproto/autogen.sh12
-rw-r--r--inputproto/configure.ac13
-rw-r--r--inputproto/inputproto.pc.in9
-rw-r--r--kbproto/.gitignore78
-rw-r--r--kbproto/COPYING22
-rw-r--r--kbproto/Makefile.am23
-rw-r--r--kbproto/README30
-rw-r--r--kbproto/XKB.h788
-rw-r--r--kbproto/XKBgeom.h659
-rw-r--r--kbproto/XKBproto.h1282
-rw-r--r--kbproto/XKBsrv.h1187
-rw-r--r--kbproto/XKBstr.h614
-rwxr-xr-xkbproto/autogen.sh12
-rw-r--r--kbproto/configure.ac13
-rw-r--r--kbproto/kbproto.pc.in9
146 files changed, 24710 insertions, 0 deletions
diff --git a/applewmproto/.gitignore b/applewmproto/.gitignore
new file mode 100644
index 0000000..f18e437
--- /dev/null
+++ b/applewmproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for applewmproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/applewmproto/COPYING b/applewmproto/COPYING
new file mode 100644
index 0000000..be403fd
--- /dev/null
+++ b/applewmproto/COPYING
@@ -0,0 +1,27 @@
+/**************************************************************************
+
+Copyright (c) 2002-2009 Apple, 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, sub license, 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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/applewmproto/Makefile.am b/applewmproto/Makefile.am
new file mode 100644
index 0000000..63db4c7
--- /dev/null
+++ b/applewmproto/Makefile.am
@@ -0,0 +1,19 @@
+applewmdir = $(includedir)/X11/extensions
+applewm_HEADERS = \
+ applewmconst.h \
+ applewmproto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = applewmproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+INSTALL:
+ $(INSTALL_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/applewmproto/README b/applewmproto/README
new file mode 100644
index 0000000..78e3c08
--- /dev/null
+++ b/applewmproto/README
@@ -0,0 +1,31 @@
+ Apple Rootless Window Management Extension
+
+This extension defines a protcol that allows X window managers
+to better interact with the Mac OS X Aqua user interface when
+running X11 in a rootless mode.
+
+Extension name: Apple-WM
+
+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/proto/applewmproto
+
+ http://cgit.freedesktop.org/xorg/proto/applewmproto
+
+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/applewmproto/applewmconst.h b/applewmproto/applewmconst.h
new file mode 100644
index 0000000..5088804
--- /dev/null
+++ b/applewmproto/applewmconst.h
@@ -0,0 +1,107 @@
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, 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, sub license, 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+#ifndef _APPLEWMCONST_H_
+#define _APPLEWMCONST_H_
+
+/* Events */
+#define AppleWMControllerNotify 0
+#define AppleWMActivationNotify 1
+#define AppleWMPasteboardNotify 2
+#define AppleWMNumberEvents 3
+
+#define AppleWMControllerNotifyMask (1L << 0)
+#define AppleWMActivationNotifyMask (1L << 1)
+#define AppleWMPasteboardNotifyMask (1L << 2)
+
+/* "Kinds" of ControllerNotify events */
+#define AppleWMMinimizeWindow 0
+#define AppleWMZoomWindow 1
+#define AppleWMCloseWindow 2
+#define AppleWMBringAllToFront 3
+#define AppleWMHideWindow 4
+#define AppleWMHideAll 5
+#define AppleWMShowAll 6
+#define AppleWMWindowMenuItem 9
+#define AppleWMWindowMenuNotify 10
+#define AppleWMNextWindow 11
+#define AppleWMPreviousWindow 12
+
+/* "Kinds" of ActivationNotify events */
+#define AppleWMIsActive 0
+#define AppleWMIsInactive 1
+#define AppleWMReloadPreferences 2
+
+/* "Kinds" of PasteboardNotify events */
+#define AppleWMCopyToPasteboard 0
+
+/* Errors */
+#define AppleWMClientNotLocal 0
+#define AppleWMOperationNotSupported 1
+#define AppleWMNumberErrors (AppleWMOperationNotSupported + 1)
+
+/* Window level ids */
+#define AppleWMWindowLevelNormal 0
+#define AppleWMWindowLevelFloating 1
+#define AppleWMWindowLevelTornOff 2
+#define AppleWMWindowLevelDock 3
+#define AppleWMWindowLevelDesktop 4
+#define AppleWMNumWindowLevels 5
+
+/* Possible value for frame_rect argument to XAppleWMFrameGetRect() */
+#define AppleWMFrameRectTitleBar 1
+#define AppleWMFrameRectTracking 2
+#define AppleWMFrameRectGrowBox 3
+
+/* Window frame classes */
+#define AppleWMFrameClassDocument 1 << 0
+#define AppleWMFrameClassDialog 1 << 1
+#define AppleWMFrameClassModalDialog 1 << 2
+#define AppleWMFrameClassSystemModalDialog 1 << 3
+#define AppleWMFrameClassUtility 1 << 4
+#define AppleWMFrameClassToolbar 1 << 5
+#define AppleWMFrameClassMenu 1 << 6
+#define AppleWMFrameClassSplash 1 << 7
+#define AppleWMFrameClassBorderless 1 << 8
+
+/* Window frame attributes */
+#define AppleWMFrameActive 0x0001
+#define AppleWMFrameUrgent 0x0002
+#define AppleWMFrameTitle 0x0004
+#define AppleWMFramePrelight 0x0008
+#define AppleWMFrameShaded 0x0010
+#define AppleWMFrameCloseBox 0x0100
+#define AppleWMFrameCollapseBox 0x0200
+#define AppleWMFrameZoomBox 0x0400
+#define AppleWMFrameAnyBox 0x0700
+#define AppleWMFrameCloseBoxClicked 0x0800
+#define AppleWMFrameCollapseBoxClicked 0x1000
+#define AppleWMFrameZoomBoxClicked 0x2000
+#define AppleWMFrameAnyBoxClicked 0x3800
+#define AppleWMFrameGrowBox 0x4000
+
+#endif /* _APPLEWMCONST_H_ */
diff --git a/applewmproto/applewmproto.h b/applewmproto/applewmproto.h
new file mode 100644
index 0000000..d8be4e6
--- /dev/null
+++ b/applewmproto/applewmproto.h
@@ -0,0 +1,293 @@
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, 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, sub license, 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+#ifndef _APPLEWMPROTO_H_
+#define _APPLEWMPROTO_H_
+
+#include <X11/extensions/applewmconst.h>
+#include <X11/X.h>
+#include <X11/Xmd.h>
+
+#define APPLEWMNAME "Apple-WM"
+
+#define APPLE_WM_MAJOR_VERSION 1 /* current version numbers */
+#define APPLE_WM_MINOR_VERSION 3
+#define APPLE_WM_PATCH_VERSION 0
+
+#define X_AppleWMQueryVersion 0
+#define X_AppleWMFrameGetRect 1
+#define X_AppleWMFrameHitTest 2
+#define X_AppleWMFrameDraw 3
+#define X_AppleWMDisableUpdate 4
+#define X_AppleWMReenableUpdate 5
+#define X_AppleWMSelectInput 6
+#define X_AppleWMSetWindowMenuCheck 7
+#define X_AppleWMSetFrontProcess 8
+#define X_AppleWMSetWindowLevel 9
+#define X_AppleWMSetCanQuit 10
+#define X_AppleWMSetWindowMenu 11
+#define X_AppleWMSendPSN 12
+#define X_AppleWMAttachTransient 13
+
+/* For the purpose of the structure definitions in this file,
+we must redefine the following types in terms of Xmd.h's types, which may
+include bit fields. All of these are #undef'd at the end of this file,
+restoring the definitions in X.h. */
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+typedef struct _AppleWMQueryVersion {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMQueryVersion */
+ CARD16 length B16;
+} xAppleWMQueryVersionReq;
+#define sz_xAppleWMQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of WM protocol */
+ CARD16 minorVersion B16; /* minor version of WM protocol */
+ CARD32 patchVersion B32; /* patch version of WM protocol */
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleWMQueryVersionReply;
+#define sz_xAppleWMQueryVersionReply 32
+
+typedef struct _AppleWMDisableUpdate {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMDisableUpdate */
+ CARD16 length B16;
+ CARD32 screen B32;
+} xAppleWMDisableUpdateReq;
+#define sz_xAppleWMDisableUpdateReq 8
+
+typedef struct _AppleWMReenableUpdate {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMReenableUpdate */
+ CARD16 length B16;
+ CARD32 screen B32;
+} xAppleWMReenableUpdateReq;
+#define sz_xAppleWMReenableUpdateReq 8
+
+typedef struct _AppleWMSelectInput {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSelectInput */
+ CARD16 length B16;
+ CARD32 mask B32;
+} xAppleWMSelectInputReq;
+#define sz_xAppleWMSelectInputReq 8
+
+typedef struct _AppleWMNotify {
+ BYTE type; /* always eventBase + event type */
+ BYTE kind;
+ CARD16 sequenceNumber B16;
+ Time time B32; /* time of change */
+ CARD16 pad1 B16;
+ CARD32 arg B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleWMNotifyEvent;
+#define sz_xAppleWMNotifyEvent 32
+
+typedef struct _AppleWMSetWindowMenu {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSetWindowMenu */
+ CARD16 length B16;
+ CARD16 nitems B16;
+ CARD16 pad1 B16;
+} xAppleWMSetWindowMenuReq;
+#define sz_xAppleWMSetWindowMenuReq 8
+
+typedef struct _AppleWMSetWindowMenuCheck {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSetWindowMenuCheck */
+ CARD16 length B16;
+ CARD32 index;
+} xAppleWMSetWindowMenuCheckReq;
+#define sz_xAppleWMSetWindowMenuCheckReq 8
+
+typedef struct _AppleWMSetFrontProcess {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSetFrontProcess */
+ CARD16 length B16;
+} xAppleWMSetFrontProcessReq;
+#define sz_xAppleWMSetFrontProcessReq 4
+
+typedef struct _AppleWMSetWindowLevel {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSetWindowLevel */
+ CARD16 length B16;
+ CARD32 window;
+ CARD32 level;
+} xAppleWMSetWindowLevelReq;
+#define sz_xAppleWMSetWindowLevelReq 12
+
+typedef struct _AppleWMSendPSN {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSendPSN */
+ CARD16 length B16;
+ CARD32 psn_hi;
+ CARD32 psn_lo;
+} xAppleWMSendPSNReq;
+#define sz_xAppleWMSendPSNReq 12
+
+typedef struct _AppleWMAttachTransient {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMAttachTransient */
+ CARD16 length B16;
+ CARD32 child;
+ CARD32 parent;
+} xAppleWMAttachTransientReq;
+#define sz_xAppleWMAttachTransientReq 12
+
+typedef struct _AppleWMSetCanQuit {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMSetCanQuit */
+ CARD16 length B16;
+ CARD32 state;
+} xAppleWMSetCanQuitReq;
+#define sz_xAppleWMSetCanQuitReq 8
+
+typedef struct _AppleWMFrameGetRect {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMFrameGetRect */
+ CARD16 length B16;
+ CARD16 frame_class B16;
+ CARD16 frame_rect B16;
+ CARD16 ix B16;
+ CARD16 iy B16;
+ CARD16 iw B16;
+ CARD16 ih B16;
+ CARD16 ox B16;
+ CARD16 oy B16;
+ CARD16 ow B16;
+ CARD16 oh B16;
+} xAppleWMFrameGetRectReq;
+#define sz_xAppleWMFrameGetRectReq 24
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 x B16;
+ CARD16 y B16;
+ CARD16 w B16;
+ CARD16 h B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleWMFrameGetRectReply;
+#define sz_xAppleWMFrameGetRectReply 32
+
+typedef struct _AppleWMFrameHitTest {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMFrameHitTest */
+ CARD16 length B16;
+ CARD16 frame_class B16;
+ CARD16 pad1 B16;
+ CARD16 px B16;
+ CARD16 py B16;
+ CARD16 ix B16;
+ CARD16 iy B16;
+ CARD16 iw B16;
+ CARD16 ih B16;
+ CARD16 ox B16;
+ CARD16 oy B16;
+ CARD16 ow B16;
+ CARD16 oh B16;
+} xAppleWMFrameHitTestReq;
+#define sz_xAppleWMFrameHitTestReq 28
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 ret B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleWMFrameHitTestReply;
+#define sz_xAppleWMFrameHitTestReply 32
+
+typedef struct _AppleWMFrameDraw {
+ CARD8 reqType; /* always WMReqCode */
+ CARD8 wmReqType; /* always X_AppleWMFrameDraw */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 window B32;
+ CARD16 frame_class B16;
+ CARD16 frame_attr B16;
+ CARD16 ix B16;
+ CARD16 iy B16;
+ CARD16 iw B16;
+ CARD16 ih B16;
+ CARD16 ox B16;
+ CARD16 oy B16;
+ CARD16 ow B16;
+ CARD16 oh B16;
+ CARD32 title_length B32;
+} xAppleWMFrameDrawReq;
+#define sz_xAppleWMFrameDrawReq 36
+
+/* restore these definitions back to the typedefs in X.h */
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* _APPLEWMPROTO_H_ */
diff --git a/applewmproto/applewmproto.pc.in b/applewmproto/applewmproto.pc.in
new file mode 100644
index 0000000..6ec1c48
--- /dev/null
+++ b/applewmproto/applewmproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: AppleWMProto
+Description: AppleWM extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/applewmproto/autogen.sh b/applewmproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/applewmproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/applewmproto/configure.ac b/applewmproto/configure.ac
new file mode 100644
index 0000000..84be89b
--- /dev/null
+++ b/applewmproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([AppleWMProto], [1.4.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ applewmproto.pc])
diff --git a/bigreqsproto/.gitignore b/bigreqsproto/.gitignore
new file mode 100644
index 0000000..9edb463
--- /dev/null
+++ b/bigreqsproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for bigreqsproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/bigreqsproto/COPYING b/bigreqsproto/COPYING
new file mode 100644
index 0000000..142f2fa
--- /dev/null
+++ b/bigreqsproto/COPYING
@@ -0,0 +1,21 @@
+Copyright 1992, 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.
diff --git a/bigreqsproto/Makefile.am b/bigreqsproto/Makefile.am
new file mode 100644
index 0000000..45960ba
--- /dev/null
+++ b/bigreqsproto/Makefile.am
@@ -0,0 +1,20 @@
+bigreqsdir = $(includedir)/X11/extensions
+bigreqs_HEADERS = \
+ bigreqsproto.h \
+ bigreqstr.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = bigreqsproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/bigreqsproto/README b/bigreqsproto/README
new file mode 100644
index 0000000..f8b14de
--- /dev/null
+++ b/bigreqsproto/README
@@ -0,0 +1,30 @@
+ Big Requests Extension
+
+This extension defines a protocol to enable the use of requests
+that exceed 262140 bytes in length.
+
+Extension name: BIG-REQUESTS
+
+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/proto/bigreqsproto
+
+ http://cgit.freedesktop.org/xorg/proto/bigreqsproto
+
+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/bigreqsproto/autogen.sh b/bigreqsproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/bigreqsproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/bigreqsproto/bigreqsproto.h b/bigreqsproto/bigreqsproto.h
new file mode 100644
index 0000000..bd0f8e5
--- /dev/null
+++ b/bigreqsproto/bigreqsproto.h
@@ -0,0 +1,67 @@
+/*
+
+Copyright 1992, 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.
+
+*/
+
+#ifndef _BIGREQSPROTO_H_
+#define _BIGREQSPROTO_H_
+
+#define X_BigReqEnable 0
+
+#define XBigReqNumberEvents 0
+
+#define XBigReqNumberErrors 0
+
+#define XBigReqExtensionName "BIG-REQUESTS"
+
+typedef struct {
+ CARD8 reqType; /* always XBigReqCode */
+ CARD8 brReqType; /* always X_BigReqEnable */
+ CARD16 length B16;
+} xBigReqEnableReq;
+#define sz_xBigReqEnableReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 max_request_size B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xBigReqEnableReply;
+#define sz_xBigReqEnableReply 32
+
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 data;
+ CARD16 zero B16;
+ CARD32 length B32;
+} xBigReq;
+
+#endif /* _BIGREQSPROTO_H_ */
diff --git a/bigreqsproto/bigreqsproto.pc.in b/bigreqsproto/bigreqsproto.pc.in
new file mode 100644
index 0000000..e3adbfd
--- /dev/null
+++ b/bigreqsproto/bigreqsproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: BigReqsProto
+Description: BigReqs extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/bigreqsproto/bigreqstr.h b/bigreqsproto/bigreqstr.h
new file mode 100644
index 0000000..0a023db
--- /dev/null
+++ b/bigreqsproto/bigreqstr.h
@@ -0,0 +1,3 @@
+#warning "bigreqstr.h is obsolete and may be removed in the future."
+#warning "include <X11/extensions/bigreqsproto.h> for the protocol defines."
+#include <X11/extensions/bigreqsproto.h>
diff --git a/bigreqsproto/configure.ac b/bigreqsproto/configure.ac
new file mode 100644
index 0000000..9c1cf55
--- /dev/null
+++ b/bigreqsproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([BigReqsProto], [1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ bigreqsproto.pc])
diff --git a/calibrateproto/Makefile.am b/calibrateproto/Makefile.am
new file mode 100644
index 0000000..2e7dee2
--- /dev/null
+++ b/calibrateproto/Makefile.am
@@ -0,0 +1,39 @@
+#
+# Copyright © 2003 Philip Blundell
+#
+# 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, and that the name of Philip Blundell not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. Philip Blundell makes no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL PHILIP BLUNDELL 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.
+#
+
+XCalibrateincludedir = $(includedir)/X11/extensions
+XCalibrateinclude_HEADERS = xcalibrateproto.h xcalibratewire.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xcalibrateproto.pc
+
+EXTRA_DIST = autogen.sh xcalibrateproto.pc.in
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+ (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog
diff --git a/calibrateproto/autogen.sh b/calibrateproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/calibrateproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/calibrateproto/configure.ac b/calibrateproto/configure.ac
new file mode 100644
index 0000000..eb41072
--- /dev/null
+++ b/calibrateproto/configure.ac
@@ -0,0 +1,6 @@
+AC_PREREQ([2.59])
+AC_INIT([xcalibrateproto], [0.1.0], [pb@nexus.co.uk])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+
+AC_OUTPUT([Makefile
+ xcalibrateproto.pc])
diff --git a/calibrateproto/xcalibrateproto.h b/calibrateproto/xcalibrateproto.h
new file mode 100644
index 0000000..feded32
--- /dev/null
+++ b/calibrateproto/xcalibrateproto.h
@@ -0,0 +1,120 @@
+/*
+ * $Id: xcalibrateproto.h,v 1.1.1.1 2004/06/02 19:18:47 pb Exp $
+ *
+ * Copyright © 2003 Philip Blundell
+ *
+ * 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, and that the name of Philip Blundell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Philip Blundell makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL PHILIP BLUNDELL 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.
+ */
+
+#ifndef XCALIBRATEPROTO_H
+#define XCALIBRATEPROTO_H
+
+/*
+ * requests and replies
+ */
+typedef struct {
+ CARD8 reqType;
+ CARD8 xCalibrateReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xXCalibrateQueryVersionReq;
+
+#define sz_xXCalibrateQueryVersionReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xXCalibrateQueryVersionReply;
+
+#define sz_xXCalibrateQueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xCalibrateReqType;
+ CARD16 length B16;
+ CARD16 on B16;
+ CARD16 pad B16;
+} xXCalibrateRawModeReq;
+
+#define sz_xXCalibrateRawModeReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 status;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXCalibrateRawModeReply;
+
+#define sz_xXCalibrateRawModeReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xCalibrateReqType;
+ CARD16 length B16;
+ CARD32 x B32;
+ CARD32 y B32;
+} xXCalibrateScreenToCoordReq;
+
+#define sz_xXCalibrateScreenToCoordReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 x;
+ CARD32 y;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXCalibrateScreenToCoordReply;
+
+#define sz_xXCalibrateScreenToCoordReply 32
+
+/* Events */
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD16 x;
+ CARD16 y;
+ CARD16 pressure;
+ CARD16 pad2;
+} xXCalibrateRawTouchscreenEvent;
+
+#define sz_xXCalibrateRawTouchscreenEvent 12
+
+#endif
diff --git a/calibrateproto/xcalibrateproto.pc.in b/calibrateproto/xcalibrateproto.pc.in
new file mode 100644
index 0000000..f17f8d7
--- /dev/null
+++ b/calibrateproto/xcalibrateproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCalibrate
+Description: XCalibrate extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/calibrateproto/xcalibratewire.h b/calibrateproto/xcalibratewire.h
new file mode 100644
index 0000000..0a1c904
--- /dev/null
+++ b/calibrateproto/xcalibratewire.h
@@ -0,0 +1,44 @@
+/*
+ * $Id: xcalibratewire.h,v 1.1.1.1 2004/06/02 19:18:47 pb Exp $
+ *
+ * Copyright © 2003 Philip Blundell
+ *
+ * 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, and that the name of Philip Blundell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Philip Blundell makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL PHILIP BLUNDELL 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.
+ */
+
+#ifndef XCALIBRATEWIRE_H
+#define XCALIBRATEWIRE_H
+
+#define XCALIBRATE_MAJOR_VERSION 0
+#define XCALIBRATE_MINOR_VERSION 1
+#define XCALIBRATE_NAME "XCALIBRATE"
+
+#define X_XCalibrateQueryVersion 0
+#define X_XCalibrateRawMode 1
+#define X_XCalibrateScreenToCoord 2
+
+#define XCalibrateNumberRequests (X_XCalibrateScreenToCoord + 1)
+
+#define X_XCalibrateRawTouchscreen 0
+
+#define XCalibrateNumberEvents (X_XCalibrateRawTouchscreen + 1)
+
+#define XCalibrateNumberErrors 0
+
+#endif
diff --git a/compositeproto/.gitignore b/compositeproto/.gitignore
new file mode 100644
index 0000000..896b3f5
--- /dev/null
+++ b/compositeproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for compositeproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/compositeproto/AUTHORS b/compositeproto/AUTHORS
new file mode 100644
index 0000000..8e18f9b
--- /dev/null
+++ b/compositeproto/AUTHORS
@@ -0,0 +1 @@
+Keith Packard, HP
diff --git a/compositeproto/COPYING b/compositeproto/COPYING
new file mode 100644
index 0000000..23c1a6c
--- /dev/null
+++ b/compositeproto/COPYING
@@ -0,0 +1,41 @@
+Copyright © 2006 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.
+
+Copyright © 2003 Keith Packard
+
+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, and that the name of Keith Packard not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission. Keith Packard makes no
+representations about the suitability of this software for any purpose. It
+is provided "as is" without express or implied warranty.
+
+KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL KEITH 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.
+
diff --git a/compositeproto/Makefile.am b/compositeproto/Makefile.am
new file mode 100644
index 0000000..5a14884
--- /dev/null
+++ b/compositeproto/Makefile.am
@@ -0,0 +1,43 @@
+#
+# Copyright © 2003 Keith Packard, Noah Levitt
+#
+# 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, and that the name of Keith Packard not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. Keith Packard makes no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL KEITH 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.
+
+compositedir = $(includedir)/X11/extensions
+composite_HEADERS = \
+ composite.h \
+ compositeproto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = compositeproto.pc
+
+dist_doc_DATA = compositeproto.txt
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/compositeproto/README b/compositeproto/README
new file mode 100644
index 0000000..66b40a4
--- /dev/null
+++ b/compositeproto/README
@@ -0,0 +1,33 @@
+ Composite Extension
+ Version 0.1
+ 2003-11-04
+
+This package contains header files and documentation for the composite
+extension. Library and server implementations are separate.
+
+Keith Packard
+keithp@keithp.com
+
+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/proto/compositeproto
+
+ http://cgit.freedesktop.org/xorg/proto/compositeproto
+
+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/compositeproto/autogen.sh b/compositeproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/compositeproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/compositeproto/composite.h b/compositeproto/composite.h
new file mode 100644
index 0000000..7725321
--- /dev/null
+++ b/compositeproto/composite.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright © 2006 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.
+ */
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+#ifndef _COMPOSITE_H_
+#define _COMPOSITE_H_
+
+#include <X11/extensions/xfixeswire.h>
+
+#define COMPOSITE_NAME "Composite"
+#define COMPOSITE_MAJOR 0
+#define COMPOSITE_MINOR 4
+
+#define CompositeRedirectAutomatic 0
+#define CompositeRedirectManual 1
+
+#define X_CompositeQueryVersion 0
+#define X_CompositeRedirectWindow 1
+#define X_CompositeRedirectSubwindows 2
+#define X_CompositeUnredirectWindow 3
+#define X_CompositeUnredirectSubwindows 4
+#define X_CompositeCreateRegionFromBorderClip 5
+#define X_CompositeNameWindowPixmap 6
+#define X_CompositeGetOverlayWindow 7
+#define X_CompositeReleaseOverlayWindow 8
+
+#define CompositeNumberRequests (X_CompositeReleaseOverlayWindow + 1)
+
+#define CompositeNumberEvents 0
+
+#endif /* _COMPOSITE_H_ */
diff --git a/compositeproto/compositeproto.h b/compositeproto/compositeproto.h
new file mode 100644
index 0000000..aa6cd8a
--- /dev/null
+++ b/compositeproto/compositeproto.h
@@ -0,0 +1,192 @@
+/*
+ * Copyright © 2006 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.
+ */
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+#ifndef _COMPOSITEPROTO_H_
+#define _COMPOSITEPROTO_H_
+
+#include <X11/Xmd.h>
+#include <X11/extensions/composite.h>
+
+#define Window CARD32
+#define Region CARD32
+#define Pixmap CARD32
+
+/*
+ * requests and replies
+ */
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xCompositeQueryVersionReq;
+
+#define sz_xCompositeQueryVersionReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xCompositeQueryVersionReply;
+
+#define sz_xCompositeQueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+ CARD8 update;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xCompositeRedirectWindowReq;
+
+#define sz_xCompositeRedirectWindowReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+ CARD8 update;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xCompositeRedirectSubwindowsReq;
+
+#define sz_xCompositeRedirectSubwindowsReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+ CARD8 update;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xCompositeUnredirectWindowReq;
+
+#define sz_xCompositeUnredirectWindowReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+ CARD8 update;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xCompositeUnredirectSubwindowsReq;
+
+#define sz_xCompositeUnredirectSubwindowsReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Region region B32;
+ Window window B32;
+} xCompositeCreateRegionFromBorderClipReq;
+
+#define sz_xCompositeCreateRegionFromBorderClipReq 12
+
+/* Version 0.2 additions */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length;
+ Window window B32;
+ Pixmap pixmap B32;
+} xCompositeNameWindowPixmapReq;
+
+#define sz_xCompositeNameWindowPixmapReq 12
+
+/* Version 0.3 additions */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+} xCompositeGetOverlayWindowReq;
+
+#define sz_xCompositeGetOverlayWindowReq sizeof(xCompositeGetOverlayWindowReq)
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Window overlayWin B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xCompositeGetOverlayWindowReply;
+
+#define sz_xCompositeGetOverlayWindowReply sizeof(xCompositeGetOverlayWindowReply)
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 compositeReqType;
+ CARD16 length B16;
+ Window window B32;
+} xCompositeReleaseOverlayWindowReq;
+
+#define sz_xCompositeReleaseOverlayWindowReq sizeof(xCompositeReleaseOverlayWindowReq)
+
+#undef Window
+#undef Region
+#undef Pixmap
+
+#endif /* _COMPOSITEPROTO_H_ */
diff --git a/compositeproto/compositeproto.pc.in b/compositeproto/compositeproto.pc.in
new file mode 100644
index 0000000..6348022
--- /dev/null
+++ b/compositeproto/compositeproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: CompositeExt
+Description: Composite extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/compositeproto/compositeproto.txt b/compositeproto/compositeproto.txt
new file mode 100644
index 0000000..4b86621
--- /dev/null
+++ b/compositeproto/compositeproto.txt
@@ -0,0 +1,339 @@
+ Composite Extension
+ Version 0.4
+ 2007-7-3
+ Keith Packard
+ keithp@keithp.com
+ Deron Johnson
+ deron.johnson@sun.com
+
+1. Introduction
+
+Many user interface operations would benefit from having pixel contents of
+window hierarchies available without respect to sibling and antecedent
+clipping. In addition, placing control over the composition of these pixel
+contents into a final screen image in an external application will enable
+a flexible system for dynamic application content presentation.
+
+2. Acknowledgements
+
+This small extension has been brewing for several years, contributors to
+both early prototypes and the final design include:
+
+ + Bill Haneman for motivating the ability to magnify occluded windows
+ with his work on accessibility
+
+ + Carsten Haitzler for Enlightenment, the original eye-candy window
+ manager which demonstrated that clever hacks are an awfully
+ close substitute for changes in the underlying system.
+
+ + Jim Gettys for key insights into the relationship between damage
+ events and per-window pixmap usage
+
+ + Mike Harris and Owen Taylor for figuring out what to call it.
+
+ + Deron Johnson for the Looking Glass implementation and
+ a prototype of the coordinate transformation mechanism.
+
+ + Ryan Lortie for helping figure out reasonable parent clipping
+ semantics in the presense of manual redirected children.
+
+3. Architecture
+
+The composite extension provides three related mechanisms:
+
+ 1. Per-hierarchy storage. The rendering of an entire hierarchy of windows
+ is redirected to off-screen storage. The pixels of that hierarchy
+ are available whenever it is viewable. Storage is automatically
+ reallocated when the top level window changes size. Contents beyond
+ the geometry of the top window are not preserved.
+
+ 2. Automatic shadow update. When a hierarchy is rendered off-screen,
+ the X server provides an automatic mechanism for presenting those
+ contents within the parent window. The implementation is free to
+ make this update lag behind actual rendering operations by an
+ unspecified amount of time. This automatic update mechanism may
+ be disabled so that the parent window contents can be completely
+ determined by an external application.
+
+ 3. External parent - child pointer coordinate transformation.
+ When a hierarchy is under manual compositing, the relationship
+ of coordinates within the parent to those in the child may
+ not be known within the X server. This mechanism provides
+ for redirection of these transformations through a client.
+
+Per-hierarchy storage may be created for individual windows or for all
+children of a window. Manual shadow update may be selected by only a single
+application for each window; manual update may also be selected on a
+per-window basis or for each child of a window. Detecting when to update
+may be done with the Damage extension.
+
+The off-screen storage includes the window contents, its borders and the
+contents of all descendants.
+
+3.1 NameWindowPixmap
+
+Version 0.2 of the protocol introduces a mechanism for associating an XID
+with the off-screen pixmap used to store these contents. This can be used
+to hold onto window contents after the window is unmapped (and hence animate
+it's disappearance), and also to access the border of the window, which is
+not reachable through the Window ID itself. A new pixmap is created each
+time the window is mapped or resized; as these events are nicely signalled
+with existing events, no additional notification is needed. The old pixmap
+will remain allocated as long as the Pixmap ID is left valid, it is
+important that the client use the FreePixmap request when it is done with
+the contents and to create a new name for the newly allocated pixmap.
+
+In automatic update mode, the X server is itself responsible for presenting
+the child window contents within the parent. It seems reasonable, then, for
+rendering to the parent window to be clipped so as not to interfere with any
+child window content. In an environment with a mixure of manual and
+automatic updating windows, rendering to the parent in the area nominally
+occupied by a manual update window should be able to affect parent pixel
+values in those areas, but such rendering should be clipped to automatic
+update windows, and presumably to other manual update windows managed by
+other applications. In any of these cases, it should be easy to ensure that
+rendering has no effect on any non-redirected windows.
+
+Instead of attempting to define new clipping modes for rendering, the
+Composite extension instead defines ClipByChildren rendering to the parent
+to exclude regions occupied by redirected windows (either automatic or
+manual). The CreateRegionFromBorderClip request can be used along with
+IncludeInferiors clipping modes to restrict manual shadow updates to the
+apporpriate region of the screen. Bracketing operations with
+GrabServer/UngrabServer will permit atomic sequences that can update the
+screen without artifact. As all of these operations are asynchronous,
+network latency should not adversely affect update latency.
+
+3.2 Composite Overlay Window
+
+Version 0.3 of the protocol adds the Composite Overlay Window, which
+provides compositing managers with a surface on which to draw without
+interference. This window is always above normal windows and is always
+below the screen saver window. It is an InputOutput window whose width
+and height are the screen dimensions. Its visual is the root visual
+and its border width is zero. Attempts to redirect it using the
+composite extension are ignored. This window does not appear in the
+reply of the QueryTree request. It is also an override redirect window.
+These last two features make it invisible to window managers and other X11
+clients. The only way to access the XID of this window is via the
+CompositeGetOverlayWindow request. Initially, the Composite Overlay
+Window is unmapped.
+
+CompositeGetOverlayWindow returns the XID of the Composite Overlay
+Window. If the window has not yet been mapped, it is mapped by this
+request. When all clients who have called this request have terminated
+their X11 connections the window is unmapped.
+
+Composite managers may render directly to the Composite Overlay
+Window, or they may reparent other windows to be children of this
+window and render to these. Multiple clients may render to the
+Composite Overlay Window, create child windows of it, reshape it, and
+redefine its input region, but the specific arbitration rules followed
+by these clients is not defined by this specification; these policies
+should be defined by the clients themselves.
+
+3.3 Clipping semantics redefined
+
+Version 0.4 of the protocol changes the semantics of clipping in the
+presense of manual redirect children. In version 0.3, a parent was always
+clipped to child windows, independent of the kind of redirection going on.
+With version 0.4, the parent is no longer clipped to child windows which are
+manually redirected. This means the parent can draw in the child region without using
+IncludeInferiors mode, and (perhaps more importantly), it will receive
+expose events in those regions caused by other actions. This new behaviour
+is not selectable.
+
+4. Errors
+
+The composite extension does not define any new errors.
+
+5. Types
+
+ UPDATETYPE { Automatic, Manual }
+
+ CompositeCoordinate
+ child: Window
+ x, y: CARD16
+
+7. Extension Initialization
+
+The client must negotiate the version of the extension before executing
+extension requests. Otherwise, the server will return BadRequest for any
+operations other than QueryVersion.
+
+ QueryVersion
+
+ client-major-version: CARD32
+ client-minor-version: CARD32
+
+ ->
+
+ major-version: CARD32
+ minor-version: CARD32
+
+ The client sends the highest supported version to the server and
+ the server sends the highest version it supports, but no higher than
+ the requested version. Major versions changes can introduce
+ incompatibilities in existing functionality, minor version
+ changes introduce only backward compatible changes. It is
+ the client's responsibility to ensure that the server supports
+ a version which is compatible with its expectations. Servers
+ are encouraged to support multiple versions of the extension.
+
+8. Hierarchy Redirection
+
+ RedirectWindow
+
+ window: Window
+ update: UPDATETYPE
+
+ errors: Window, Access, Match
+
+ The hierarchy starting at 'window' is directed to off-screen
+ storage. 'update' specifies whether the contents are mirrored to
+ the parent window automatically or not. Only one client may specify
+ an update type of Manual, another attempt will result in an
+ Access error. When all clients enabling redirection terminate,
+ the redirection will automatically be disabled.
+
+ The root window may not be redirected. Doing so results in a Match
+ error.
+
+ RedirectSubwindows
+
+ window: Window
+ update UPDATETYPE
+
+ errors: Window, Access
+
+ Hierarchies starting at all current and future children of window
+ will be redirected as in RedirectWindow. If update is Manual,
+ then painting of the window background during window manipulation
+ and ClearArea requests is inhibited.
+
+ UnredirectWindow:
+
+ window: Window
+
+ errors: Window, Value
+
+ Redirection of the specified window will be terminated. If
+ the specified window was not selected for redirection by the
+ current client, a 'Value' error results.
+
+ UnredirectWindows:
+
+ window: Window
+
+ errors: Window, Value
+
+ Redirection of all children of window will be terminated. If
+ the specified window was not selected for sub-redirection by the
+ current client, a 'Value' error results.
+
+9. Clip lists
+
+ CreateRegionFromBorderClip
+
+ region: Region
+ window: Window
+
+ errors: Window, IDChoice
+
+ This request creates a region containing the "usual" border clip
+ value; that is the area of the window clipped against siblings and
+ the parent. This region can be used to restrict rendering to
+ suitable areas while updating only a single window. The region
+ is copied at the moment the request is executed; future changes
+ to the window hierarchy will not be reflected in this region.
+
+10. Associating a Pixmap ID with the off-screen storage (0.2 and later)
+
+ NameWindowPixmap
+
+ window: Window
+ pixmap: Pixmap
+
+ errors: Window, Match, IDChoice
+
+ This request makes 'pixmap' a reference to the off-screen storage
+ for 'window'. This pixmap will remain allocated until freed, even
+ if 'window' is unmapped, reconfigured or destroyed. However,
+ 'window' will get a new pixmap allocated each time it is
+ mapped or resized, so this request will need to be reinvoked for
+ the client to continue to refer to the storage holding the current
+ window contents. Generates a 'Match' error if 'window' is not
+ redirected or is not visible.
+
+11. Composite Overlay Window (0.3 and later)
+
+ CompositeGetOverlayWindow
+
+ window: Window
+
+ ->
+
+ overlayWin: Window
+
+ This request returns the XID of the Composite Overlay Window for
+ the screen specified by the argument 'window'. This request
+ indicates that the client wishes to use the Composite Overlay
+ Window of this screen. If this Composite Overlay Window has not
+ yet been mapped, it is mapped by this request.
+
+ The Composite Overlay Window for a particular screen will be
+ unmapped when all clients who have invoked this request have
+ also invoked CompositeReleaseOverlayWindow for that screen. Also,
+ CompositeReleaseOverlayWindow for a screen will be implicitly
+ called when a client using the Composite Overlay Window on that
+ screen terminates its X11 connection.
+
+
+ CompositeReleaseOverlayWindow
+
+ window: Window
+
+ This request specifies that the client is no longer using the
+ Composite Overlay Window on the screen specified by the
+ argument 'window'. A screen's Composite Overlay Window is
+ unmapped when there are no longer any clients using it.
+
+12. External coordinate transformation (0.4 and later)
+
+ RedirectCoordinate
+
+ window: Window
+ redirect: BOOL
+
+ errors: Window, Access
+
+ If 'redirect' is TRUE, the requesting client is placed in charge of
+ coordinate transformations between 'window' and its children. If
+ 'redirect' is FALSE, any such redirection is disabled. Any
+ transformations needed by the server will be delivered to the
+ requesting client in TransformCoordinateNotify events and the
+ requesting client must reply with matching TransformCoordinate
+ requests for the server to continue with the operation.
+
+ Generates an 'Access' error if another client has
+ redirected coordinates for 'window'.
+
+ TransformCoordinate
+
+ window: Window
+ serialNumber: CARD32
+ x, y: INT16
+ coordinates: LISTofCompositeCoordinate
+
+ This provides the transformation data needed by the server for a
+ single TransformCoordinateNotify event. 'serialNumber' must match
+ the serial number delivered in the event. 'x' and 'y' represent the
+ coordinate from the event relative to the 'window'. 'coordinates'
+ represent the coordinate from the event relative to each child
+ listed. Any children not listed in 'coordinates' are given the
+ default transformation using the child window position within the
+ parent as a simple translation.
+
+ The result of this is that any pointer data seen by means of
+ the protocol will appear to reflect the transformation
+ performed by this request.
diff --git a/compositeproto/configure.ac b/compositeproto/configure.ac
new file mode 100644
index 0000000..45969f7
--- /dev/null
+++ b/compositeproto/configure.ac
@@ -0,0 +1,37 @@
+dnl
+dnl Copyright © 2003 Keith Packard, Noah Levitt
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation, and that the name of Keith Packard not be used in
+dnl advertising or publicity pertaining to distribution of the software without
+dnl specific, written prior permission. Keith Packard makes no
+dnl representations about the suitability of this software for any purpose. It
+dnl is provided "as is" without express or implied warranty.
+dnl
+dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+dnl PERFORMANCE OF THIS SOFTWARE.
+dnl
+dnl Process this file with autoconf to create configure.
+
+AC_PREREQ([2.60])
+AC_INIT([CompositeProto], [0.4.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ compositeproto.pc])
+
diff --git a/damageproto/.gitignore b/damageproto/.gitignore
new file mode 100644
index 0000000..cd9ffab
--- /dev/null
+++ b/damageproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for damageproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/damageproto/AUTHORS b/damageproto/AUTHORS
new file mode 100644
index 0000000..78b329f
--- /dev/null
+++ b/damageproto/AUTHORS
@@ -0,0 +1,2 @@
+Keith Packard, HP
+Eric Anholt, Intel
diff --git a/damageproto/COPYING b/damageproto/COPYING
new file mode 100644
index 0000000..a44e065
--- /dev/null
+++ b/damageproto/COPYING
@@ -0,0 +1,23 @@
+$Id: COPYING,v 1.1 2003-10-24 06:16:46 keithp Exp $
+
+Copyright © 2001,2003 Keith Packard
+Copyright © 2007 Eric Anholt
+
+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, and that the name of Keith Packard not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission. Keith Packard makes no
+representations about the suitability of this software for any purpose. It
+is provided "as is" without express or implied warranty.
+
+KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL KEITH 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.
+
diff --git a/damageproto/Makefile.am b/damageproto/Makefile.am
new file mode 100644
index 0000000..7c9b757
--- /dev/null
+++ b/damageproto/Makefile.am
@@ -0,0 +1,43 @@
+#
+# Copyright © 2003 Keith Packard, Noah Levitt
+#
+# 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, and that the name of Keith Packard not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. Keith Packard makes no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL KEITH 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.
+
+damagedir = $(includedir)/X11/extensions
+damage_HEADERS = \
+ damageproto.h \
+ damagewire.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = damageproto.pc
+
+dist_doc_DATA = damageproto.txt
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/damageproto/NEWS b/damageproto/NEWS
new file mode 100644
index 0000000..29b8edd
--- /dev/null
+++ b/damageproto/NEWS
@@ -0,0 +1,2 @@
+2004-01-05: Version 1.0 released.
+2007-01-09: Version 1.1 released, adding the DamageAdd request. \ No newline at end of file
diff --git a/damageproto/README b/damageproto/README
new file mode 100644
index 0000000..a8a4e78
--- /dev/null
+++ b/damageproto/README
@@ -0,0 +1,34 @@
+ Damage
+ X Damage Extension
+ Version 1.1
+ 2007-01-08
+
+This package contains header files and documentation for the X Damage
+extension. Library and server implementations are separate.
+
+Keith Packard
+keithp@keithp.com
+
+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/proto/damageproto
+
+ http://cgit.freedesktop.org/xorg/proto/damageproto
+
+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/damageproto/autogen.sh b/damageproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/damageproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/damageproto/configure.ac b/damageproto/configure.ac
new file mode 100644
index 0000000..b0d682b
--- /dev/null
+++ b/damageproto/configure.ac
@@ -0,0 +1,37 @@
+dnl
+dnl Copyright © 2003 Keith Packard, Noah Levitt
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation, and that the name of Keith Packard not be used in
+dnl advertising or publicity pertaining to distribution of the software without
+dnl specific, written prior permission. Keith Packard makes no
+dnl representations about the suitability of this software for any purpose. It
+dnl is provided "as is" without express or implied warranty.
+dnl
+dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+dnl PERFORMANCE OF THIS SOFTWARE.
+dnl
+dnl Process this file with autoconf to create configure.
+
+AC_PREREQ([2.60])
+AC_INIT([DamageProto], [1.2.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ damageproto.pc])
+
diff --git a/damageproto/damageproto.h b/damageproto/damageproto.h
new file mode 100644
index 0000000..107e192
--- /dev/null
+++ b/damageproto/damageproto.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright © 2003 Keith Packard
+ * Copyright © 2007 Eric Anholt
+ *
+ * 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+#ifndef _DAMAGEPROTO_H_
+#define _DAMAGEPROTO_H_
+
+#include <X11/Xmd.h>
+#include <X11/extensions/xfixesproto.h>
+#include <X11/extensions/damagewire.h>
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+#define Picture CARD32
+#define Region CARD32
+#define Damage CARD32
+
+/************** Version 0 ******************/
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+} xDamageReq;
+
+/*
+ * requests and replies
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xDamageQueryVersionReq;
+
+#define sz_xDamageQueryVersionReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDamageQueryVersionReply;
+
+#define sz_xDamageQueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+ Damage damage B32;
+ Drawable drawable B32;
+ CARD8 level;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xDamageCreateReq;
+
+#define sz_xDamageCreateReq 16
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+ Damage damage B32;
+} xDamageDestroyReq;
+
+#define sz_xDamageDestroyReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+ Damage damage B32;
+ Region repair B32;
+ Region parts B32;
+} xDamageSubtractReq;
+
+#define sz_xDamageSubtractReq 16
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 damageReqType;
+ CARD16 length B16;
+ Drawable drawable B32;
+ Region region B32;
+} xDamageAddReq;
+
+#define sz_xDamageAddReq 12
+
+/* Events */
+
+#define DamageNotifyMore 0x80
+
+typedef struct {
+ CARD8 type;
+ CARD8 level;
+ CARD16 sequenceNumber B16;
+ Drawable drawable B32;
+ Damage damage B32;
+ Time timestamp B32;
+ xRectangle area;
+ xRectangle geometry;
+} xDamageNotifyEvent;
+
+#undef Damage
+#undef Region
+#undef Picture
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* _DAMAGEPROTO_H_ */
diff --git a/damageproto/damageproto.pc.in b/damageproto/damageproto.pc.in
new file mode 100644
index 0000000..25476b9
--- /dev/null
+++ b/damageproto/damageproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: DamageProto
+Description: Damage extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/damageproto/damageproto.txt b/damageproto/damageproto.txt
new file mode 100644
index 0000000..1f254d4
--- /dev/null
+++ b/damageproto/damageproto.txt
@@ -0,0 +1,222 @@
+ The DAMAGE Extension
+ Protocol Version 1.1
+ Document Revision 1
+ 2007-01-08
+
+ Keith Packard
+ keithp@keithp.com
+
+ Eric Anholt
+ eric@anholt.net
+ Open Source Technology Center
+ Intel Corporation
+1. Introduction
+
+Monitoring the regions affected by rendering has wide-spread use, from
+VNC-like systems scraping the screen to screen magnifying applications
+designed to aid users with limited visual acuity. The DAMAGE extension is
+designed to make such applications reasonably efficient in the face of
+server-client latency.
+
+2. Acknolwedgements
+
+As usual, the author had significant input from many people, in particular:
+
+ + Havoc Pennington who designed and implemented a Damage extension
+ last year which was then lost to the mists of time.
+
+ + Bill Haneman whose work on accessibility in the Gnome environment
+ is legendary.
+
+ + Jim Gettys who found a way to avoid streaming damage rectangles
+ to the client in many cases.
+
+ + Owen Taylor who suggested that streaming damage rectangles may
+ be warranted in some cases after all.
+
+3. Damage Model
+
+We call changes made to pixel contents of windows and pixmaps 'damage'
+throughout this extension. Another notion of 'damage' are drawable regions
+which are in need of redisplay to repair the effects of window manipulation
+or other data loss. This extension doesn't deal with this second notion at
+all; suggestions on a better term which isn't easily conflated with existing
+notions are eagerly solicited.
+
+Damage accumulates as drawing occurs in the drawable. Each drawing operation
+'damages' one or more rectangular areas within the drawable. The rectangles
+are guaranteed to include the set of pixels modified by each operation, but
+may include significantly more than just those pixels. The desire is for
+the damage to strike a balance between the number of rectangles reported and
+the extraneous area included. A reasonable goal is for each primitive
+object drawn (line, string, rectangle) to be represented as a single
+rectangle and for the damage area of the operation to be the union of these
+rectangles.
+
+The DAMAGE extension allows applications to either receive the raw
+rectangles as a stream of events, or to have them partially processed within
+the X server to reduce the amount of data transmitted as well as reduce the
+processing latency once the repaint operation has started.
+
+Damage to a window reflects both drawing within the window itself as well as
+drawing within any inferior window that affects pixels seen by
+IncludeInferiors rendering operations. To reduce the computational
+complexity of this, the DAMAGE extension allows the server to monitor all
+rendering operations within the physical target pixel storage that fall
+within the bounds of the window. In a system with a single frame buffer
+holding all windows, this means that damage will accumulate for all
+rendering operations that lie within the visible part of the window.
+
+The precise reason for this architecture is to enable the Composite
+extension which provides multiple pixel storage areas for the screen
+contents.
+
+3.1 Additions in the 1.1 version of the protocol
+
+Damage is automatically computed by the X Server for X rendering operations,
+but direct rendering extensions have allowed clients to perform rendering
+outside of the control of the X Server. The 1.1 version of the protocol
+added a request to allow direct rendering clients to report damage to a
+drawable. Some direct rendering clients, due to architectural limitations,
+always perform rendering to the root window, even in when it should be
+performed to the backing pixmap in the Composite case. To provide
+less-incorrect rendering in this cases, the direct rendering client should
+translate its damage region to screen coordinates and report the damage against
+the root window rather than the drawable.
+
+4. Data types
+
+The "Damage" object holds any accumulated damage region and reflects the
+relationship between the drawable selected for damage notification and the
+drawable for which damage is tracked.
+
+5. Errors
+
+Damage
+ A value for a DAMAGE argument does not name a defined DAMAGE.
+
+6. Types
+
+ DAMAGE 32-bit value (top three bits guaranteed to be zero)
+
+ DamageReportLevel { DamageReportRawRectangles,
+ DamageReportDeltaRectangles,
+ DamageReportBoundingBox,
+ DamageReportNonEmpty }
+
+ DamageReportRawRectangles
+
+ Delivers DamageNotify events each time the screen
+ is modified with rectangular bounds that circumscribe
+ the damaged area. No attempt to compress out overlapping
+ rectangles is made.
+
+ DamageReportDeltaRectangles
+
+ Delivers DamageNotify events each time damage occurs
+ which is not included in the damage region. The
+ reported rectangles include only the changes to that
+ area, not the raw damage data.
+
+ DamageReportBoundingBox
+
+ Delivers DamageNotify events each time the bounding
+ box enclosing the damage region increases in size.
+ The reported rectangle encloses the entire damage region,
+ not just the changes to that size.
+
+ DamageReportNonEmpty
+
+ Delivers a single DamageNotify event each time the
+ damage rectangle changes from empty to non-empty, and
+ also whenever the result of a DamageSubtract request
+ results in a non-empty region.
+
+7. Events
+
+DamageNotify
+
+ level: DamageReportLevel
+ drawable: Drawable
+ damage: DAMAGE
+ more: Bool
+ timestamp: Timestamp
+ area: Rectangle
+ drawable-geometry: Rectangle
+
+ 'more' indicates whether there are subsequent damage events
+ being delivered immediately as part of a larger damage region
+
+8. Extension Initialization
+
+The client must negotiate the version of the extension before executing
+extension requests. Otherwise, the server will return BadRequest for any
+operations other than QueryVersion.
+
+QueryVersion
+
+ client-major-version: CARD32
+ client-minor-version: CARD32
+
+ ->
+
+ major-version: CARD32
+ minor-version: CARD32
+
+ The client sends the highest supported version to the server and
+ the server sends the highest version it supports, but no higher than
+ the requested version. Major versions changes can introduce
+ incompatibilities in existing functionality, minor version
+ changes introduce only backward compatible changes. It is
+ the clients responsibility to ensure that the server supports
+ a version which is compatible with its expectations. Servers
+ are encouraged to support multiple versions of the extension.
+
+9. Enable Monitoring
+
+DamageCreate
+
+ damage: DAMAGE
+ drawable: Drawable
+ level: DamageReportLevel
+
+ Creates a damage object to monitor changes to Drawable
+
+DamageDestroy
+ damage: DAMAGE
+
+ Destroys damage.
+
+DamageSubtract
+
+ damage: DAMAGE
+ repair: Region or None
+ parts: Region or None
+
+ Synchronously modifies the regions in the following manner:
+
+ If repair is None:
+
+ 1) if parts is not None, parts = damage
+ 2) damage = <empty>
+
+ Otherwise:
+
+ 1) tmp = damage INTERSECT repair
+ 2) damage = damage - tmp
+ 3) if parts is not None, parts = tmp
+ 4) Generate DamageNotify for remaining damage areas
+
+DamageAdd
+
+ drawable: Drawable
+ region: Region
+
+ Reports damage of the region within the given drawable. This may be
+ used by direct rendering clients to report damage that the server would
+ otherwise be unaware of. The damage region is relative to the origin
+ of the drawable.
+
+ Damage posted in this way will appear in DamageNotify events as normal,
+ and also in server internal damage tracking (for shadow framebuffer
+ updates, pixmap damage, and other uses).
diff --git a/damageproto/damagewire.h b/damageproto/damagewire.h
new file mode 100644
index 0000000..d90a0dd
--- /dev/null
+++ b/damageproto/damagewire.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+#ifndef _DAMAGEWIRE_H_
+#define _DAMAGEWIRE_H_
+
+#define DAMAGE_NAME "DAMAGE"
+#define DAMAGE_MAJOR 1
+#define DAMAGE_MINOR 1
+
+/************* Version 1 ****************/
+
+/* Constants */
+#define XDamageReportRawRectangles 0
+#define XDamageReportDeltaRectangles 1
+#define XDamageReportBoundingBox 2
+#define XDamageReportNonEmpty 3
+
+/* Requests */
+#define X_DamageQueryVersion 0
+#define X_DamageCreate 1
+#define X_DamageDestroy 2
+#define X_DamageSubtract 3
+#define X_DamageAdd 4
+
+#define XDamageNumberRequests (X_DamageAdd + 1)
+
+/* Events */
+#define XDamageNotify 0
+
+#define XDamageNumberEvents (XDamageNotify + 1)
+
+/* Errors */
+#define BadDamage 0
+#define XDamageNumberErrors (BadDamage + 1)
+
+#endif /* _DAMAGEWIRE_H_ */
diff --git a/dmxproto/.gitignore b/dmxproto/.gitignore
new file mode 100644
index 0000000..71417e4
--- /dev/null
+++ b/dmxproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for dmxproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/dmxproto/COPYING b/dmxproto/COPYING
new file mode 100644
index 0000000..7ea03ea
--- /dev/null
+++ b/dmxproto/COPYING
@@ -0,0 +1,24 @@
+Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+
+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 on 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
+NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+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/dmxproto/Makefile.am b/dmxproto/Makefile.am
new file mode 100644
index 0000000..6883b29
--- /dev/null
+++ b/dmxproto/Makefile.am
@@ -0,0 +1,20 @@
+dmxdir = $(includedir)/X11/extensions
+dmx_HEADERS = \
+ dmx.h \
+ dmxproto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dmxproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/dmxproto/README b/dmxproto/README
new file mode 100644
index 0000000..3b93b48
--- /dev/null
+++ b/dmxproto/README
@@ -0,0 +1,31 @@
+ Distributed Multihead X (DMX) Extension
+
+This extension defines a protocol for clients to access a front-end proxy
+X server that controls multiple back-end X servers making up a large display.
+
+Extension name: DMX
+
+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/proto/dmxproto
+
+ http://cgit.freedesktop.org/xorg/proto/dmxproto
+
+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/dmxproto/autogen.sh b/dmxproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/dmxproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/dmxproto/configure.ac b/dmxproto/configure.ac
new file mode 100644
index 0000000..c25791e
--- /dev/null
+++ b/dmxproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([DMXProto], [2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ dmxproto.pc])
diff --git a/dmxproto/dmx.h b/dmxproto/dmx.h
new file mode 100644
index 0000000..8cbd4d3
--- /dev/null
+++ b/dmxproto/dmx.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+ *
+ * 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 on 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
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * This file describes the interface to the client-side libdmx.a
+ * library. All DMX-aware client-side applications should include this
+ * file. */
+
+#ifndef _DMX_H_
+#define _DMX_H_
+
+/* These values must be larger than LastExtensionError.
+ The values in dmxext.h and dmxproto.h *MUST* match. */
+#define DmxBadXinerama 1001
+#define DmxBadValue 1002
+#define DmxBadReply 1003
+
+#define DMXScreenWindowWidth (1L<<0)
+#define DMXScreenWindowHeight (1L<<1)
+#define DMXScreenWindowXoffset (1L<<2)
+#define DMXScreenWindowYoffset (1L<<3)
+#define DMXRootWindowWidth (1L<<4)
+#define DMXRootWindowHeight (1L<<5)
+#define DMXRootWindowXoffset (1L<<6)
+#define DMXRootWindowYoffset (1L<<7)
+#define DMXRootWindowXorigin (1L<<8)
+#define DMXRootWindowYorigin (1L<<9)
+
+#define DMXDesktopWidth (1L<<0)
+#define DMXDesktopHeight (1L<<1)
+#define DMXDesktopShiftX (1L<<2)
+#define DMXDesktopShiftY (1L<<3)
+
+#define DMXInputType (1L<<0)
+#define DMXInputPhysicalScreen (1L<<1)
+#define DMXInputSendsCore (1L<<2)
+
+#endif
diff --git a/dmxproto/dmxproto.h b/dmxproto/dmxproto.h
new file mode 100644
index 0000000..4bb160e
--- /dev/null
+++ b/dmxproto/dmxproto.h
@@ -0,0 +1,445 @@
+/*
+ * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+ *
+ * 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 on 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
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * This file describes the structures necessary to implement the wire
+ * protocol for the DMX protocol extension. It should be included only
+ * in files that implement the client-side (or server-side) part of the
+ * protocol (i.e., client-side applications should \b not include this
+ * file). */
+
+#ifndef _DMXSTR_H_
+#define _DMXSTR_H_
+
+#define DMX_EXTENSION_NAME "DMX"
+#define DMX_EXTENSION_MAJOR 2
+#define DMX_EXTENSION_MINOR 2
+#define DMX_EXTENSION_PATCH 20040604
+
+/* These values must be larger than LastExtensionError.
+ The values in dmxext.h and dmxproto.h *MUST* match. */
+#define DMX_BAD_XINERAMA 1001
+#define DMX_BAD_VALUE 1002
+
+#define X_DMXQueryVersion 0
+#define X_DMXGetScreenCount 1
+#define X_DMXGetScreenInformationDEPRECATED 2
+#define X_DMXGetWindowAttributes 3
+#define X_DMXGetInputCount 4
+#define X_DMXGetInputAttributes 5
+#define X_DMXForceWindowCreationDEPRECATED 6
+#define X_DMXReconfigureScreenDEPRECATED 7
+#define X_DMXSync 8
+#define X_DMXForceWindowCreation 9
+#define X_DMXGetScreenAttributes 10
+#define X_DMXChangeScreensAttributes 11
+#define X_DMXAddScreen 12
+#define X_DMXRemoveScreen 13
+#define X_DMXGetDesktopAttributes 14
+#define X_DMXChangeDesktopAttributes 15
+#define X_DMXAddInput 16
+#define X_DMXRemoveInput 17
+
+/** Wire-level description of DMXQueryVersion protocol request. */
+typedef struct {
+ CARD8 reqType; /* dmxcode */
+ CARD8 dmxReqType; /* X_DMXQueryVersion */
+ CARD16 length B16;
+} xDMXQueryVersionReq;
+#define sz_xDMXQueryVersionReq 4
+
+/** Wire-level description of DMXQueryVersion protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 ununsed;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 patchVersion B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xDMXQueryVersionReply;
+#define sz_xDMXQueryVersionReply 32
+
+/** Wire-level description of DMXSync protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXSync */
+ CARD16 length B16;
+} xDMXSyncReq;
+#define sz_xDMXSyncReq 4
+
+/** Wire-level description of DMXSync protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXSyncReply;
+#define sz_xDMXSyncReply 32
+
+/** Wire-level description of DMXForceWindowCreation protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXForceWindowCreation */
+ CARD16 length B16;
+ CARD32 window B32;
+} xDMXForceWindowCreationReq;
+#define sz_xDMXForceWindowCreationReq 8
+
+/** Wire-level description of DMXForceWindowCreation protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXForceWindowCreationReply;
+#define sz_xDMXForceWindowCreationReply 32
+
+/** Wire-level description of DMXGetScreenCount protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetScreenCount */
+ CARD16 length B16;
+} xDMXGetScreenCountReq;
+#define sz_xDMXGetScreenCountReq 4
+
+/** Wire-level description of DMXGetScreenCount protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 screenCount B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXGetScreenCountReply;
+#define sz_xDMXGetScreenCountReply 32
+
+/** Wire-level description of DMXGetScreenAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetScreenAttributes */
+ CARD16 length B16;
+ CARD32 physicalScreen B32;
+} xDMXGetScreenAttributesReq;
+#define sz_xDMXGetScreenAttributesReq 8
+
+/** Wire-level description of DMXGetScreenAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 displayNameLength B32;
+ CARD32 logicalScreen B32;
+
+ CARD16 screenWindowWidth B16;
+ CARD16 screenWindowHeight B16;
+ INT16 screenWindowXoffset B16;
+ INT16 screenWindowYoffset B16;
+
+ CARD16 rootWindowWidth B16;
+ CARD16 rootWindowHeight B16;
+ INT16 rootWindowXoffset B16;
+ INT16 rootWindowYoffset B16;
+ INT16 rootWindowXorigin B16;
+ INT16 rootWindowYorigin B16;
+} xDMXGetScreenAttributesReply;
+#define sz_xDMXGetScreenAttributesReply 36
+
+/** Wire-level description of DMXChangeScreensAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXChangeScreensAttributes */
+ CARD16 length B16;
+ CARD32 screenCount B32;
+ CARD32 maskCount B32;
+} xDMXChangeScreensAttributesReq;
+#define sz_xDMXChangeScreensAttributesReq 12
+
+/** Wire-level description of DMXChangeScreensAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 errorScreen B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xDMXChangeScreensAttributesReply;
+#define sz_xDMXChangeScreensAttributesReply 32
+
+/** Wire-level description of DMXAddScreen protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXAddScreen */
+ CARD16 length B16;
+ CARD32 displayNameLength B32;
+ CARD32 physicalScreen B32;
+ CARD32 valueMask B32;
+} xDMXAddScreenReq;
+#define sz_xDMXAddScreenReq 16
+
+/** Wire-level description of DMXAddScreen protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 physicalScreen B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xDMXAddScreenReply;
+#define sz_xDMXAddScreenReply 32
+
+/** Wire-level description of DMXRemoveScreen protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXRemoveScreen */
+ CARD16 length B16;
+ CARD32 physicalScreen B32;
+} xDMXRemoveScreenReq;
+#define sz_xDMXRemoveScreenReq 8
+
+/** Wire-level description of DMXRemoveScreen protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXRemoveScreenReply;
+#define sz_xDMXRemoveScreenReply 32
+
+/** Wire-level description of DMXGetWindowAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetWindowAttributes */
+ CARD16 length B16;
+ CARD32 window B32;
+} xDMXGetWindowAttributesReq;
+#define sz_xDMXGetWindowAttributesReq 8
+
+/** Wire-level description of DMXGetWindowAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 screenCount B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXGetWindowAttributesReply;
+#define sz_xDMXGetWindowAttributesReply 32
+
+/** Wire-level description of DMXGetDesktopAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetDesktopAttributes */
+ CARD16 length B16;
+} xDMXGetDesktopAttributesReq;
+#define sz_xDMXGetDesktopAttributesReq 4
+
+/** Wire-level description of DMXGetDesktopAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT16 width;
+ INT16 height;
+ INT16 shiftX;
+ INT16 shiftY;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xDMXGetDesktopAttributesReply;
+#define sz_xDMXGetDesktopAttributesReply 32
+
+/** Wire-level description of DMXChangeDesktopAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXChangeDesktopAttributes */
+ CARD16 length B16;
+ CARD32 valueMask B32;
+} xDMXChangeDesktopAttributesReq;
+#define sz_xDMXChangeDesktopAttributesReq 8
+
+/** Wire-level description of DMXChangeDesktopAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXChangeDesktopAttributesReply;
+#define sz_xDMXChangeDesktopAttributesReply 32
+
+/** Wire-level description of DMXGetInputCount protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetInputCount */
+ CARD16 length B16;
+} xDMXGetInputCountReq;
+#define sz_xDMXGetInputCountReq 4
+
+/** Wire-level description of DMXGetInputCount protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 inputCount B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXGetInputCountReply;
+#define sz_xDMXGetInputCountReply 32
+
+/** Wire-level description of DMXGetInputAttributes protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXGetInputAttributes */
+ CARD16 length B16;
+ CARD32 deviceId B32;
+} xDMXGetInputAttributesReq;
+#define sz_xDMXGetInputAttributesReq 8
+
+/** Wire-level description of DMXGetInputAttributes protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 inputType B32;
+ CARD32 physicalScreen B32;
+ CARD32 physicalId B32;
+ CARD32 nameLength B32;
+ BOOL isCore;
+ BOOL sendsCore;
+ BOOL detached;
+ CARD8 pad0;
+ CARD32 pad1 B32;
+} xDMXGetInputAttributesReply;
+#define sz_xDMXGetInputAttributesReply 32
+
+/** Wire-level description of DMXAddInput protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXAddInput */
+ CARD16 length B16;
+ CARD32 displayNameLength B32;
+ CARD32 valueMask;
+} xDMXAddInputReq;
+#define sz_xDMXAddInputReq 12
+
+/** Wire-level description of DMXAddInput protocol reply. */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 physicalId B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xDMXAddInputReply;
+#define sz_xDMXAddInputReply 32
+
+/** Wire-level description of DMXRemoveInput protocol request. */
+typedef struct {
+ CARD8 reqType; /* DMXCode */
+ CARD8 dmxReqType; /* X_DMXRemoveInput */
+ CARD16 length B16;
+ CARD32 physicalId B32;
+} xDMXRemoveInputReq;
+#define sz_xDMXRemoveInputReq 8
+
+/** Wire-level description of DMXRemoveInput protocol reply. */
+typedef struct {
+ BYTE type;
+ CARD8 unused;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 status B32;
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDMXRemoveInputReply;
+#define sz_xDMXRemoveInputReply 32
+
+#endif
diff --git a/dmxproto/dmxproto.pc.in b/dmxproto/dmxproto.pc.in
new file mode 100644
index 0000000..97cd1b8
--- /dev/null
+++ b/dmxproto/dmxproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: DMXProto
+Description: DMX extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/dri2proto/.gitignore b/dri2proto/.gitignore
new file mode 100644
index 0000000..507f5dd
--- /dev/null
+++ b/dri2proto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for dri2proto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/dri2proto/COPYING b/dri2proto/COPYING
new file mode 100644
index 0000000..a99b75a
--- /dev/null
+++ b/dri2proto/COPYING
@@ -0,0 +1,29 @@
+Copyright © 2007 Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Soft-
+ware"), to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, provided that the above copyright
+notice(s) and this permission notice appear in all copies of the Soft-
+ware and that both the above copyright notice(s) and this permission
+notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+QUENTIAL 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 PERFOR-
+MANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization of
+the copyright holder.
+
+Authors:
+ Kristian Høgsberg (krh@redhat.com)
diff --git a/dri2proto/Makefile.am b/dri2proto/Makefile.am
new file mode 100644
index 0000000..5990273
--- /dev/null
+++ b/dri2proto/Makefile.am
@@ -0,0 +1,20 @@
+dri2dir = $(includedir)/X11/extensions
+dri2_HEADERS = dri2proto.h dri2tokens.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dri2proto.pc
+
+dist_doc_DATA = dri2proto.txt
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/dri2proto/README b/dri2proto/README
new file mode 100644
index 0000000..1115e51
--- /dev/null
+++ b/dri2proto/README
@@ -0,0 +1,30 @@
+ Direct Rendering Infrastructure 2 Extension
+
+This extension defines a protocol to securely allow user applications to access
+the video hardware without requiring data to be passed through the X server.
+
+Extension name: DRI2
+
+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/proto/dri2proto
+
+ http://cgit.freedesktop.org/xorg/proto/dri2proto
+
+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/dri2proto/autogen.sh b/dri2proto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/dri2proto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/dri2proto/configure.ac b/dri2proto/configure.ac
new file mode 100644
index 0000000..5b78d6b
--- /dev/null
+++ b/dri2proto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([DRI2Proto], [2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ dri2proto.pc])
diff --git a/dri2proto/dri2proto.h b/dri2proto/dri2proto.h
new file mode 100644
index 0000000..9708a4a
--- /dev/null
+++ b/dri2proto/dri2proto.h
@@ -0,0 +1,317 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL 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 PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ * Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_PROTO_H_
+#define _DRI2_PROTO_H_
+
+#define DRI2_NAME "DRI2"
+#define DRI2_MAJOR 1
+#define DRI2_MINOR 3
+
+#define DRI2NumberErrors 0
+#define DRI2NumberEvents 2
+#define DRI2NumberRequests 13
+
+#define X_DRI2QueryVersion 0
+#define X_DRI2Connect 1
+#define X_DRI2Authenticate 2
+#define X_DRI2CreateDrawable 3
+#define X_DRI2DestroyDrawable 4
+#define X_DRI2GetBuffers 5
+#define X_DRI2CopyRegion 6
+#define X_DRI2GetBuffersWithFormat 7
+#define X_DRI2SwapBuffers 8
+#define X_DRI2GetMSC 9
+#define X_DRI2WaitMSC 10
+#define X_DRI2WaitSBC 11
+#define X_DRI2SwapInterval 12
+
+/*
+ * Events
+ */
+#define DRI2_BufferSwapComplete 0
+#define DRI2_InvalidateBuffers 1
+
+typedef struct {
+ CARD32 attachment B32;
+ CARD32 name B32;
+ CARD32 pitch B32;
+ CARD32 cpp B32;
+ CARD32 flags B32;
+} xDRI2Buffer;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xDRI2QueryVersionReq;
+#define sz_xDRI2QueryVersionReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDRI2QueryVersionReply;
+#define sz_xDRI2QueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 window B32;
+ CARD32 driverType B32;
+} xDRI2ConnectReq;
+#define sz_xDRI2ConnectReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 driverNameLength B32;
+ CARD32 deviceNameLength B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDRI2ConnectReply;
+#define sz_xDRI2ConnectReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 window B32;
+ CARD32 magic B32;
+} xDRI2AuthenticateReq;
+#define sz_xDRI2AuthenticateReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 authenticated B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xDRI2AuthenticateReply;
+#define sz_xDRI2AuthenticateReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+} xDRI2CreateDrawableReq;
+#define sz_xDRI2CreateDrawableReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+} xDRI2DestroyDrawableReq;
+#define sz_xDRI2DestroyDrawableReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 count B32;
+} xDRI2GetBuffersReq;
+#define sz_xDRI2GetBuffersReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 count B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xDRI2GetBuffersReply;
+#define sz_xDRI2GetBuffersReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 region B32;
+ CARD32 dest B32;
+ CARD32 src B32;
+} xDRI2CopyRegionReq;
+#define sz_xDRI2CopyRegionReq 20
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xDRI2CopyRegionReply;
+#define sz_xDRI2CopyRegionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 target_msc_hi B32;
+ CARD32 target_msc_lo B32;
+ CARD32 divisor_hi B32;
+ CARD32 divisor_lo B32;
+ CARD32 remainder_hi B32;
+ CARD32 remainder_lo B32;
+} xDRI2SwapBuffersReq;
+#define sz_xDRI2SwapBuffersReq 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 swap_hi B32;
+ CARD32 swap_lo B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xDRI2SwapBuffersReply;
+#define sz_xDRI2SwapBuffersReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+} xDRI2GetMSCReq;
+#define sz_xDRI2GetMSCReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 target_msc_hi B32;
+ CARD32 target_msc_lo B32;
+ CARD32 divisor_hi B32;
+ CARD32 divisor_lo B32;
+ CARD32 remainder_hi B32;
+ CARD32 remainder_lo B32;
+} xDRI2WaitMSCReq;
+#define sz_xDRI2WaitMSCReq 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 target_sbc_hi B32;
+ CARD32 target_sbc_lo B32;
+} xDRI2WaitSBCReq;
+#define sz_xDRI2WaitSBCReq 16
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+ CARD32 sbc_hi B32;
+ CARD32 sbc_lo B32;
+} xDRI2MSCReply;
+#define sz_xDRI2MSCReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri2ReqType;
+ CARD16 length B16;
+ CARD32 drawable B32;
+ CARD32 interval B32;
+} xDRI2SwapIntervalReq;
+#define sz_xDRI2SwapIntervalReq 12
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+ CARD32 drawable B32;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+ CARD32 sbc_hi B32;
+ CARD32 sbc_lo B32;
+} xDRI2BufferSwapComplete;
+#define sz_xDRI2BufferSwapComplete 32
+
+typedef struct {
+ CARD8 type;
+ CARD8 pad;
+ CARD16 sequenceNumber B16;
+ CARD32 drawable B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xDRI2InvalidateBuffers;
+#define sz_xDRI2InvalidateBuffers 32
+
+#endif
diff --git a/dri2proto/dri2proto.pc.in b/dri2proto/dri2proto.pc.in
new file mode 100644
index 0000000..647416e
--- /dev/null
+++ b/dri2proto/dri2proto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: DRI2Proto
+Description: DRI2 extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/dri2proto/dri2proto.txt b/dri2proto/dri2proto.txt
new file mode 100644
index 0000000..f74792e
--- /dev/null
+++ b/dri2proto/dri2proto.txt
@@ -0,0 +1,873 @@
+ The DRI2 Extension
+ Version 2.0
+ 2008-09-04
+
+ Kristian Høgsberg
+ krh@redhat.com
+ Red Hat, Inc
+
+
+1. Introduction
+
+The DRI2 extension is designed to associate and access auxillary
+rendering buffers with an X drawable.
+
+DRI2 is a essentially a helper extension to support implementation of
+direct rendering drivers/libraries/technologies.
+
+The main consumer of this extension will be a direct rendering OpenGL
+driver, but the DRI2 extension is not designed to be OpenGL specific.
+Direct rendering implementations of OpenVG, Xv, cairo and other
+graphics APIs should find the functionality exposed by this extension
+helpful and hopefully sufficient.
+
+Relation to XF86DRI
+
+
+1.1. Acknowledgements
+
+Kevin E. Martin <kem@redhat.com>
+Keith Packard <keithp@keithp.com>
+Eric Anholt <eric@anholt.net>
+Keith Whitwell <keith@tungstengraphics.com>
+Jerome Glisse <glisse@freedesktop.org>
+Ian Romanick <ian.d.romanick@intel.com>
+Michel Dänzer <michel@tungstengraphics.com>
+Jesse Barnes <jbarnes@virtuousgeek.org>
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+2. DRI2 Concepts
+
+
+2.1. Attachment points
+
+Stolen from OpenGL FBOs, I guess.
+
+
+2.2. Kernel rendering manager
+
+This specification assumes a rendering architechture, where an
+underlying kernel rendering manager that can provide 32 bit integer
+handles to video memory buffers. These handles can be passed between
+processes, which, through a direct rendering driver, submit rendering
+to the kernel rendering manager, targeting and/or sourcing from these
+buffers. This extension provides a means to communicate about such
+buffers as associated with an X drawable.
+
+The details of how the a direct rendering driver use the buffer names
+and submit the rendering requests is outside the scope of this
+specification. However, Appendix B does discuss implementation of
+this specification on the Graphics Execution Manager (GEM).
+
+
+2.3. Request ordering
+
+No ordering between swap buffers and X rendering. X rendering to src
+buffers will block if they have a vblank pending.
+
+
+2.4 Authentication model
+
+The purpose of the DRM authentication scheme is to grant access to the
+kernel rendering manager buffers created by the X server if, and only
+if, the client has access to the X server. This is achieved in a
+three-step protocol:
+
+ 1) The client gets a token from the kernel rendering manager
+ that uniquely identifies it. The token is a 32 bit integer.
+
+ 2) The client passes the token to the X server in the
+ DRI2Authenticate request. This request is a round trip to
+ make sure the X server has received and processed the
+ authentication before the client starts accessing the DRM.
+
+ 3) The X server authorizes the client by passing the token to
+ the kernel rendering manager.
+
+A kernel rendering manager can choose not to implement any
+authentication and just allow access to all buffers.
+
+
+2.5 Rendering to the X front buffer
+
+OpenGL allows the client to render to the front buffer, either by
+using a single-buffered configuration or but explicitly setting the
+draw buffer to GL_FRONT_LEFT. Not allowed!
+
+The client must ask for a fake front buffer, render to that and then
+use DRI2CopyRegion to copy contents back and forth between the fake
+front buffer and the real front buffer. When X and direct rendering
+to a front buffer is interleaved, it is the responsibility of the
+application to synchronize access using glXWaitGL and glXWaitX. A
+DRI2 implementation of direct rendering GLX, should use these enty
+points to copy contents back and forth to as necessary to ensure
+consistent rendering.
+
+The client may also use the DRI2SwapBuffers function to request a swap
+of the front and back buffers. If the display server supports it, this
+operation may be preferred, since it may be easier and/or more performant
+for the server to perform a simple buffer swap rather than a blit.
+
+2.6 Synchronizing rendering
+
+DRI2 provides several methods for synchronizing drawing with various events.
+The protocol for these methods is based on the SGI_video_sync and
+OML_sync_control GLX extensions. Using the DRI2WaitMSC request, a client
+can wait for a specific frame count or divisor/remainder before continuing
+its processing. With the DRI2WaitSBC request, clients can block until a given
+swap count is reached (as incremented by DRI2SwapBuffers). Finally, using
+DRI2SwapBuffers, clients can limit their frame rate by specifying a swap
+interval using the swap interval call (currently only available through GLX)
+or by using the OML swap buffers routine.
+
+2.7 Events
+
+DRI2 provides an event to indicate when a DRI2SwapBuffers request has
+been completed. This can be used to throttle drawing on the client
+side and tie into application main loops.
+
+Another event is generated when the validity of the requested buffers
+changes.
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+3. Data Types
+
+The server side region support specified in the Xfixes extension
+version 2 is used in the CopyRegion request.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+4. Errors
+
+No errors are defined by the DRI2 extension.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+5. Events
+
+The only events provided by DRI2 are DRI2_BufferSwapComplete
+and DRI2InvalidateBuffers.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+6. Protocol Types
+
+DRI2DRIVER { DRI2DriverDRI
+ DRI2DriverVDPAU }
+
+ These values describe the type of driver the client will want
+ to load. The server sends back the name of the driver to use
+ for the screen in question.
+
+DRI2ATTACHMENT { DRI2BufferFrontLeft
+ DRI2BufferBackLeft
+ DRI2BufferFrontRight
+ DRI2BufferBackRight
+ DRI2BufferDepth
+ DRI2BufferStencil
+ DRI2BufferAccum
+ DRI2BufferFakeFrontLeft
+ DRI2BufferFakeFrontRight
+ DRI2BufferDepthStencil }
+
+ These values describe various attachment points for DRI2
+ buffers.
+
+DRI2BUFFER { attachment: CARD32
+ name: CARD32
+ pitch: CARD32
+ cpp: CARD32
+ flags: CARD32 }
+
+ The DRI2BUFFER describes an auxillary rendering buffer
+ associated with an X drawable. 'attachment' describes the
+ attachment point for the buffer, 'name' is the name of the
+ underlying kernel buffer,
+
+
+DRI2ATTACH_FORMAT { attachment: CARD32
+ format: CARD32 }
+
+ The DRI2ATTACH_FORMAT describes an attachment and the associated
+ format. 'attachment' describes the attachment point for the buffer,
+ 'format' describes an opaque, device-dependent format for the buffer.
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+7. Extension Initialization
+
+The name of this extension is "DRI2".
+
+┌───
+ DRI2QueryVersion
+ client-major-version: CARD32
+ client-minor-version: CARD32
+ ▶
+ major-version: CARD32
+ minor-version: CARD32
+└───
+
+ The client sends the highest supported version to the server
+ and the server sends the highest version it supports, but no
+ higher than the requested version. Major versions changes can
+ introduce incompatibilities in existing functionality, minor
+ version changes introduce only backward compatible changes.
+ It is the clients responsibility to ensure that the server
+ supports a version which is compatible with its expectations.
+
+ Backwards compatible changes included addition of new
+ requests, but also new value types in the DRI2CopyRegion
+ request. When new values are introduced, the minor version
+ will be increased so the client can know which values the X
+ server understands from the version number.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+8. Extension Requests
+
+┌───
+ DRI2Connect
+ window: WINDOW
+ driverType: DRI2DRIVER
+ ▶
+ driver: STRING
+ device: STRING
+└───
+
+ Returns the driver name and device file to use for the
+ specified driver type for the screen associated with 'window'.
+
+ 'type' identifies the type of driver to query for.
+
+ 'driver' is the name of the driver to load. The client is
+ assumed to know where to look for the drivers and what to do
+ with it.
+
+ 'device' is the filename of the DRM device file.
+
+ If the client is not local, or the request driver type is
+ unknown or not available, 'driver' and 'device' will be empty
+ strings. We are not using an regular X
+ error here to indicate failure, which will allow the client
+ fall back to other options more easily.
+
+ ISSUE: We could add the list of supported attachments and the
+ supported DRI2CopyRegion values here (just the bitmask of all
+ supported values).
+
+┌───
+ DRI2Authenticate
+ window: WINDOW
+ token: CARD32
+ ▶
+ authenticated: CARD32
+└───
+ Errors: Window
+
+ Request that the X server authenticates 'token', allowing the
+ client to access the DRM buffers created by the X server on
+ the screen associated with 'window'.
+
+ Authentication shouldn't fail at this point, except if an
+ invalid token is passed, in which case authenticated is False.
+
+┌───
+ DRI2GetBuffers
+ drawable: DRAWABLE
+ attachments: LISTofDRI2ATTACHMENTS
+ ▶
+ width, height: CARD32
+ buffers: LISTofDRI2BUFFER
+└───
+ Errors: Window
+
+ Get buffers for the provided attachment points for the given
+ drawable.
+
+ If the DDX driver does not support one or more of the
+ specified attachment points, a Value error is generated, with
+ the first unsupported attachment point as the error value.
+
+ 'width' and 'height' describes the dimensions of the drawable.
+
+ 'buffers' is a list of DRI2BUFFER for the given DRI2
+ attachment points.
+
+┌───
+ DRI2CopyRegion
+ drawable: DRAWABLE
+ region: REGION
+ source: DRI2ATTACHMENT
+ destination: DRI2ATTACHMENT
+ ▶
+└───
+ Errors: Window, Value
+
+ Schedule a copy from one DRI2 buffer to another.
+
+ The DRICopyRegion request has a reply but it is empty. The
+ reply is there to let the direct rendering client wait until
+ the server has seen the request before proceeding with
+ rendering the next frame.
+
+┌───
+ DRI2SwapBuffers
+ drawable: DRAWABLE
+ ▶
+ count: two CARD32s
+└───
+ Errors: Window
+
+ Schedule a swap of the front and back buffers with the display
+ server.
+
+ Returns the swap count value when the swap will actually occur (e.g.
+ the last queued swap count + (pending swap count * swap interval)).
+
+ This request is only available with protocol version 1.2 or
+ later.
+
+┌───
+ DRI2GetBuffersWithFormat
+ drawable: DRAWABLE
+ attachments: LISTofDRI2ATTACH_FORMAT
+ ▶
+ width, height: CARD32
+ buffers: LISTofDRI2BUFFER
+└───
+ Errors: Window
+
+ Get buffers for the provided attachment points with the specified
+ formats for the given drawable.
+
+ If the DDX driver does not support one or more of the
+ specified attachment points or formats, a Value error is generated,
+ with the first unsupported attachment point as the error value.
+
+ 'width' and 'height' describes the dimensions of the drawable.
+
+ 'buffers' is a list of DRI2BUFFER for the given DRI2
+ attachment points.
+
+ This request is only available with protocol version 1.1 or
+ later.
+
+┌───
+ DRI2GetMSC
+ drawable: DRAWABLE
+ ▶
+ ust, msc, sbc: CARD64
+└───
+ Errors: Window
+
+ Get the current media stamp counter (MSC) and swap buffer count (SBC)
+ along with the unadjusted system time (UST) when the MSC was last
+ incremented.
+
+ This request is only available with protocol version 1.2 or
+ later.
+
+┌───
+ DRI2WaitMSC
+ drawable: DRAWABLE
+ target_msc: two CARD32s
+ divisor: two CARD32s
+ remainder: two CARD32s
+ ▶
+ ust, msc, sbc: CARD64
+└───
+ Errors: Window
+
+ Blocks the client until either the frame count reaches target_msc or,
+ if the frame count is already greater than target_msc when the request
+ is received, until the frame count % divisor = remainder. If divisor
+ is 0, the client will be unblocked if the frame count is greater than
+ or equal to the target_msc.
+
+ Returns the current media stamp counter (MSC) and swap buffer count
+ (SBC) along with the unadjusted system time (UST) when the MSC was last
+ incremented.
+
+ This request is only available with protocol version 1.2 or
+ later.
+
+┌───
+ DRI2WaitSBC
+ drawable: DRAWABLE
+ target_sbc: two CARD32s
+ ▶
+ ust, msc, sbc: CARD64
+└───
+ Errors: Window
+
+ Blocks the client until the swap buffer count reaches target_sbc. If
+ the swap buffer count is already greater than or equal to target_sbc
+ when the request is recieved, this request will return immediately.
+
+ If target_sbc is 0, this request will block the client until all
+ previous DRI2SwapBuffers requests have completed.
+
+ Returns the current media stamp counter (MSC) and swap buffer count
+ (SBC) along with the unadjusted system time (UST) when the MSC was last
+ incremented.
+
+ This request is only available with protocol version 1.2 or
+ later.
+
+┌───
+ DRI2SwapInterval
+ drawable: DRAWABLE
+ interval: CARD32
+ ▶
+└───
+ Errors: Window
+
+ Sets the swap interval for DRAWABLE. This will throttle
+ DRI2SwapBuffers requests to swap at most once per interval frames,
+ which is useful useful for limiting the frame rate.
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+9. Extension Events
+
+┌───
+ DRI2BufferSwapComplete
+ ▶
+ event_type: CARD16
+ drawable: CARD32
+ ust: CARD64
+ msc: CARD64
+ sbc: CARD64
+└───
+
+ This event reports the status of the last DRI2SwapBuffers event to
+ the client. The event type should be one of DRI2_EXCHANGE_COMPLETE,
+ indicating a successful buffer exchange, DRI2_BLIT_COMPLETE, indicating
+ the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating
+ a full page flip was completed.
+
+┌───
+ DRI2InvalidateBuffers
+ ▶
+ drawable: CARD32
+└───
+
+ This event is generated when the buffers the client had
+ requested for 'drawable' (with DRI2GetBuffers or
+ DRI2GetBuffersWithFormat) become inappropriate because they
+ don't match the drawable dimensions anymore, or a buffer swap
+ has been performed.
+
+ Note that the server is only required to warn the client once
+ about this condition, until the client takes care of bringing
+ them back up-to-date with another GetBuffers request.
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+10. Extension Versioning
+
+The DRI2 extension has undergone a number of revisions before
+
+ 1.0: Released, but never used. Relied on a number of
+ constructs from the XF86DRI extension, such as a
+ shared memory area (SAREA) to communicate changes in
+ cliprects and window sizes, and
+
+ 1.99.1: Move the swap buffer functionality into the X server,
+ introduce SwapBuffer request to copy back buffer
+ contents to the X drawable.
+
+ 1.99.2: Rethink the SwapBuffer request as an asynchronous
+ request to copy a region between DRI2 buffers. Drop
+ CreateDrawable and DestroyDrawable, update Connect to
+ support different driver types and to send the
+ authentication group.
+
+ 1.99.3: Drop the bitmask argument intended to indicate
+ presence of optional arguments for CopyRegion.
+
+ 2.0: Awesomeness!
+
+ 2.1: True excellence. Added DRI2GetBuffersWithFormat to allow
+ more flexible object creation.
+
+ 2.2: Approaching perfection. Added requests for swapbuffers,
+ MSC and SBC related requests, and events.
+
+ 2.3: Added the DRI2InvalidateBuffers event.
+
+Compatibility up to 2.0 is not preserved, but was also never released.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+11. Relationship with other extensions
+
+As an extension designed to support other extensions, there is
+naturally some interactions with other extensions.
+
+
+11.1 GLX
+
+The GL auxilary buffers map directly to the DRI2 buffers... eh
+
+
+11.2 DBE
+
+The DBE back buffer must correspond to the DRI2_BUFFER_FRONT_LEFT
+DRI2 buffer for servers that support both DBE and DRI2.
+
+
+11.3 XvMC / Xv
+
+We might add a DRI2_BUFFER_YUV to do vsynced colorspace conversion
+blits. Maybe... not really sure.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+Appendix A. Protocol Encoding
+
+Syntactic Conventions
+
+This document uses the same syntactic conventions as the core X
+protocol encoding document.
+
+
+A.1 Common Types
+
+┌───
+ DRI2DRIVER
+ 0x0 DRI2DriverDRI
+ 0x1 DRI2DriverVDPAU
+└───
+
+┌───
+ DRI2ATTACHMENT
+ 0x0 DRI2BufferFrontLeft
+ 0x1 DRI2BufferBackLeft
+ 0x2 DRI2BufferFrontRight
+ 0x3 DRI2BufferBackRight
+ 0x4 DRI2BufferDepth
+ 0x5 DRI2BufferStencil
+ 0x6 DRI2BufferAccum
+ 0x7 DRI2BufferFakeFrontLeft
+ 0x8 DRI2BufferFakeFrontRight
+ 0x9 DRI2BufferDepthStencil
+└───
+ Used to encode the possible attachment points. The attachment
+ DRI2BufferDepthStencil is only available with protocol version 1.1 or
+ later.
+
+┌───
+ DRI2BUFFER
+ 4 CARD32 attachment
+ 4 CARD32 name
+ 4 CARD32 pitch
+ 4 CARD32 cpp
+ 4 CARD32 flags
+└───
+ A DRI2 buffer specifies the attachment, the kernel memory
+ manager name, the pitch and chars per pixel for a buffer
+ attached to a given drawable.
+
+┌───
+ DRI2ATTACH_FORMAT
+ 4 CARD32 attachment
+ 4 CARD32 format
+└───
+ Used to describe the attachment and format requested from the server.
+ This data type is only available with protocol version 1.1 or
+ later.
+
+A.2 Protocol Requests
+
+┌───
+ DRI2QueryVersion
+ 1 CARD8 major opcode
+ 1 0 DRI2 opcode
+ 2 3 length
+ 4 CARD32 major version
+ 4 CARD32 minor version
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 major version
+ 4 CARD32 minor version
+ 16 unused
+└───
+
+┌───
+ DRI2Connect
+ 1 CARD8 major opcode
+ 1 1 DRI2 opcode
+ 2 3+(n+p)/4 length
+ 4 WINDOW window
+ 4 CARD32 driver type
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 (n+m+p)/4 reply length
+ 4 n driver name length
+ 4 m device name length
+ 16 unused
+ n CARD8 driver name
+ m CARD8 device name
+ p unused, p=pad(n+m)
+└───
+
+┌───
+ DRI2Authenticate
+ 1 CARD8 major opcode
+ 1 2 DRI2 opcode
+ 2 3 length
+ 4 WINDOW window
+ 4 CARD32 authentication token
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 authenticated
+ 20 unused
+└───
+
+┌───
+ DRI2GetBuffers
+ 1 CARD8 major opcode
+ 1 3 DRI2 opcode
+ 2 3 length
+ 4 DRAWABLE drawable
+ 4 n number of attachments
+ 4n LISTofDRI2ATTACHMENTS attachments
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 width of drawable
+ 4 CARD32 height of drawable
+ 4 CARD32 buffer count
+ 12 unused
+ 5n LISTofDRI2BUFFER buffers
+└───
+
+┌───
+ DRI2CopyRegion
+ 1 CARD8 major opcode
+ 1 4 DRI2 opcode
+ 2 3 length
+ 4 DRAWABLE drawable
+ 4 REGION region
+ 4 DRI2ATTACHMENT source
+ 4 DRI2ATTACHMENT destination
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 24 unused
+└───
+
+┌───
+ DRI2GetBuffersWithFormat
+ 1 CARD8 major opcode
+ 1 3 DRI2 opcode
+ 2 3 length
+ 4 DRAWABLE drawable
+ 4 n number of attachments
+ 8n LISTofDRI2ATTACH_FORMAT attachments and formats
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 width of drawable
+ 4 CARD32 height of drawable
+ 4 CARD32 buffer count
+ 12 unused
+ 5n LISTofDRI2BUFFER buffers
+└───
+
+┌───
+ DRI2SwapBuffers
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 buffer count
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 5n LISTofDRI2BUFFER buffers
+└───
+
+┌───
+ DRI2SwapBuffers
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ 4 CARD32 target_msc_hi
+ 4 CARD32 target_msc_lo
+ 4 CARD32 divisor_hi
+ 4 CARD32 divisor_lo
+ 4 CARD32 remainder_hi
+ 4 CARD32 remainder_lo
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 swap_hi
+ 4 CARD32 swap_lo
+ 5n LISTofDRI2BUFFER buffers
+└───
+
+┌───
+ DRI2GetMSC
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 ust_hi
+ 4 CARD32 ust_lo
+ 4 CARD32 msc_hi
+ 4 CARD32 msc_lo
+ 4 CARD32 sbc_hi
+ 4 CARD32 sbc_lo
+└───
+
+┌───
+ DRI2WaitMSC
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ 4 CARD32 target_msc_hi
+ 4 CARD32 target_msc_lo
+ 4 CARD32 divisor_hi
+ 4 CARD32 divisor_lo
+ 4 CARD32 remainder_hi
+ 4 CARD32 remainder_lo
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 ust_hi
+ 4 CARD32 ust_lo
+ 4 CARD32 msc_hi
+ 4 CARD32 msc_lo
+ 4 CARD32 sbc_hi
+ 4 CARD32 sbc_lo
+└───
+
+┌───
+ DRI2WaitSBC
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ 4 CARD32 swap_hi
+ 4 CARD32 swap_lo
+ ▶
+ 1 1 Reply
+ 1 unused
+ 2 CARD16 sequence number
+ 4 0 reply length
+ 4 CARD32 ust_hi
+ 4 CARD32 ust_lo
+ 4 CARD32 msc_hi
+ 4 CARD32 msc_lo
+ 4 CARD32 sbc_hi
+ 4 CARD32 sbc_lo
+└───
+
+┌───
+ DRI2SwapInterval
+ 1 CARD8 major opcode
+ 1 7 DRI2 opcode
+ 2 8 length
+ 4 DRAWABLE drawable
+ 4 CARD32 interval
+ ▶
+└───
+
+A.3 Protocol Events
+
+The DRI2 extension specifies DRI2_BufferSwapComplete and
+DRI2_InvalidateBuffers events.
+
+┌───
+ DRI2_BufferSwapComplete
+ 1 CARD8 type
+ 1 CARD8 extension
+ 2 CARD16 sequenceNumber
+ 2 CARD16 event_type
+ 4 DRAWABLE drawable
+ 4 CARD32 ust_hi
+ 4 CARD32 ust_lo
+ 4 CARD32 msc_hi
+ 4 CARD32 msc_lo
+ 4 CARD32 sbc_hi
+ 4 CARD32 sbc_lo
+└───
+
+
+┌───
+ DRI2_InvalidateBuffers
+ 1 CARD8 type
+ 1 CARD8 extension
+ 2 CARD16 sequenceNumber
+ 4 DRAWABLE drawable
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+ 4 CARD32 unused
+└───
+
+A.4 Protocol Errors
+
+The DRI2 extension specifies no errors.
+
+
+ ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
+
+
+Appendix B. Implementation on GEM
+
+Where to begin...
diff --git a/dri2proto/dri2tokens.h b/dri2proto/dri2tokens.h
new file mode 100644
index 0000000..7804e4d
--- /dev/null
+++ b/dri2proto/dri2tokens.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL 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 PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ * Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_TOKENS_H_
+#define _DRI2_TOKENS_H_
+
+#define DRI2BufferFrontLeft 0
+#define DRI2BufferBackLeft 1
+#define DRI2BufferFrontRight 2
+#define DRI2BufferBackRight 3
+#define DRI2BufferDepth 4
+#define DRI2BufferStencil 5
+#define DRI2BufferAccum 6
+#define DRI2BufferFakeFrontLeft 7
+#define DRI2BufferFakeFrontRight 8
+#define DRI2BufferDepthStencil 9
+
+#define DRI2DriverDRI 0
+#define DRI2DriverVDPAU 1
+
+/* Event sub-types for the swap complete event */
+#define DRI2_EXCHANGE_COMPLETE 0x1
+#define DRI2_BLIT_COMPLETE 0x2
+#define DRI2_FLIP_COMPLETE 0x3
+
+#endif
diff --git a/evieproto/.gitignore b/evieproto/.gitignore
new file mode 100644
index 0000000..24f0fd9
--- /dev/null
+++ b/evieproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for evieproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/evieproto/COPYING b/evieproto/COPYING
new file mode 100644
index 0000000..2c05030
--- /dev/null
+++ b/evieproto/COPYING
@@ -0,0 +1,20 @@
+Copyright 2003 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.
diff --git a/evieproto/Makefile.am b/evieproto/Makefile.am
new file mode 100644
index 0000000..6de80c3
--- /dev/null
+++ b/evieproto/Makefile.am
@@ -0,0 +1,21 @@
+eviedir = $(includedir)/X11/extensions
+evie_HEADERS = \
+ evieproto.h \
+ Xeviestr.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = evieproto.pc
+
+EXTRA_DIST = evieproto.pc.in
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/evieproto/README b/evieproto/README
new file mode 100644
index 0000000..e49ea91
--- /dev/null
+++ b/evieproto/README
@@ -0,0 +1,31 @@
+ Extended Visual Information Extension (XEVIE)
+
+
+This extension defines a protocol for a client to determine information
+about core X visuals beyond what the core protocol provides.
+
+Extension name: XEVIE
+
+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/proto/evieproto
+
+ http://cgit.freedesktop.org/xorg/proto/evieproto
+
+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/evieproto/Xeviestr.h b/evieproto/Xeviestr.h
new file mode 100644
index 0000000..78871f1
--- /dev/null
+++ b/evieproto/Xeviestr.h
@@ -0,0 +1,3 @@
+#warning "Xeviestr.h is obsolete and may be removed in the future."
+#warning "include <X11/extensions/evieproto.h> for the protocol defines."
+#include <X11/extensions/evieproto.h>
diff --git a/evieproto/autogen.sh b/evieproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/evieproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/evieproto/configure.ac b/evieproto/configure.ac
new file mode 100644
index 0000000..9d6e33f
--- /dev/null
+++ b/evieproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.57])
+AC_INIT([EvIEExt], [1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ evieproto.pc])
diff --git a/evieproto/evieproto.h b/evieproto/evieproto.h
new file mode 100644
index 0000000..3f0ec18
--- /dev/null
+++ b/evieproto/evieproto.h
@@ -0,0 +1,156 @@
+/************************************************************
+
+Copyright 2003 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.
+
+************************************************************/
+
+#ifndef _XEVIEPROTO_H_
+#define _XEVIEPROTO_H_
+
+#define XEVIENAME "XEVIE"
+
+#define XEVIE_MAJOR_VERSION 1
+#define XEVIE_MINOR_VERSION 0
+
+#define X_XevieQueryVersion 0
+#define X_XevieStart 1
+#define X_XevieEnd 2
+#define X_XevieSend 3
+#define X_XevieSelectInput 4
+
+#define XevieNumberErrors 0
+
+typedef struct _XevieQueryVersion {
+ CARD8 reqType;
+ CARD8 xevieReqType;
+ CARD16 length B16;
+ CARD16 client_major_version B16;
+ CARD16 client_minor_version B16;
+} xXevieQueryVersionReq;
+#define sz_xXevieQueryVersionReq 8
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD16 server_major_version B16;
+ CARD16 server_minor_version B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXevieQueryVersionReply;
+#define sz_xXevieQueryVersionReply 32
+
+typedef struct _XevieStart {
+ CARD8 reqType;
+ CARD8 xevieReqType;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xXevieStartReq;
+#define sz_xXevieStartReq 8
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXevieStartReply;
+#define sz_xXevieStartReply 32
+
+typedef struct _XevieEnd {
+ CARD8 reqType;
+ CARD8 xevieReqType;
+ CARD16 length B16;
+ CARD32 cmap B32;
+} xXevieEndReq;
+#define sz_xXevieEndReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXevieEndReply;
+#define sz_xXevieEndReply 32
+
+typedef struct _XevieSend {
+ CARD8 reqType;
+ CARD8 xevieReqType;
+ CARD16 length B16;
+ xEvent event;
+ CARD32 dataType B32;
+} xXevieSendReq;
+#define sz_xXevieSendReq 104
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXevieSendReply;
+#define sz_xXevieSendReply 32
+
+typedef struct _XevieSelectInput {
+ CARD8 reqType;
+ CARD8 xevieReqType;
+ CARD16 length B16;
+ CARD32 event_mask B32;
+} xXevieSelectInputReq;
+#define sz_xXevieSelectInputReq 8
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequence_number B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xXevieSelectInputReply;
+#define sz_xXevieSelectInputReply 32
+
+#endif /* } _XEVIEPROTO_H_ */
+
diff --git a/evieproto/evieproto.pc.in b/evieproto/evieproto.pc.in
new file mode 100644
index 0000000..795a1cd
--- /dev/null
+++ b/evieproto/evieproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: EvIEExt
+Description: EvIE extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/fixesproto/.gitignore b/fixesproto/.gitignore
new file mode 100644
index 0000000..edc43df
--- /dev/null
+++ b/fixesproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for fixesproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/fixesproto/AUTHORS b/fixesproto/AUTHORS
new file mode 100644
index 0000000..8e18f9b
--- /dev/null
+++ b/fixesproto/AUTHORS
@@ -0,0 +1 @@
+Keith Packard, HP
diff --git a/fixesproto/COPYING b/fixesproto/COPYING
new file mode 100644
index 0000000..6f42002
--- /dev/null
+++ b/fixesproto/COPYING
@@ -0,0 +1,41 @@
+Copyright © 2006 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.
+
+Copyright © 2001,2003 Keith Packard
+
+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, and that the name of Keith Packard not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission. Keith Packard makes no
+representations about the suitability of this software for any purpose. It
+is provided "as is" without express or implied warranty.
+
+KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL KEITH 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.
+
diff --git a/fixesproto/Makefile.am b/fixesproto/Makefile.am
new file mode 100644
index 0000000..f1716b0
--- /dev/null
+++ b/fixesproto/Makefile.am
@@ -0,0 +1,43 @@
+#
+# Copyright © 2003 Keith Packard, Noah Levitt
+#
+# 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, and that the name of Keith Packard not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. Keith Packard makes no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL KEITH 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.
+
+fixesdir = $(includedir)/X11/extensions
+fixes_HEADERS = \
+ xfixesproto.h \
+ xfixeswire.h
+
+dist_doc_DATA = fixesproto.txt
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = fixesproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/fixesproto/README b/fixesproto/README
new file mode 100644
index 0000000..99604e4
--- /dev/null
+++ b/fixesproto/README
@@ -0,0 +1,31 @@
+ X Fixes Extension
+
+The extension makes changes to many areas of the protocol to resolve
+issues raised by application interaction with core protocol mechanisms
+that cannot be adequately worked around on the client side of the wire.
+
+Extension name: XFIXES
+
+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/proto/fixesproto
+
+ http://cgit.freedesktop.org/xorg/proto/fixesproto
+
+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/fixesproto/autogen.sh b/fixesproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/fixesproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/fixesproto/configure.ac b/fixesproto/configure.ac
new file mode 100644
index 0000000..04a9feb
--- /dev/null
+++ b/fixesproto/configure.ac
@@ -0,0 +1,37 @@
+dnl
+dnl Copyright © 2003 Keith Packard, Noah Levitt
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation, and that the name of Keith Packard not be used in
+dnl advertising or publicity pertaining to distribution of the software without
+dnl specific, written prior permission. Keith Packard makes no
+dnl representations about the suitability of this software for any purpose. It
+dnl is provided "as is" without express or implied warranty.
+dnl
+dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+dnl PERFORMANCE OF THIS SOFTWARE.
+dnl
+dnl Process this file with autoconf to create configure.
+
+AC_PREREQ([2.60])
+AC_INIT([FixesProto], [4.1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ fixesproto.pc])
+
diff --git a/fixesproto/fixesproto.pc.in b/fixesproto/fixesproto.pc.in
new file mode 100644
index 0000000..fabce86
--- /dev/null
+++ b/fixesproto/fixesproto.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: FixesProto
+Description: X Fixes extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
+Requires: xextproto >= 7.0.99.1
diff --git a/fixesproto/fixesproto.txt b/fixesproto/fixesproto.txt
new file mode 100644
index 0000000..5ef8153
--- /dev/null
+++ b/fixesproto/fixesproto.txt
@@ -0,0 +1,577 @@
+ The XFIXES Extension
+ Version 4.0
+ Document Revision 2
+ 2006-12-14
+ Keith Packard
+ keithp@keithp.com
+
+1. Introduction
+
+X applications have often needed to work around various shortcomings in the
+core X window system. This extension is designed to provide the minimal
+server-side support necessary to eliminate problems caused by these
+workarounds.
+
+2. Acknowledgements
+
+This extension is a direct result of requests made by application
+developers, in particular,
+
+ + Owen Taylor for describing the issues raised with the XEMBED
+ mechanisms and SaveSet processing and his initial extension
+ to handle this issue.
+
+ + Bill Haneman for the design for cursor image tracking.
+
+ + Havoc Pennington
+
+ + Fredrik Höglund for cursor names
+
+ + Deron Johnson for cursor visibility
+
+3. Basic Premise
+
+Requests in this extension may seem to wander all over the map of X server
+capabilities, but they are tied by a simple rule -- resolving issues raised
+by application interaction with core protocol mechanisms that cannot be
+adequately worked around on the client side of the wire.
+
+4. Extension initialization
+
+The client must negotiate the version of the extension before executing
+extension requests. Behavior of the server is undefined otherwise.
+
+QueryVersion
+
+ client-major-version: CARD32
+ client-minor-version: CARD32
+
+ ->
+
+ major-version: CARD32
+ minor-version: CARD32
+
+ The client sends the highest supported version to the server and
+ the server sends the highest version it supports, but no higher than
+ the requested version. Major versions changes can introduce
+ new requests, minor version changes introduce only adjustments to
+ existing requests or backward compatible changes. It is
+ the clients responsibility to ensure that the server supports
+ a version which is compatible with its expectations.
+
+************* XFIXES VERSION 1 OR BETTER ***********
+
+5. Save Set processing changes
+
+Embedding one application within another provides a way of unifying
+disparate documents and views within a single framework. From the X
+protocol perspective, this appears similar to nested window managers; the
+embedding application "manages" the embedded windows much as a window
+manager does for top-level windows. To protect the embedded application
+from embedding application failure, it is reasonable to use the core SaveSet
+mechanism so that embedding application failure causes embedded windows to
+be preserved instead of destroyed.
+
+The core save set mechanism defines the target for each save set member
+window as the nearest enclosing window not owned by the terminating client.
+For embedding applications, this nearest window is usually the window
+manager frame. The problem here is that the window manager will not
+generally expect to receive and correctly manage new windows appearing within
+that window by the save set mechanism, and will instead destroy the frame
+window in response to the client window destruction. This causes the
+embedded window to be destroyed.
+
+An easy fix for this problem is to change the target of the save set member
+to a window which won't be affected by the underlying window destruction.
+XFIXES chooses the root window as the target.
+
+Having embedded windows suddenly appear at the top level can confuse users,
+so XFIXES also lets the client select whether the window should end up
+unmapped after the save set processing instead of unconditionally making
+them be mapped.
+
+5.1 Requests
+
+ChangeSaveSet
+
+ window: Window
+ mode: { Insert, Delete }
+ target: { Nearest, Root }
+ map: { Map, Unmap }
+
+ ChangeSaveSet is an extension of the core protocol ChangeSaveSet
+ request. As in that request, mode specifies whether the indicated
+ window is inserted or deleted from the save-set. Target specifies
+ whether the window is reparented to the nearest non-client window as
+ in the core protocol, or reparented to the root window. Map
+ specifies whether the window is mapped as in the core protocol or
+ unmapped.
+
+6. Selection Tracking
+
+Applications wishing to monitor the contents of current selections must
+poll for selection changes. XFIXES improves this by providing an event
+delivered whenever the selection ownership changes.
+
+6.1 Types
+
+ SELECTIONEVENT { SetSelectionOwner,
+ SelectionWindowDestroy,
+ SelectionClientClose }
+
+6.1 Events
+
+SelectionNotify
+
+ subtype: SELECTIONEVENT
+ window: Window
+ owner: Window
+ selection: Atom
+ timestamp: Timestamp
+ selection-timestamp: Timestamp
+
+6.2 Requests
+
+SelectSelectionInput
+
+ window: Window
+ selection: Atom
+ event-mask: SETofSELECTIONEVENT
+
+ Selects for events to be delivered to window when various causes of
+ ownership of selection occur. Subtype indicates the cause of the
+ selection ownership change. Owner is set to the current selection
+ owner, or None. Timestamp indicates the time the event was
+ generated while selection-timestamp indicates the timestamp used to
+ own the selection.
+
+7. Cursor Image Monitoring
+
+Mirroring the screen contents is easily done with the core protocol or VNC
+addons, except for the current cursor image. There is no way using the core
+protocol to discover which cursor image is currently displayed. The
+cursor image often contains significant semantic content about the user
+interface. XFIXES provides a simple mechanism to discover when the cursor
+image changes and to fetch the current cursor image.
+
+As the current cursor may or may not have any XID associated with it, there
+is no stable name available. Instead, XFIXES returns only the image of the
+current cursor and provides a way to identify cursor images to avoid
+refetching the image each time it changes to a previously seen cursor.
+
+7.1 Types
+ CURSOREVENT { DisplayCursor }
+
+7.2 Events
+
+CursorNotify
+
+ subtype: CURSOREVENT
+ window: Window
+ cursor-serial: CARD32
+ timestamp: Timestamp
+ name: Atom (Version 2 only)
+
+7.3 Requests
+
+SelectCursorInput
+
+ window: Window
+ event-mask: SETofCURSOREVENT
+
+ This request directs cursor change events to the named window.
+ Events will be delivered irrespective of the screen on which they
+ occur. Subtype indicates the cause of the cursor image change
+ (there is only one subtype at present). Cursor-serial is a number
+ assigned to the cursor image which identifies the image. Cursors
+ with different serial numbers may have different images. Timestamp
+ is the time of the cursor change.
+
+ Servers supporting the X Input Extension Version 2.0 or higher only
+ notify the clients of cursor change events for the ClientPointer, not
+ of any other master pointer (see Section 4.4. in the XI2 protocol
+ specificiation).
+
+GetCursorImage
+
+ ->
+
+ x: INT16
+ y: INT16
+ width: CARD16
+ height: CARD16
+ x-hot: CARD16
+ y-hot: CARD16
+ cursor-serial: CARD32
+ cursor-image: LISTofCARD32
+
+ GetCursorImage returns the image of the current cursor. X and y are
+ the current cursor position. Width and height are the size of the
+ cursor image. X-hot and y-hot mark the hotspot within the cursor
+ image. Cursor-serial provides the number assigned to this cursor
+ image, this same serial number will be reported in a CursorNotify
+ event if this cursor image is redisplayed in the future.
+
+ The cursor image itself is returned as a single image at 32 bits per
+ pixel with 8 bits of alpha in the most significant 8 bits of the
+ pixel followed by 8 bits each of red, green and finally 8 bits of
+ blue in the least significant 8 bits. The color components are
+ pre-multiplied with the alpha component.
+
+************* XFIXES VERSION 2 OR BETTER ***********
+
+8. Region Objects
+
+The core protocol doesn't expose regions as a primitive object and this
+makes many operations more complicated than they really need to be. Adding
+region objects simplifies expose handling, the Shape extension and other
+operations. These operations are also designed to support a separate
+extension, the X Damage Extension.
+
+8.1 Types
+
+ Region: XID
+ WINDOW_REGION_KIND: { Bounding, Clip }
+
+8.2 Errors
+
+ Region The specified region is invalid
+
+8.3 Requests
+
+CreateRegion
+
+ region: REGION
+ rects: LISTofRECTANGLE
+
+ Creates a region initialized to the specified list of rectangles.
+ The rectangles may be specified in any order, their union becomes
+ the region. The core protocol allows applications to specify an
+ order for the rectangles, but it turns out to be just as hard to
+ verify the rectangles are actually in that order as it is to simply
+ ignore the ordering information and union them together. Hence,
+ this request dispenses with the ordering information.
+
+ Errors: IDChoice
+
+CreateRegionFromBitmap
+
+ region: REGION
+ bitmap: PIXMAP
+
+ Creates a region initialized to the set of 'one' pixels in bitmap
+ (which must be depth 1, else Match error).
+
+ Errors: Pixmap, IDChoice, Match
+
+CreateRegionFromWindow
+
+ window: Window
+ kind: WINDOW_REGION_KIND
+ region: Region
+
+ Creates a region initialized to the specified window region. See the
+ Shape extension for the definition of Bounding and Clip regions.
+
+ Errors: Window, IDChoice, Value
+
+CreateRegionFromGC
+
+ gc: GContext
+ region: Region
+
+ Creates a region initialized from the clip list of the specified
+ GContext.
+
+ Errors: GContext, IDChoice
+
+CreateRegionFromPicture
+
+ picture: Picture
+ region: Region
+
+
+ Creates a region initialized from the clip list of the specified
+ Picture.
+
+ Errors: Picture, IDChoice
+
+DestroyRegion
+
+ region: Region
+
+ Destroys the specified region.
+
+ Errors: Region
+
+SetRegion
+
+ region: Region
+ rects: LISTofRECTANGLE
+
+ This replaces the current contents of region with the region formed
+ by the union of rects.
+
+CopyRegion
+ source: Region
+ destination: Region
+
+ This replaces the contents of destination with the contents of
+ source.
+
+UnionRegion
+IntersectRegion
+SubtractRegion
+
+ source1: Region
+ source2: Region
+ destination: Region
+
+ Combines source1 and source2, placing the result in destination.
+ Destination may be the same as either source1 or source2.
+
+ Errors: Region, Value
+
+InvertRegion
+
+ source: Region
+ bounds: RECTANGLE
+ destination: Region
+
+ The source region is subtracted from the region specified by
+ bounds. The result is placed in destination, replacing its contents.
+
+ Errors: Region
+
+TranslateRegion
+
+ region: Region
+ dx, dy: INT16
+
+ The region is translated by dx, dy in place.
+
+ Errors: Region
+
+RegionExtents
+
+ source: Region
+ destination: Region
+
+ The extents of the source region are placed in the destination
+
+FetchRegion
+
+ region: Region
+ ->
+ extents: RECTANGLE
+ rectangles: LISTofRECTANGLE
+
+ The region is returned as a list of rectangles in YX-banded order.
+
+ Errors: Region
+
+SetGCClipRegion
+
+ gc: GCONTEXT
+ clip-x-origin, clip-y-origin: INT16
+ region: Region or None
+
+ This request changes clip-mask in gc to the specified region and
+ sets the clip origin. Output will be clipped to remain contained
+ within the region. The clip origin is interpreted relative to the
+ origin of whatever destination drawable is specified in a graphics
+ request. The region is interpreted relative to the clip origin.
+ Future changes to region have no effect on the gc clip-mask.
+
+ Errors: GContext, Region
+
+SetWindowShapeRegion
+
+ dest: Window
+ destKind: SHAPE_KIND
+ xOff, yOff: INT16
+ region: Region or None
+
+ This request sets the specified (by destKind) Shape extension region
+ of the window to region, offset by xOff and yOff. Future changes to
+ region have no effect on the window shape.
+
+ Errors: Window, Value, Region
+
+SetPictureClipRegion
+
+ picture: Picture
+ clip-x-origin, clip-y-origin: INT16
+ region: Region or None
+
+ This request changes clip-mask in picture to the specified region
+ and sets the clip origin. Input and output will be clipped to
+ remain contained within the region. The clip origin is interpreted
+ relative to the origin of the drawable associated with picture. The
+ region is interpreted relative to the clip origin. Future changes
+ to region have no effect on the picture clip-mask.
+
+ Errors: Picture, Region
+
+9. Cursor Names
+
+Attaching names to cursors permits some abstract semantic content to be
+associated with specific cursor images. Reflecting those names back to
+applications allows that semantic content to be related to the user through
+non-visual means.
+
+9.1 Events
+
+CursorNotify
+
+ subtype: CURSOREVENT
+ window: Window
+ cursor-serial: CARD32
+ timestamp: Timestamp
+ name: Atom or None
+
+ In Version 2 of the XFIXES protocol, this event adds the atom
+ of any name associated with the current cursor (else None).
+
+9.2 Requests
+
+SetCursorName
+
+ cursor: CURSOR
+ name: LISTofCARD8
+
+ This request interns name as an atom and sets that atom as the name
+ of cursor.
+
+ Errors: Cursor
+
+GetCursorName
+
+ cursor: CURSOR
+ ->
+ atom: ATOM or None
+ name: LISTofCARD8
+
+ This request returns the name and atom of cursor. If no name is
+ set, atom is None and name is empty.
+
+ Errors: Cursor
+
+GetCursorImageAndName
+
+ ->
+
+ x: INT16
+ y: INT16
+ width: CARD16
+ height: CARD16
+ x-hot: CARD16
+ y-hot: CARD16
+ cursor-serial: CARD32
+ cursor-atom: ATOM
+ cursor-name: LISTofCARD8
+ cursor-image: LISTofCARD32
+
+ This is similar to GetCursorImage except for including both
+ the atom and name of the current cursor.
+
+ChangeCursor
+
+ source, destination: CURSOR
+
+ This request replaces all references to the destination with a
+ reference to source. Any existing uses of the destination cursor
+ object will now show the source cursor image.
+
+ChangeCursorByName
+
+ src: CURSOR
+ name: LISTofCARD8
+
+ This request replaces the contents of all cursors with the specified
+ name with the src cursor.
+
+************* XFIXES VERSION 3 OR BETTER ***********
+
+10. Region Expansion
+
+This update provides another operation on the region objects defined in
+Section 8 of this document.
+
+10.1 Requests
+
+ExpandRegion
+ source: REGION
+ destination: REGION
+ left, right, top, bottom: CARD16
+
+ Creates destination region containing the area specified by
+ expanding each rectangle in the source region by the specified
+ number of pixels to the left, right, top and bottom.
+
+************* XFIXES VERSION 4 OR BETTER ***********
+
+11. Cursor Visibility
+
+Composite managers may want to render the cursor themselves instead of
+relying on the X server sprite drawing, this provides a way for them to
+do so without getting a double cursor image.
+
+11.1 Requests
+
+HideCursor
+
+ window: WINDOW
+
+ A client sends this request to indicate that it wants the
+ cursor image to be hidden (i.e. to not be displayed) when
+ the sprite is inside the specified window, or one of its
+ subwindows. If the sprite is inside a window for which one
+ or more active clients have requested cursor hiding then the
+ cursor image will not be displayed.
+
+ Note that even though cursor hiding causes the cursor image
+ to be invisible, CursorNotify events will still be sent
+ normally, as if the cursor image were visible.
+
+ If, during a grab, one or more active clients have requested
+ cursor hiding for grab window, or one of its ancestors, the
+ cursor image of the grab cursor will not be displayed during
+ the lifetime of that grab.
+
+ When a client with outstanding cursor hiding requests
+ terminates its connection these requests will be deleted.
+
+ Servers supporting the X Input Extension Version 2.0 or higher hide
+ all visible cursors in response to a HideCursor request. If a master
+ pointer is created while the cursors are hidden, this master pointer's
+ cursor will be hidden as well.
+
+ShowCursor
+
+ window: WINDOW
+
+ A client sends this request to indicate that it wants the
+ cursor image to be displayed when the sprite is inside the
+ specified window, or one of its subwindows. If the sprite
+ is inside a window for which no active clients have requested
+ cursor hiding then the cursor image for that window will be
+ displayed. In other words, if a client calls HideCursor for
+ a specified window, or window subtree, this request reverses
+ the effects of the HideCursor request.
+
+ If the client has made no outstanding HideCursor requests
+ a BadMatch error is generated.
+
+ Servers supporting the X Input Extension Version 2.0 or higher show
+ all visible cursors in response to a ShowCursor request.
+
+99. Future compatibility
+
+This extension is not expected to remain fixed. Future changes will
+strive to remain compatible if at all possible. The X server will always
+support version 1 of the extension protocol if requested by a client.
+
+Additions to the protocol will always by marked by minor version number
+changes so that applications will be able to detect what requests are
+supported.
diff --git a/fixesproto/xfixesproto.h b/fixesproto/xfixesproto.h
new file mode 100644
index 0000000..d7d7bed
--- /dev/null
+++ b/fixesproto/xfixesproto.h
@@ -0,0 +1,518 @@
+/*
+ * Copyright © 2006 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.
+ */
+/*
+ * Copyright © 2002 Keith Packard, member of The XFree86 Project, 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+#ifndef _XFIXESPROTO_H_
+#define _XFIXESPROTO_H_
+
+#include <X11/Xmd.h>
+#include <X11/extensions/xfixeswire.h>
+#include <X11/extensions/shapeconst.h>
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+#define Picture CARD32
+
+/*************** Version 1 ******************/
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+} xXFixesReq;
+
+/*
+ * requests and replies
+ */
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xXFixesQueryVersionReq;
+
+#define sz_xXFixesQueryVersionReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xXFixesQueryVersionReply;
+
+#define sz_xXFixesQueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ BYTE mode; /* SetModeInsert/SetModeDelete*/
+ BYTE target; /* SaveSetNearest/SaveSetRoot*/
+ BYTE map; /* SaveSetMap/SaveSetUnmap */
+ BYTE pad1;
+ Window window;
+} xXFixesChangeSaveSetReq;
+
+#define sz_xXFixesChangeSaveSetReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Window window B32;
+ Atom selection B32;
+ CARD32 eventMask B32;
+} xXFixesSelectSelectionInputReq;
+
+#define sz_xXFixesSelectSelectionInputReq 16
+
+typedef struct {
+ CARD8 type;
+ CARD8 subtype;
+ CARD16 sequenceNumber B16;
+ Window window B32;
+ Window owner B32;
+ Atom selection B32;
+ Time timestamp B32;
+ Time selectionTimestamp B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xXFixesSelectionNotifyEvent;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Window window B32;
+ CARD32 eventMask B32;
+} xXFixesSelectCursorInputReq;
+
+#define sz_xXFixesSelectCursorInputReq 12
+
+typedef struct {
+ CARD8 type;
+ CARD8 subtype;
+ CARD16 sequenceNumber B16;
+ Window window B32;
+ CARD32 cursorSerial B32;
+ Time timestamp;
+ Atom name B32; /* Version 2 */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xXFixesCursorNotifyEvent;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+} xXFixesGetCursorImageReq;
+
+#define sz_xXFixesGetCursorImageReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD16 xhot B16;
+ CARD16 yhot B16;
+ CARD32 cursorSerial B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xXFixesGetCursorImageReply;
+
+#define sz_xXFixesGetCursorImageReply 32
+
+/*************** Version 2 ******************/
+
+#define Region CARD32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ /* LISTofRECTANGLE */
+} xXFixesCreateRegionReq;
+
+#define sz_xXFixesCreateRegionReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ Pixmap bitmap B32;
+} xXFixesCreateRegionFromBitmapReq;
+
+#define sz_xXFixesCreateRegionFromBitmapReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ Window window B32;
+ CARD8 kind;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xXFixesCreateRegionFromWindowReq;
+
+#define sz_xXFixesCreateRegionFromWindowReq 16
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ GContext gc B32;
+} xXFixesCreateRegionFromGCReq;
+
+#define sz_xXFixesCreateRegionFromGCReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ Picture picture B32;
+} xXFixesCreateRegionFromPictureReq;
+
+#define sz_xXFixesCreateRegionFromPictureReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+} xXFixesDestroyRegionReq;
+
+#define sz_xXFixesDestroyRegionReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ /* LISTofRECTANGLE */
+} xXFixesSetRegionReq;
+
+#define sz_xXFixesSetRegionReq 8
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region source B32;
+ Region destination B32;
+} xXFixesCopyRegionReq;
+
+#define sz_xXFixesCopyRegionReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region source1 B32;
+ Region source2 B32;
+ Region destination B32;
+} xXFixesCombineRegionReq,
+ xXFixesUnionRegionReq,
+ xXFixesIntersectRegionReq,
+ xXFixesSubtractRegionReq;
+
+#define sz_xXFixesCombineRegionReq 16
+#define sz_xXFixesUnionRegionReq sz_xXFixesCombineRegionReq
+#define sz_xXFixesIntersectRegionReq sz_xXFixesCombineRegionReq
+#define sz_xXFixesSubtractRegionReq sz_xXFixesCombineRegionReq
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region source B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ Region destination B32;
+} xXFixesInvertRegionReq;
+
+#define sz_xXFixesInvertRegionReq 20
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+ INT16 dx B16, dy B16;
+} xXFixesTranslateRegionReq;
+
+#define sz_xXFixesTranslateRegionReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region source B32;
+ Region destination B32;
+} xXFixesRegionExtentsReq;
+
+#define sz_xXFixesRegionExtentsReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region region B32;
+} xXFixesFetchRegionReq;
+
+#define sz_xXFixesFetchRegionReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xXFixesFetchRegionReply;
+
+#define sz_xXFixesFetchRegionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ GContext gc B32;
+ Region region B32;
+ INT16 xOrigin B16, yOrigin B16;
+} xXFixesSetGCClipRegionReq;
+
+#define sz_xXFixesSetGCClipRegionReq 16
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Window dest;
+ BYTE destKind;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ INT16 xOff B16, yOff B16;
+ Region region;
+} xXFixesSetWindowShapeRegionReq;
+
+#define sz_xXFixesSetWindowShapeRegionReq 20
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Picture picture B32;
+ Region region B32;
+ INT16 xOrigin B16, yOrigin B16;
+} xXFixesSetPictureClipRegionReq;
+
+#define sz_xXFixesSetPictureClipRegionReq 16
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Cursor cursor B32;
+ CARD16 nbytes B16;
+ CARD16 pad B16;
+} xXFixesSetCursorNameReq;
+
+#define sz_xXFixesSetCursorNameReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Cursor cursor B32;
+} xXFixesGetCursorNameReq;
+
+#define sz_xXFixesGetCursorNameReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom atom B32;
+ CARD16 nbytes B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXFixesGetCursorNameReply;
+
+#define sz_xXFixesGetCursorNameReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+} xXFixesGetCursorImageAndNameReq;
+
+#define sz_xXFixesGetCursorImageAndNameReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD16 xhot B16;
+ CARD16 yhot B16;
+ CARD32 cursorSerial B32;
+ Atom cursorName B32;
+ CARD16 nbytes B16;
+ CARD16 pad B16;
+} xXFixesGetCursorImageAndNameReply;
+
+#define sz_xXFixesGetCursorImageAndNameReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Cursor source B32;
+ Cursor destination B32;
+} xXFixesChangeCursorReq;
+
+#define sz_xXFixesChangeCursorReq 12
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Cursor source B32;
+ CARD16 nbytes;
+ CARD16 pad;
+} xXFixesChangeCursorByNameReq;
+
+#define sz_xXFixesChangeCursorByNameReq 12
+
+/*************** Version 3 ******************/
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Region source B32;
+ Region destination B32;
+ CARD16 left B16;
+ CARD16 right B16;
+ CARD16 top B16;
+ CARD16 bottom B16;
+} xXFixesExpandRegionReq;
+
+#define sz_xXFixesExpandRegionReq 20
+
+/*************** Version 4.0 ******************/
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Window window B32;
+} xXFixesHideCursorReq;
+
+#define sz_xXFixesHideCursorReq sizeof(xXFixesHideCursorReq)
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 xfixesReqType;
+ CARD16 length B16;
+ Window window B32;
+} xXFixesShowCursorReq;
+
+#define sz_xXFixesShowCursorReq sizeof(xXFixesShowCursorReq)
+
+#undef Region
+#undef Picture
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* _XFIXESPROTO_H_ */
diff --git a/fixesproto/xfixeswire.h b/fixesproto/xfixeswire.h
new file mode 100644
index 0000000..3342753
--- /dev/null
+++ b/fixesproto/xfixeswire.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright © 2006 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.
+ */
+/*
+ * Copyright © 2002 Keith Packard, member of The XFree86 Project, 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH 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.
+ */
+
+
+#ifndef _XFIXESWIRE_H_
+#define _XFIXESWIRE_H_
+
+#define XFIXES_NAME "XFIXES"
+#define XFIXES_MAJOR 4
+#define XFIXES_MINOR 0
+
+/*************** Version 1 ******************/
+#define X_XFixesQueryVersion 0
+#define X_XFixesChangeSaveSet 1
+#define X_XFixesSelectSelectionInput 2
+#define X_XFixesSelectCursorInput 3
+#define X_XFixesGetCursorImage 4
+/*************** Version 2 ******************/
+#define X_XFixesCreateRegion 5
+#define X_XFixesCreateRegionFromBitmap 6
+#define X_XFixesCreateRegionFromWindow 7
+#define X_XFixesCreateRegionFromGC 8
+#define X_XFixesCreateRegionFromPicture 9
+#define X_XFixesDestroyRegion 10
+#define X_XFixesSetRegion 11
+#define X_XFixesCopyRegion 12
+#define X_XFixesUnionRegion 13
+#define X_XFixesIntersectRegion 14
+#define X_XFixesSubtractRegion 15
+#define X_XFixesInvertRegion 16
+#define X_XFixesTranslateRegion 17
+#define X_XFixesRegionExtents 18
+#define X_XFixesFetchRegion 19
+#define X_XFixesSetGCClipRegion 20
+#define X_XFixesSetWindowShapeRegion 21
+#define X_XFixesSetPictureClipRegion 22
+#define X_XFixesSetCursorName 23
+#define X_XFixesGetCursorName 24
+#define X_XFixesGetCursorImageAndName 25
+#define X_XFixesChangeCursor 26
+#define X_XFixesChangeCursorByName 27
+/*************** Version 3 ******************/
+#define X_XFixesExpandRegion 28
+/*************** Version 4 ******************/
+#define X_XFixesHideCursor 29
+#define X_XFixesShowCursor 30
+
+#define XFixesNumberRequests (X_XFixesShowCursor+1)
+
+/* Selection events share one event number */
+#define XFixesSelectionNotify 0
+
+/* Within the selection, the 'subtype' field distinguishes */
+#define XFixesSetSelectionOwnerNotify 0
+#define XFixesSelectionWindowDestroyNotify 1
+#define XFixesSelectionClientCloseNotify 2
+
+#define XFixesSetSelectionOwnerNotifyMask (1L << 0)
+#define XFixesSelectionWindowDestroyNotifyMask (1L << 1)
+#define XFixesSelectionClientCloseNotifyMask (1L << 2)
+
+/* There's only one cursor event so far */
+#define XFixesCursorNotify 1
+
+#define XFixesDisplayCursorNotify 0
+
+#define XFixesDisplayCursorNotifyMask (1L << 0)
+
+#define XFixesNumberEvents (2)
+
+/* errors */
+#define BadRegion 0
+#define XFixesNumberErrors (BadRegion+1)
+
+#define SaveSetNearest 0
+#define SaveSetRoot 1
+
+#define SaveSetMap 0
+#define SaveSetUnmap 1
+
+/*************** Version 2 ******************/
+
+#define WindowRegionBounding 0
+#define WindowRegionClip 1
+
+#endif /* _XFIXESWIRE_H_ */
diff --git a/fontcacheproto/.gitignore b/fontcacheproto/.gitignore
new file mode 100644
index 0000000..51f6b55
--- /dev/null
+++ b/fontcacheproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for fontcacheproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/fontcacheproto/COPYING b/fontcacheproto/COPYING
new file mode 100644
index 0000000..3e473ad
--- /dev/null
+++ b/fontcacheproto/COPYING
@@ -0,0 +1,24 @@
+Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
+All rights reserved.
+Copyright (c) 1998-1999 X-TrueType Server Project, All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/fontcacheproto/Makefile.am b/fontcacheproto/Makefile.am
new file mode 100644
index 0000000..9092f8a
--- /dev/null
+++ b/fontcacheproto/Makefile.am
@@ -0,0 +1,22 @@
+fontcachedir = $(includedir)/X11/extensions
+fontcache_HEADERS = \
+ fontcache.h \
+ fontcacheP.h \
+ fontcachstr.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = fontcacheproto.pc
+
+EXTRA_DIST = fontcacheproto.pc.in
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/fontcacheproto/README b/fontcacheproto/README
new file mode 100644
index 0000000..7cce9a7
--- /dev/null
+++ b/fontcacheproto/README
@@ -0,0 +1,30 @@
+ FontCache Extension
+
+This extension defines a protocol to allow client control over the caching
+of server-side core fonts.
+
+Extension name: FontCache
+
+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/proto/fontcacheproto
+
+ http://cgit.freedesktop.org/xorg/proto/fontcacheproto
+
+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/fontcacheproto/autogen.sh b/fontcacheproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/fontcacheproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/fontcacheproto/configure.ac b/fontcacheproto/configure.ac
new file mode 100644
index 0000000..2c13bd2
--- /dev/null
+++ b/fontcacheproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.57])
+AC_INIT([FontcacheProto], [0.1.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ fontcacheproto.pc])
diff --git a/fontcacheproto/fontcache.h b/fontcacheproto/fontcache.h
new file mode 100644
index 0000000..b767db1
--- /dev/null
+++ b/fontcacheproto/fontcache.h
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
+ * All rights reserved.
+ * Copyright (c) 1998-1999 X-TrueType Server Project, All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Id: fontcache.h,v 1.6 1999/01/31 12:41:32 akiyama Exp $
+ */
+/* $XFree86: xc/include/extensions/fontcache.h,v 1.3 2001/08/01 00:44:35 tsi Exp $ */
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifndef _EXT_FONTCACHE_H_
+#define _EXT_FONTCACHE_H_
+
+#define X_FontCacheQueryVersion 0
+#define X_FontCacheGetCacheSettings 1
+#define X_FontCacheChangeCacheSettings 2
+#define X_FontCacheGetCacheStatistics 3
+
+#define FontCacheNumberEvents 0
+
+#define FontCacheBadProtocol 0
+#define FontCacheCannotAllocMemory 1
+#define FontCacheNumberErrors (FontCacheCannotAllocMemory + 1)
+
+typedef struct {
+ long himark;
+ long lowmark;
+ long balance;
+} FontCacheSettings, *FontCacheSettingsPtr;
+
+struct cacheinfo {
+ long hits;
+ long misshits;
+ long purged;
+ long usage;
+};
+
+typedef struct {
+ long purge_runs;
+ long purge_stat;
+ long balance;
+ struct cacheinfo f;
+ struct cacheinfo v;
+} FontCacheStatistics, *FontCacheStatisticsPtr;
+
+#ifndef _FONTCACHE_SERVER_
+
+#include <X11/Xlib.h>
+
+_XFUNCPROTOBEGIN
+
+Bool FontCacheQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */
+);
+
+Bool FontCacheQueryExtension(
+ Display* /* dpy */,
+ int* /* event_base */,
+ int* /* error_base */
+);
+
+Status FontCacheGetCacheSettings(
+ Display* /* dpy */,
+ FontCacheSettings* /* cache info */
+);
+
+Status FontCacheChangeCacheSettings(
+ Display* /* dpy */,
+ FontCacheSettings* /* cache info */
+);
+
+Status FontCacheGetCacheStatistics(
+ Display* /* dpy */,
+ FontCacheStatistics* /* cache statistics info */
+);
+
+_XFUNCPROTOEND
+
+#endif /* !_FONTCACHE_SERVER_ */
+
+#endif /* _EXT_FONTCACHE_H_ */
diff --git a/fontcacheproto/fontcacheP.h b/fontcacheproto/fontcacheP.h
new file mode 100644
index 0000000..75677f3
--- /dev/null
+++ b/fontcacheproto/fontcacheP.h
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
+ * All rights reserved.
+ * Copyright (c) 1998-1999 X-TrueType Server Project, All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Id: fontcacheP.h,v 1.6 1999/01/31 12:43:53 akiyama Exp $
+ */
+/* $XFree86: xc/include/extensions/fontcacheP.h,v 1.4 2000/03/01 01:04:21 dawes Exp $ */
+
+#ifndef _FONTCACHEP_H_
+#define _FONTCACHEP_H_
+
+#include <X11/extensions/fontcache.h>
+
+int FontCacheChangeSettings(FontCacheSettingsPtr /* cinfo */);
+void FontCacheGetSettings(FontCacheSettingsPtr /* cinfo */);
+void FontCacheGetStatistics(FontCacheStatisticsPtr /* cstats */);
+
+#endif /* _FONTCACHEP_H_ */
diff --git a/fontcacheproto/fontcacheproto.pc.in b/fontcacheproto/fontcacheproto.pc.in
new file mode 100644
index 0000000..afb2127
--- /dev/null
+++ b/fontcacheproto/fontcacheproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: FontcacheProto
+Description: Fontcache extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/fontcacheproto/fontcachstr.h b/fontcacheproto/fontcachstr.h
new file mode 100644
index 0000000..eab704e
--- /dev/null
+++ b/fontcacheproto/fontcachstr.h
@@ -0,0 +1,130 @@
+/*-
+ * Copyright (c) 1998-1999 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
+ * All rights reserved.
+ * Copyright (c) 1998-1999 X-TrueType Server Project, All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Id: fontcachstr.h,v 1.7 1999/01/31 14:58:40 akiyama Exp $
+ */
+/* $XFree86$ */
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifndef _FONTCACHESTR_H_
+#define _FONTCACHESTR_H_
+
+#include <X11/extensions/fontcache.h>
+
+#define FONTCACHENAME "FontCache"
+
+#define FONTCACHE_MAJOR_VERSION 0 /* current version numbers */
+#define FONTCACHE_MINOR_VERSION 1
+
+typedef struct _FontCacheQueryVersion {
+ CARD8 reqType; /* always FontCacheReqCode */
+ CARD8 fontcacheReqType; /* always X_FontCacheQueryVersion */
+ CARD16 length B16;
+} xFontCacheQueryVersionReq;
+#define sz_xFontCacheQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of Font-Cache */
+ CARD16 minorVersion B16; /* minor version of Font-Cache */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xFontCacheQueryVersionReply;
+#define sz_xFontCacheQueryVersionReply 32
+
+typedef struct _FontCacheGetCacheSettings {
+ CARD8 reqType; /* always FontCacheReqCode */
+ CARD8 fontcacheReqType; /* always X_FontCacheGetCacheSettings */
+ CARD16 length B16;
+} xFontCacheGetCacheSettingsReq;
+#define sz_xFontCacheGetCacheSettingsReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 himark B32;
+ CARD32 lowmark B32;
+ CARD32 balance B32;
+ CARD32 reserve0 B32;
+ CARD32 reserve1 B32;
+ CARD32 reserve2 B32;
+} xFontCacheGetCacheSettingsReply;
+#define sz_xFontCacheGetCacheSettingsReply 32
+
+typedef struct _FontCacheChangeCacheSettings {
+ CARD8 reqType; /* always FontCacheReqCode */
+ CARD8 fontcacheReqType; /* always X_FontCacheChangeCacheSettings */
+ CARD16 length B16;
+ CARD32 himark B32;
+ CARD32 lowmark B32;
+ CARD32 balance B32;
+ CARD32 reserve0 B32;
+ CARD32 reserve1 B32;
+ CARD32 reserve2 B32;
+ CARD32 reserve3 B32;
+} xFontCacheChangeCacheSettingsReq;
+#define sz_xFontCacheChangeCacheSettingsReq 32
+
+typedef struct _FontCacheGetCacheStatistics {
+ CARD8 reqType; /* always FontCacheReqCode */
+ CARD8 fontcacheReqType; /* always X_FontCacheGetCacheStatistics */
+ CARD16 length B16;
+} xFontCacheGetCacheStatisticsReq;
+#define sz_xFontCacheGetCacheStatisticsReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 purge_runs B32;
+ CARD32 purge_stat B32;
+ CARD32 balance B32;
+ CARD32 reserve0 B32;
+ CARD32 f_hits B32;
+ CARD32 f_misshits B32;
+ CARD32 f_purged B32;
+ CARD32 f_usage B32;
+ CARD32 f_reserve0 B32;
+ CARD32 v_hits B32;
+ CARD32 v_misshits B32;
+ CARD32 v_purged B32;
+ CARD32 v_usage B32;
+ CARD32 v_reserve0 B32;
+} xFontCacheGetCacheStatisticsReply;
+#define sz_xFontCacheGetCacheStatisticsReply 64
+
+#endif /* _FONTCACHESTR_H_ */
diff --git a/fontsproto/.gitignore b/fontsproto/.gitignore
new file mode 100644
index 0000000..f1ca084
--- /dev/null
+++ b/fontsproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for fontsproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/fontsproto/COPYING b/fontsproto/COPYING
new file mode 100644
index 0000000..eac45aa
--- /dev/null
+++ b/fontsproto/COPYING
@@ -0,0 +1,86 @@
+Copyright 1990, 1991 Network Computing Devices;
+Portions Copyright 1987 by Digital Equipment Corporation
+
+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, and that the names of Network Computing Devices or Digital
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+Network Computing Devices and Digital make no representations
+about the suitability of this software for any purpose. It is provided
+"as is" without express or implied warranty.
+
+NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+OR DIGITAL 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 1990, 1991, 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 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 (c) 1999 The XFree86 Project Inc.
+
+All Rights Reserved.
+
+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 XFree86 Project
+Inc. 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 XFree86 Project Inc..
diff --git a/fontsproto/FS.h b/fontsproto/FS.h
new file mode 100644
index 0000000..605b5a8
--- /dev/null
+++ b/fontsproto/FS.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation
+ *
+ * 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, and that the names of Network Computing Devices or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ * Network Computing Devices and Digital make no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+ * OR DIGITAL 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.
+ */
+
+/*
+
+Portions Copyright 1987, 1994, 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.
+
+*/
+
+#ifndef _FS_H_
+#define _FS_H_
+
+#include <X11/Xdefs.h>
+#include <X11/fonts/fsmasks.h>
+
+#define FS_PROTOCOL 2
+#define FS_PROTOCOL_MINOR 0
+
+#ifndef X_PROTOCOL
+/* protocol familes */
+#define FamilyInternet 0
+#define FamilyDECnet 1
+#define FamilyChaos 2
+#define FamilyInternet6 6
+
+
+typedef unsigned int FSDrawDirection;
+#endif
+
+#ifndef None
+#define None 0L
+#endif
+
+#define LeftToRightDrawDirection 0
+#define RightToLeftDrawDirection 1
+
+/* font info flags */
+#define FontInfoAllCharsExist (1L << 0)
+#define FontInfoInkInside (1L << 1)
+#define FontInfoHorizontalOverlap (1L << 2)
+
+/* auth status flags */
+#define AuthSuccess 0
+#define AuthContinue 1
+#define AuthBusy 2
+#define AuthDenied 3
+
+/* property types */
+#define PropTypeString 0
+#define PropTypeUnsigned 1
+#define PropTypeSigned 2
+
+#ifndef LSBFirst
+/* byte order */
+#define LSBFirst 0
+#define MSBFirst 1
+#endif
+
+/* event masks */
+#define CatalogueChangeNotifyMask (1L << 0)
+#define FontChangeNotifyMask (1L << 1)
+
+/* errors */
+#define FSSuccess -1
+#define FSBadRequest 0
+#define FSBadFormat 1
+#define FSBadFont 2
+#define FSBadRange 3
+#define FSBadEventMask 4
+#define FSBadAccessContext 5
+#define FSBadIDChoice 6
+#define FSBadName 7
+#define FSBadResolution 8
+#define FSBadAlloc 9
+#define FSBadLength 10
+#define FSBadImplementation 11
+
+#define FirstExtensionError 128
+#define LastExtensionError 255
+
+/* events */
+#define KeepAlive 0
+#define CatalogueChangeNotify 1
+#define FontChangeNotify 2
+#define FSLASTEvent 3
+
+#endif /* _FS_H_ */
diff --git a/fontsproto/FSproto.h b/fontsproto/FSproto.h
new file mode 100644
index 0000000..028156f
--- /dev/null
+++ b/fontsproto/FSproto.h
@@ -0,0 +1,814 @@
+/*
+
+Copyright 1990, 1991, 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 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation
+ *
+ * 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, and that the names of Network Computing Devices, or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ *
+ * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
+ * OR DIGITAL 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.
+ */
+
+#ifndef _FS_PROTO_H_
+#define _FS_PROTO_H_
+
+#include <X11/fonts/FS.h>
+
+#define sz_fsPropOffset 20
+#define sz_fsPropInfo 8
+#define sz_fsResolution 6
+
+#define sz_fsChar2b 2
+#define sz_fsChar2b_version1 2
+#define sz_fsOffset32 8
+#define sz_fsRange 4
+
+#define sz_fsXCharInfo 12
+#define sz_fsXFontInfoHeader 40
+
+#define sz_fsConnClientPrefix 8
+#define sz_fsConnSetup 12
+#define sz_fsConnSetupExtra 8
+#define sz_fsConnSetupAccept 12
+
+/* request sizes */
+#define sz_fsReq 4
+#define sz_fsListExtensionsReq 4
+#define sz_fsResourceReq 8
+
+#define sz_fsNoopReq 4
+#define sz_fsListExtensionReq 4
+#define sz_fsQueryExtensionReq 4
+#define sz_fsListCataloguesReq 12
+#define sz_fsSetCataloguesReq 4
+#define sz_fsGetCataloguesReq 4
+#define sz_fsSetEventMaskReq 8
+#define sz_fsGetEventMaskReq 4
+#define sz_fsCreateACReq 8
+#define sz_fsFreeACReq 8
+#define sz_fsSetAuthorizationReq 8
+#define sz_fsSetResolutionReq 4
+#define sz_fsGetResolutionReq 4
+#define sz_fsListFontsReq 12
+#define sz_fsListFontsWithXInfoReq 12
+#define sz_fsOpenBitmapFontReq 16
+#define sz_fsQueryXInfoReq 8
+#define sz_fsQueryXExtents8Req 12
+#define sz_fsQueryXExtents16Req 12
+#define sz_fsQueryXBitmaps8Req 16
+#define sz_fsQueryXBitmaps16Req 16
+#define sz_fsCloseReq 8
+
+/* reply sizes */
+#define sz_fsReply 8
+#define sz_fsGenericReply 8
+
+#define sz_fsListExtensionsReply 8
+#define sz_fsQueryExtensionReply 20
+#define sz_fsListCataloguesReply 16
+#define sz_fsGetCataloguesReply 8
+#define sz_fsGetEventMaskReply 12
+#define sz_fsCreateACReply 12
+#define sz_fsGetResolutionReply 8
+#define sz_fsListFontsReply 16
+#define sz_fsListFontsWithXInfoReply (12 + sz_fsXFontInfoHeader)
+#define sz_fsOpenBitmapFontReply 16
+#define sz_fsQueryXInfoReply (8 + sz_fsXFontInfoHeader)
+#define sz_fsQueryXExtents8Reply 12
+#define sz_fsQueryXExtents16Reply 12
+#define sz_fsQueryXBitmaps8Reply 20
+#define sz_fsQueryXBitmaps16Reply 20
+
+#define sz_fsError 16
+#define sz_fsEvent 12
+#define sz_fsKeepAliveEvent 12
+
+#define fsTrue 1
+#define fsFalse 0
+
+/* temp decls */
+#define Mask CARD32
+#define Font CARD32
+#define AccContext CARD32
+
+typedef CARD32 fsTimestamp;
+
+#ifdef NOTDEF /* in fsmasks.h */
+typedef CARD32 fsBitmapFormat;
+typedef CARD32 fsBitmapFormatMask;
+#endif
+
+#define sz_fsBitmapFormat 4
+
+typedef struct {
+ INT16 left B16,
+ right B16;
+ INT16 width B16;
+ INT16 ascent B16,
+ descent B16;
+ CARD16 attributes B16;
+} fsXCharInfo;
+
+typedef struct {
+ CARD8 high;
+ CARD8 low;
+} fsChar2b;
+
+typedef struct {
+ CARD8 low;
+ CARD8 high;
+} fsChar2b_version1;
+
+typedef struct {
+ CARD8 min_char_high;
+ CARD8 min_char_low;
+ CARD8 max_char_high;
+ CARD8 max_char_low;
+} fsRange;
+
+typedef struct {
+ CARD32 position B32;
+ CARD32 length B32;
+} fsOffset32;
+
+typedef struct {
+ fsOffset32 name;
+ fsOffset32 value;
+ CARD8 type;
+ BYTE pad0;
+ CARD16 pad1 B16;
+} fsPropOffset;
+
+typedef struct {
+ CARD32 num_offsets B32;
+ CARD32 data_len B32;
+ /* offsets */
+ /* data */
+} fsPropInfo;
+
+typedef struct {
+ CARD16 x_resolution B16;
+ CARD16 y_resolution B16;
+ CARD16 point_size B16;
+} fsResolution;
+
+
+typedef struct {
+ CARD32 flags B32;
+ CARD8 char_range_min_char_high;
+ CARD8 char_range_min_char_low;
+ CARD8 char_range_max_char_high;
+ CARD8 char_range_max_char_low;
+
+ CARD8 draw_direction;
+ CARD8 pad;
+ CARD8 default_char_high;
+ CARD8 default_char_low;
+ INT16 min_bounds_left B16;
+ INT16 min_bounds_right B16;
+
+ INT16 min_bounds_width B16;
+ INT16 min_bounds_ascent B16;
+ INT16 min_bounds_descent B16;
+ CARD16 min_bounds_attributes B16;
+
+ INT16 max_bounds_left B16;
+ INT16 max_bounds_right B16;
+ INT16 max_bounds_width B16;
+ INT16 max_bounds_ascent B16;
+
+ INT16 max_bounds_descent B16;
+ CARD16 max_bounds_attributes B16;
+ INT16 font_ascent B16;
+ INT16 font_descent B16;
+ /* propinfo */
+} fsXFontInfoHeader;
+
+
+/* requests */
+
+typedef struct {
+ BYTE byteOrder;
+ CARD8 num_auths;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ CARD16 auth_len B16;
+ /* auth data */
+} fsConnClientPrefix;
+
+typedef struct {
+ CARD16 status B16;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ CARD8 num_alternates;
+ CARD8 auth_index;
+ CARD16 alternate_len B16;
+ CARD16 auth_len B16;
+ /* alternates */
+ /* auth data */
+} fsConnSetup;
+
+typedef struct {
+ CARD32 length B32;
+ CARD16 status B16;
+ CARD16 pad B16;
+ /* more auth data */
+} fsConnSetupExtra;
+
+typedef struct {
+ CARD32 length B32;
+ CARD16 max_request_len B16;
+ CARD16 vendor_len B16;
+ CARD32 release_number B32;
+ /* vendor string */
+} fsConnSetupAccept;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 data;
+ CARD16 length B16;
+} fsReq;
+
+/*
+ * The fsFakeReq structure is never used in the protocol; it is prepended
+ * to incoming packets when setting up a connection so we can index
+ * through InitialVector. To avoid alignment problems, it is padded
+ * to the size of a word on the largest machine this code runs on.
+ * Hence no sz_fsFakeReq constant is necessary.
+ */
+typedef struct {
+ CARD8 reqType;
+ CARD8 data;
+ CARD16 length B16;
+ CARD32 pad B32; /* to fill out to multiple of 64 bits */
+} fsFakeReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Font id B32;
+} fsResourceReq;
+
+typedef fsReq fsNoopReq;
+typedef fsReq fsListExtensionsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE nbytes;
+ CARD16 length B16;
+ /* name */
+} fsQueryExtensionReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 data;
+ CARD16 length B16;
+ CARD32 maxNames B32;
+ CARD16 nbytes B16;
+ CARD16 pad2 B16;
+ /* pattern */
+} fsListCataloguesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE num_catalogues;
+ CARD16 length B16;
+ /* catalogues */
+} fsSetCataloguesReq;
+
+typedef fsReq fsGetCataloguesReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ext_opcode;
+ CARD16 length B16;
+ Mask event_mask;
+} fsSetEventMaskReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ext_opcode;
+ CARD16 length B16;
+} fsGetEventMaskReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE num_auths;
+ CARD16 length B16;
+ AccContext acid B32;
+ /* auth protocols */
+} fsCreateACReq;
+
+typedef fsResourceReq fsFreeACReq;
+typedef fsResourceReq fsSetAuthorizationReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE num_resolutions;
+ CARD16 length B16;
+ /* resolutions */
+} fsSetResolutionReq;
+
+typedef fsReq fsGetResolutionReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD32 maxNames B32;
+ CARD16 nbytes B16;
+ CARD16 pad2 B16;
+ /* pattern */
+} fsListFontsReq;
+
+typedef fsListFontsReq fsListFontsWithXInfoReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Font fid B32;
+ fsBitmapFormatMask format_mask B32;
+ fsBitmapFormat format_hint B32;
+ /* pattern */
+} fsOpenBitmapFontReq;
+
+typedef fsResourceReq fsQueryXInfoReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL range;
+ CARD16 length B16;
+ Font fid B32;
+ CARD32 num_ranges B32;
+ /* list of chars */
+} fsQueryXExtents8Req;
+
+typedef fsQueryXExtents8Req fsQueryXExtents16Req;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL range;
+ CARD16 length B16;
+ Font fid B32;
+ fsBitmapFormat format B32;
+ CARD32 num_ranges B32;
+ /* list of chars */
+} fsQueryXBitmaps8Req;
+
+typedef fsQueryXBitmaps8Req fsQueryXBitmaps16Req;
+
+typedef fsResourceReq fsCloseReq;
+
+
+/* replies */
+typedef struct {
+ BYTE type;
+ BYTE data1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+} fsGenericReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 nExtensions;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ /* extension names */
+} fsListExtensionsReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 present;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ CARD8 major_opcode;
+ CARD8 first_event;
+ CARD8 num_events;
+ CARD8 first_error;
+ CARD8 num_errors;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} fsQueryExtensionReply;
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 num_replies B32;
+ CARD32 num_catalogues B32;
+ /* catalog names */
+} fsListCataloguesReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 num_catalogues;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ /* catalogue names */
+} fsGetCataloguesReply;
+
+typedef struct {
+ BYTE type;
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 event_mask B32;
+} fsGetEventMaskReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 auth_index;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 status B16;
+ CARD16 pad B16;
+ /* auth data */
+} fsCreateACReply;
+
+typedef struct {
+ CARD32 length B32;
+ CARD16 status B16;
+ CARD16 pad B16;
+ /* auth data */
+} fsCreateACExtraReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 num_resolutions;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ /* resolutions */
+} fsGetResolutionReply;
+
+typedef struct {
+ BYTE type;
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 following B32;
+ CARD32 nFonts B32;
+ /* font names */
+} fsListFontsReply;
+
+/*
+ * this one is messy. the reply itself is variable length (unknown
+ * number of replies) and the contents of each is variable (unknown
+ * number of properties)
+ *
+ */
+
+typedef struct {
+ BYTE type;
+ CARD8 nameLength; /* 0 is end-of-reply */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nReplies B32;
+ CARD32 font_header_flags B32;
+ CARD8 font_hdr_char_range_min_char_high;
+ CARD8 font_hdr_char_range_min_char_low;
+ CARD8 font_hdr_char_range_max_char_high;
+ CARD8 font_hdr_char_range_max_char_low;
+ CARD8 font_header_draw_direction;
+ CARD8 font_header_pad;
+ CARD8 font_header_default_char_high;
+ CARD8 font_header_default_char_low;
+ INT16 font_header_min_bounds_left B16;
+ INT16 font_header_min_bounds_right B16;
+ INT16 font_header_min_bounds_width B16;
+ INT16 font_header_min_bounds_ascent B16;
+ INT16 font_header_min_bounds_descent B16;
+ CARD16 font_header_min_bounds_attributes B16;
+ INT16 font_header_max_bounds_left B16;
+ INT16 font_header_max_bounds_right B16;
+ INT16 font_header_max_bounds_width B16;
+ INT16 font_header_max_bounds_ascent B16;
+ INT16 font_header_max_bounds_descent B16;
+ CARD16 font_header_max_bounds_attributes B16;
+ INT16 font_header_font_ascent B16;
+ INT16 font_header_font_descent B16;
+ /* propinfo */
+ /* name */
+} fsListFontsWithXInfoReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 otherid_valid;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 otherid B32;
+ BYTE cachable;
+ BYTE pad1;
+ CARD16 pad2 B16;
+} fsOpenBitmapFontReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 font_header_flags B32;
+ CARD8 font_hdr_char_range_min_char_high;
+ CARD8 font_hdr_char_range_min_char_low;
+ CARD8 font_hdr_char_range_max_char_high;
+ CARD8 font_hdr_char_range_max_char_low;
+ CARD8 font_header_draw_direction;
+ CARD8 font_header_pad;
+ CARD8 font_header_default_char_high;
+ CARD8 font_header_default_char_low;
+ INT16 font_header_min_bounds_left B16;
+ INT16 font_header_min_bounds_right B16;
+ INT16 font_header_min_bounds_width B16;
+ INT16 font_header_min_bounds_ascent B16;
+ INT16 font_header_min_bounds_descent B16;
+ CARD16 font_header_min_bounds_attributes B16;
+ INT16 font_header_max_bounds_left B16;
+ INT16 font_header_max_bounds_right B16;
+ INT16 font_header_max_bounds_width B16;
+ INT16 font_header_max_bounds_ascent B16;
+ INT16 font_header_max_bounds_descent B16;
+ CARD16 font_header_max_bounds_attributes B16;
+ INT16 font_header_font_ascent B16;
+ INT16 font_header_font_descent B16;
+ /* propinfo */
+} fsQueryXInfoReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 num_extents B32;
+ /* extents */
+} fsQueryXExtents8Reply;
+
+typedef fsQueryXExtents8Reply fsQueryXExtents16Reply;
+
+typedef struct {
+ BYTE type;
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 replies_hint B32;
+ CARD32 num_chars B32;
+ CARD32 nbytes B32;
+ /* offsets */
+ /* glyphs */
+} fsQueryXBitmaps8Reply;
+
+typedef fsQueryXBitmaps8Reply fsQueryXBitmaps16Reply;
+
+typedef union {
+ fsGenericReply generic;
+ fsListExtensionsReply extensions;
+ fsGetResolutionReply getres;
+} fsReply;
+
+/* errors */
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+} fsError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+} fsRequestError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ fsBitmapFormat format B32;
+} fsFormatError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ Font fontid;
+} fsFontError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ fsRange range;
+} fsRangeError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ Mask event_mask;
+} fsEventMaskError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ AccContext acid;
+} fsAccessContextError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ Font fontid;
+} fsIDChoiceError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+} fsNameError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ fsResolution resolution;
+} fsResolutionError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+} fsAllocError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+ CARD32 bad_length B32;
+} fsLengthError;
+
+typedef struct {
+ BYTE type;
+ BYTE request;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ CARD8 major_opcode;
+ CARD8 minor_opcode;
+ CARD16 pad B16;
+} fsImplementationError;
+
+/* events */
+typedef struct {
+ BYTE type;
+ BYTE event_code;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+} fsKeepAliveEvent;
+
+typedef struct {
+ BYTE type;
+ BYTE event_code;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ fsTimestamp timestamp;
+ BOOL added;
+ BOOL deleted;
+ CARD16 pad B16;
+} fsCatalogueChangeNotifyEvent;
+
+typedef fsCatalogueChangeNotifyEvent fsFontChangeNotifyEvent;
+
+typedef fsCatalogueChangeNotifyEvent fsEvent;
+
+/* reply codes */
+#define FS_Reply 0 /* normal reply */
+#define FS_Error 1 /* error */
+#define FS_Event 2
+
+/* request codes */
+#define FS_Noop 0
+#define FS_ListExtensions 1
+#define FS_QueryExtension 2
+#define FS_ListCatalogues 3
+#define FS_SetCatalogues 4
+#define FS_GetCatalogues 5
+#define FS_SetEventMask 6
+#define FS_GetEventMask 7
+#define FS_CreateAC 8
+#define FS_FreeAC 9
+#define FS_SetAuthorization 10
+#define FS_SetResolution 11
+#define FS_GetResolution 12
+#define FS_ListFonts 13
+#define FS_ListFontsWithXInfo 14
+#define FS_OpenBitmapFont 15
+#define FS_QueryXInfo 16
+#define FS_QueryXExtents8 17
+#define FS_QueryXExtents16 18
+#define FS_QueryXBitmaps8 19
+#define FS_QueryXBitmaps16 20
+#define FS_CloseFont 21
+
+/* restore decls */
+#undef Mask
+#undef Font
+#undef AccContext
+
+#endif /* _FS_PROTO_H_ */
diff --git a/fontsproto/Makefile.am b/fontsproto/Makefile.am
new file mode 100644
index 0000000..c1ff54a
--- /dev/null
+++ b/fontsproto/Makefile.am
@@ -0,0 +1,24 @@
+fontsdir = $(includedir)/X11/fonts
+fonts_HEADERS = \
+ font.h \
+ fontproto.h \
+ fontstruct.h \
+ FS.h \
+ fsmasks.h \
+ FSproto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = fontsproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/fontsproto/README b/fontsproto/README
new file mode 100644
index 0000000..0f8ba55
--- /dev/null
+++ b/fontsproto/README
@@ -0,0 +1,25 @@
+ X Fonts 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/proto/fontsproto
+
+ http://cgit.freedesktop.org/xorg/proto/fontsproto
+
+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/fontsproto/autogen.sh b/fontsproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/fontsproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/fontsproto/configure.ac b/fontsproto/configure.ac
new file mode 100644
index 0000000..0bee874
--- /dev/null
+++ b/fontsproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([FontsProto], [2.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ fontsproto.pc])
diff --git a/fontsproto/font.h b/fontsproto/font.h
new file mode 100644
index 0000000..b71046b
--- /dev/null
+++ b/fontsproto/font.h
@@ -0,0 +1,166 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+#ifndef FONT_H
+#define FONT_H
+
+#ifndef BitmapFormatByteOrderMask
+#include "fsmasks.h"
+#endif
+
+/* data structures */
+#ifndef _XTYPEDEF_FONTPTR
+typedef struct _Font *FontPtr;
+#define _XTYPEDEF_FONTPTR
+#endif
+
+typedef struct _FontInfo *FontInfoPtr;
+typedef struct _FontProp *FontPropPtr;
+typedef struct _ExtentInfo *ExtentInfoPtr;
+typedef struct _FontPathElement *FontPathElementPtr;
+
+#ifndef _XTYPEDEF_CHARINFOPTR
+typedef struct _CharInfo *CharInfoPtr;
+#define _XTYPEDEF_CHARINFOPTR
+#endif
+
+typedef struct _FontNames *FontNamesPtr;
+typedef struct _FontResolution *FontResolutionPtr;
+
+#define NullCharInfo ((CharInfoPtr) 0)
+#define NullFont ((FontPtr) 0)
+#define NullFontInfo ((FontInfoPtr) 0)
+
+ /* draw direction */
+#define LeftToRight 0
+#define RightToLeft 1
+#define BottomToTop 2
+#define TopToBottom 3
+typedef int DrawDirection;
+
+#define NO_SUCH_CHAR -1
+
+
+#define FontAliasType 0x1000
+
+#define AllocError 80
+#define StillWorking 81
+#define FontNameAlias 82
+#define BadFontName 83
+#define Suspended 84
+#define Successful 85
+#define BadFontPath 86
+#define BadCharRange 87
+#define BadFontFormat 88
+#define FPEResetFailed 89 /* for when an FPE reset won't work */
+
+/* OpenFont flags */
+#define FontLoadInfo 0x0001
+#define FontLoadProps 0x0002
+#define FontLoadMetrics 0x0004
+#define FontLoadBitmaps 0x0008
+#define FontLoadAll 0x000f
+#define FontOpenSync 0x0010
+#define FontReopen 0x0020
+
+/* Query flags */
+#define LoadAll 0x1
+#define FinishRamge 0x2
+#define EightBitFont 0x4
+#define SixteenBitFont 0x8
+
+/* Glyph Caching Modes */
+#define CACHING_OFF 0
+#define CACHE_16_BIT_GLYPHS 1
+#define CACHE_ALL_GLYPHS 2
+#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
+extern int glyphCachingMode;
+
+struct _Client;
+
+extern int StartListFontsWithInfo(
+ struct _Client * /*client*/,
+ int /*length*/,
+ unsigned char * /*pattern*/,
+ int /*max_names*/
+);
+
+extern FontNamesPtr MakeFontNamesRecord(
+ unsigned /* size */
+);
+
+extern void FreeFontNames(
+ FontNamesPtr /* pFN*/
+);
+
+extern int AddFontNamesName(
+ FontNamesPtr /* names */,
+ char * /* name */,
+ int /* length */
+);
+
+#if 0 /* unused */
+extern int FontToFSError();
+extern FontResolutionPtr GetClientResolution();
+#endif
+
+typedef struct _FontPatternCache *FontPatternCachePtr;
+
+extern FontPatternCachePtr MakeFontPatternCache (
+ void
+);
+
+extern void FreeFontPatternCache (
+ FontPatternCachePtr /* cache */
+);
+
+extern void EmptyFontPatternCache (
+ FontPatternCachePtr /* cache */
+);
+
+extern void CacheFontPattern (
+ FontPatternCachePtr /* cache */,
+ char * /* pattern */,
+ int /* patlen */,
+ FontPtr /* pFont */
+);
+extern FontResolutionPtr GetClientResolutions(
+ int * /* num */
+);
+
+extern FontPtr FindCachedFontPattern (
+ FontPatternCachePtr /* cache */,
+ char * /* pattern */,
+ int /* patlen */
+);
+
+extern void RemoveCachedFontPattern (
+ FontPatternCachePtr /* cache */,
+ FontPtr /* pFont */
+);
+
+typedef enum {
+ Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
+} FontEncoding;
+
+#endif /* FONT_H */
diff --git a/fontsproto/fontproto.h b/fontsproto/fontproto.h
new file mode 100644
index 0000000..1ab8f37
--- /dev/null
+++ b/fontsproto/fontproto.h
@@ -0,0 +1,91 @@
+/***********************************************************
+
+Copyright (c) 1999 The XFree86 Project Inc.
+
+All Rights Reserved.
+
+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 XFree86 Project
+Inc. 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 XFree86 Project Inc..
+
+*/
+#ifndef _FONTPROTO_H
+#define _FONTPROTO_H
+
+/* Externally provided functions required by libXfont */
+
+extern int RegisterFPEFunctions ( NameCheckFunc name_func,
+ InitFpeFunc init_func,
+ FreeFpeFunc free_func,
+ ResetFpeFunc reset_func,
+ OpenFontFunc open_func,
+ CloseFontFunc close_func,
+ ListFontsFunc list_func,
+ StartLfwiFunc start_lfwi_func,
+ NextLfwiFunc next_lfwi_func,
+ WakeupFpeFunc wakeup_func,
+ ClientDiedFunc client_died,
+ LoadGlyphsFunc load_glyphs,
+ StartLaFunc start_list_alias_func,
+ NextLaFunc next_list_alias_func,
+ SetPathFunc set_path_func);
+
+extern int GetDefaultPointSize ( void );
+
+extern int init_fs_handlers ( FontPathElementPtr fpe,
+ BlockHandlerProcPtr block_handler);
+extern void remove_fs_handlers ( FontPathElementPtr fpe,
+ BlockHandlerProcPtr block_handler,
+ Bool all );
+
+extern int client_auth_generation ( ClientPtr client );
+
+#ifndef ___CLIENTSIGNAL_DEFINED___
+#define ___CLIENTSIGNAL_DEFINED___
+extern Bool ClientSignal ( ClientPtr client );
+#endif /* ___CLIENTSIGNAL_DEFINED___ */
+
+extern void DeleteFontClientID ( Font id );
+extern Font GetNewFontClientID ( void );
+extern int StoreFontClientFont ( FontPtr pfont, Font id );
+extern void FontFileRegisterFpeFunctions ( void );
+extern void FontFileCheckRegisterFpeFunctions ( void );
+
+extern Bool XpClientIsBitmapClient ( ClientPtr client );
+extern Bool XpClientIsPrintClient( ClientPtr client, FontPathElementPtr fpe );
+extern void PrinterFontRegisterFpeFunctions ( void );
+
+extern void fs_register_fpe_functions ( void );
+extern void check_fs_register_fpe_functions ( void );
+
+/* util/private.c */
+extern FontPtr CreateFontRec (void);
+extern void DestroyFontRec (FontPtr font);
+extern Bool _FontSetNewPrivate (FontPtr /* pFont */,
+ int /* n */,
+ pointer /* ptr */);
+extern int AllocateFontPrivateIndex (void);
+extern void ResetFontPrivateIndex (void);
+
+/* Type1/t1funcs.c */
+extern void Type1RegisterFontFileFunctions(void);
+extern void CIDRegisterFontFileFunctions(void);
+
+/* Speedo/spfuncs.c */
+extern void SpeedoRegisterFontFileFunctions(void);
+
+/* FreeType/ftfuncs.c */
+extern void FreeTypeRegisterFontFileFunctions(void);
+
+#endif
diff --git a/fontsproto/fontsproto.pc.in b/fontsproto/fontsproto.pc.in
new file mode 100644
index 0000000..b7db169
--- /dev/null
+++ b/fontsproto/fontsproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: FontsProto
+Description: Fonts extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/fontsproto/fontstruct.h b/fontsproto/fontstruct.h
new file mode 100644
index 0000000..97e771a
--- /dev/null
+++ b/fontsproto/fontstruct.h
@@ -0,0 +1,293 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+#ifndef FONTSTR_H
+#define FONTSTR_H
+
+#include <X11/Xproto.h>
+#include "font.h"
+#include <X11/Xfuncproto.h>
+#include <X11/Xdefs.h>
+
+/*
+ * This version of the server font data strucutre is only for describing
+ * the in memory data structure. The file structure is not necessarily a
+ * copy of this. That is up to the compiler and the OS layer font loading
+ * machinery.
+ */
+
+#define GLYPHPADOPTIONS 4 /* 1, 2, 4, or 8 */
+
+typedef struct _FontProp {
+ long name;
+ long value; /* assumes ATOM is not larger than INT32 */
+} FontPropRec;
+
+typedef struct _FontResolution {
+ unsigned short x_resolution;
+ unsigned short y_resolution;
+ unsigned short point_size;
+} FontResolutionRec;
+
+typedef struct _ExtentInfo {
+ DrawDirection drawDirection;
+ int fontAscent;
+ int fontDescent;
+ int overallAscent;
+ int overallDescent;
+ int overallWidth;
+ int overallLeft;
+ int overallRight;
+} ExtentInfoRec;
+
+typedef struct _CharInfo {
+ xCharInfo metrics; /* info preformatted for Queries */
+ char *bits; /* pointer to glyph image */
+} CharInfoRec;
+
+/*
+ * Font is created at font load time. It is specific to a single encoding.
+ * e.g. not all of the glyphs in a font may be part of a single encoding.
+ */
+
+typedef struct _FontInfo {
+ unsigned short firstCol;
+ unsigned short lastCol;
+ unsigned short firstRow;
+ unsigned short lastRow;
+ unsigned short defaultCh;
+ unsigned int noOverlap:1;
+ unsigned int terminalFont:1;
+ unsigned int constantMetrics:1;
+ unsigned int constantWidth:1;
+ unsigned int inkInside:1;
+ unsigned int inkMetrics:1;
+ unsigned int allExist:1;
+ unsigned int drawDirection:2;
+ unsigned int cachable:1;
+ unsigned int anamorphic:1;
+ short maxOverlap;
+ short pad;
+ xCharInfo maxbounds;
+ xCharInfo minbounds;
+ xCharInfo ink_maxbounds;
+ xCharInfo ink_minbounds;
+ short fontAscent;
+ short fontDescent;
+ int nprops;
+ FontPropPtr props;
+ char *isStringProp;
+} FontInfoRec;
+
+typedef struct _Font {
+ int refcnt;
+ FontInfoRec info;
+ char bit;
+ char byte;
+ char glyph;
+ char scan;
+ fsBitmapFormat format;
+ int (*get_glyphs) (FontPtr /* font */,
+ unsigned long /* count */,
+ unsigned char * /* chars */,
+ FontEncoding /* encoding */,
+ unsigned long * /* count */,
+ CharInfoPtr * /* glyphs */);
+ int (*get_metrics) (FontPtr /* font */,
+ unsigned long /* count */,
+ unsigned char * /* chars */,
+ FontEncoding /* encoding */,
+ unsigned long * /* count */,
+ xCharInfo ** /* glyphs */);
+ void (*unload_font) (FontPtr /* font */);
+ void (*unload_glyphs) (FontPtr /* font */);
+ FontPathElementPtr fpe;
+ pointer svrPrivate;
+ pointer fontPrivate;
+ pointer fpePrivate;
+ int maxPrivate;
+ pointer *devPrivates;
+} FontRec;
+
+#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \
+ (pFont)->devPrivates[n])
+
+#define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \
+ _FontSetNewPrivate (pFont, n, ptr) : \
+ ((((pFont)->devPrivates[n] = (ptr)) != 0) || TRUE))
+
+typedef struct _FontNames {
+ int nnames;
+ int size;
+ int *length;
+ char **names;
+} FontNamesRec;
+
+/* External view of font paths */
+typedef struct _FontPathElement {
+ int name_length;
+ char *name;
+ int type;
+ int refcount;
+ pointer private;
+} FontPathElementRec;
+
+typedef Bool (*NameCheckFunc) (char *name);
+typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
+typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
+typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
+typedef int (*OpenFontFunc) ( pointer client,
+ FontPathElementPtr fpe,
+ Mask flags,
+ char* name,
+ int namelen,
+ fsBitmapFormat format,
+ fsBitmapFormatMask fmask,
+ XID id,
+ FontPtr* pFont,
+ char** aliasName,
+ FontPtr non_cachable_font);
+typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
+typedef int (*ListFontsFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ FontNamesPtr names);
+
+typedef int (*StartLfwiFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ pointer* privatep);
+
+typedef int (*NextLfwiFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char** name,
+ int* namelen,
+ FontInfoPtr* info,
+ int* numFonts,
+ pointer private);
+
+typedef int (*WakeupFpeFunc) (FontPathElementPtr fpe,
+ unsigned long* LastSelectMask);
+
+typedef void (*ClientDiedFunc) (pointer client,
+ FontPathElementPtr fpe);
+
+typedef int (*LoadGlyphsFunc) (pointer client,
+ FontPtr pfont,
+ Bool range_flag,
+ unsigned int nchars,
+ int item_size,
+ unsigned char* data);
+
+typedef int (*StartLaFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ pointer* privatep);
+
+typedef int (*NextLaFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char** namep,
+ int* namelenp,
+ char** resolvedp,
+ int* resolvedlenp,
+ pointer private);
+
+typedef void (*SetPathFunc)(void);
+
+typedef struct _FPEFunctions {
+ NameCheckFunc name_check;
+ InitFpeFunc init_fpe;
+ ResetFpeFunc reset_fpe;
+ FreeFpeFunc free_fpe;
+ OpenFontFunc open_font;
+ CloseFontFunc close_font;
+ ListFontsFunc list_fonts;
+ StartLaFunc start_list_fonts_and_aliases;
+ NextLaFunc list_next_font_or_alias;
+ StartLfwiFunc start_list_fonts_with_info;
+ NextLfwiFunc list_next_font_with_info;
+ WakeupFpeFunc wakeup_fpe;
+ ClientDiedFunc client_died;
+ /* for load_glyphs, range_flag = 0 ->
+ nchars = # of characters in data
+ item_size = bytes/char
+ data = list of characters
+ range_flag = 1 ->
+ nchars = # of fsChar2b's in data
+ item_size is ignored
+ data = list of fsChar2b's */
+ LoadGlyphsFunc load_glyphs;
+ SetPathFunc set_path_hook;
+} FPEFunctionsRec, FPEFunctions;
+
+/*
+ * Various macros for computing values based on contents of
+ * the above structures
+ */
+
+#define GLYPHWIDTHPIXELS(pci) \
+ ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing)
+
+#define GLYPHHEIGHTPIXELS(pci) \
+ ((pci)->metrics.ascent + (pci)->metrics.descent)
+
+#define GLYPHWIDTHBYTES(pci) (((GLYPHWIDTHPIXELS(pci))+7) >> 3)
+
+#define GLYPHWIDTHPADDED(bc) (((bc)+7) & ~0x7)
+
+#define BYTES_PER_ROW(bits, nbytes) \
+ ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
+ :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
+ :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
+ :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \
+ : 0)
+
+#define BYTES_FOR_GLYPH(ci,pad) (GLYPHHEIGHTPIXELS(ci) * \
+ BYTES_PER_ROW(GLYPHWIDTHPIXELS(ci),pad))
+/*
+ * Macros for computing different bounding boxes for fonts; from
+ * the font protocol
+ */
+
+#define FONT_MAX_ASCENT(pi) ((pi)->fontAscent > (pi)->ink_maxbounds.ascent ? \
+ (pi)->fontAscent : (pi)->ink_maxbounds.ascent)
+#define FONT_MAX_DESCENT(pi) ((pi)->fontDescent > (pi)->ink_maxbounds.descent ? \
+ (pi)->fontDescent : (pi)->ink_maxbounds.descent)
+#define FONT_MAX_HEIGHT(pi) (FONT_MAX_ASCENT(pi) + FONT_MAX_DESCENT(pi))
+#define FONT_MIN_LEFT(pi) ((pi)->ink_minbounds.leftSideBearing < 0 ? \
+ (pi)->ink_minbounds.leftSideBearing : 0)
+#define FONT_MAX_RIGHT(pi) ((pi)->ink_maxbounds.rightSideBearing > \
+ (pi)->ink_maxbounds.characterWidth ? \
+ (pi)->ink_maxbounds.rightSideBearing : \
+ (pi)->ink_maxbounds.characterWidth)
+#define FONT_MAX_WIDTH(pi) (FONT_MAX_RIGHT(pi) - FONT_MIN_LEFT(pi))
+
+#include "fontproto.h"
+
+#endif /* FONTSTR_H */
diff --git a/fontsproto/fsmasks.h b/fontsproto/fsmasks.h
new file mode 100644
index 0000000..c86be83
--- /dev/null
+++ b/fontsproto/fsmasks.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 1990, 1991 Network Computing Devices;
+ * Portions Copyright 1987 by Digital Equipment Corporation
+ *
+ * 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, and that the names of Network Computing Devices or Digital
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ * Network Computing Devices and Digital make no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
+ * OR DIGITAL 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.
+ */
+
+/*
+
+Portions Copyright 1987, 1994, 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.
+
+*/
+
+
+/*
+ * masks & values used by the font lib and the font server
+ */
+
+#ifndef _FSMASKS_H_
+#define _FSMASKS_H_
+
+#include <X11/Xmd.h>
+
+/* font format macros */
+#define BitmapFormatByteOrderMask (1L << 0)
+#define BitmapFormatBitOrderMask (1L << 1)
+#define BitmapFormatImageRectMask (3L << 2)
+#define BitmapFormatScanlinePadMask (3L << 8)
+#define BitmapFormatScanlineUnitMask (3L << 12)
+
+#define BitmapFormatByteOrderLSB (0)
+#define BitmapFormatByteOrderMSB (1L << 0)
+#define BitmapFormatBitOrderLSB (0)
+#define BitmapFormatBitOrderMSB (1L << 1)
+
+#define BitmapFormatImageRectMin (0L << 2)
+#define BitmapFormatImageRectMaxWidth (1L << 2)
+#define BitmapFormatImageRectMax (2L << 2)
+
+#define BitmapFormatScanlinePad8 (0L << 8)
+#define BitmapFormatScanlinePad16 (1L << 8)
+#define BitmapFormatScanlinePad32 (2L << 8)
+#define BitmapFormatScanlinePad64 (3L << 8)
+
+#define BitmapFormatScanlineUnit8 (0L << 12)
+#define BitmapFormatScanlineUnit16 (1L << 12)
+#define BitmapFormatScanlineUnit32 (2L << 12)
+#define BitmapFormatScanlineUnit64 (3L << 12)
+
+#define BitmapFormatMaskByte (1L << 0)
+#define BitmapFormatMaskBit (1L << 1)
+#define BitmapFormatMaskImageRectangle (1L << 2)
+#define BitmapFormatMaskScanLinePad (1L << 3)
+#define BitmapFormatMaskScanLineUnit (1L << 4)
+
+typedef CARD32 fsBitmapFormat;
+typedef CARD32 fsBitmapFormatMask;
+
+#endif /* _FSMASKS_H_ */
diff --git a/glproto/.gitignore b/glproto/.gitignore
new file mode 100644
index 0000000..8582544
--- /dev/null
+++ b/glproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for glproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/glproto/COPYING b/glproto/COPYING
new file mode 100644
index 0000000..78b6de4
--- /dev/null
+++ b/glproto/COPYING
@@ -0,0 +1,27 @@
+SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+either this permission notice or a reference to
+http://oss.sgi.com/projects/FreeB/
+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
+SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+shall not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+Silicon Graphics, Inc.
diff --git a/glproto/Makefile.am b/glproto/Makefile.am
new file mode 100644
index 0000000..40cb57c
--- /dev/null
+++ b/glproto/Makefile.am
@@ -0,0 +1,26 @@
+gldir = $(includedir)/GL
+gl_HEADERS = \
+ glxint.h \
+ glxmd.h \
+ glxproto.h \
+ glxtokens.h
+
+glinternaldir = $(includedir)/GL/internal
+glinternal_HEADERS = \
+ glcore.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = glproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/glproto/README b/glproto/README
new file mode 100644
index 0000000..16c59cb
--- /dev/null
+++ b/glproto/README
@@ -0,0 +1,30 @@
+ OpenGL Extension to the X Window System
+
+This extension defines a protocol for the client to send 3D rendering
+commands to the X server.
+
+Extension name: GLX
+
+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/proto/glproto
+
+ http://cgit.freedesktop.org/xorg/proto/glproto
+
+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/glproto/autogen.sh b/glproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/glproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/glproto/configure.ac b/glproto/configure.ac
new file mode 100644
index 0000000..5160edb
--- /dev/null
+++ b/glproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([GLProto], [1.4.11], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ glproto.pc])
diff --git a/glproto/glcore.h b/glproto/glcore.h
new file mode 100644
index 0000000..547b111
--- /dev/null
+++ b/glproto/glcore.h
@@ -0,0 +1,181 @@
+#ifndef __gl_core_h_
+#define __gl_core_h_
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#if !defined(_WIN32_WCE)
+#include <sys/types.h>
+#endif
+
+#define GL_CORE_SGI 1
+#define GL_CORE_MESA 2
+#define GL_CORE_APPLE 4
+#define GL_CORE_WINDOWS 8
+
+typedef struct __GLcontextRec __GLcontext;
+
+/*
+** This file defines the interface between the GL core and the surrounding
+** "operating system" that supports it (currently the GLX or WGL extensions).
+**
+** Members (data and function pointers) are documented as imported or
+** exported according to how they are used by the core rendering functions.
+** Imported members are initialized by the "operating system" and used by
+** the core functions. Exported members are initialized by the core functions
+** and used by the "operating system".
+*/
+
+/**
+ * Mode and limit information for a context. This information is
+ * kept around in the context so that values can be used during
+ * command execution, and for returning information about the
+ * context to the application.
+ *
+ * Instances of this structure are shared by the driver and the loader. To
+ * maintain binary compatability, new fields \b must be added only to the
+ * end of the structure.
+ *
+ * \sa _gl_context_modes_create
+ */
+typedef struct __GLcontextModesRec {
+ struct __GLcontextModesRec * next;
+
+ GLboolean rgbMode;
+ GLboolean floatMode;
+ GLboolean colorIndexMode;
+ GLuint doubleBufferMode;
+ GLuint stereoMode;
+
+ GLboolean haveAccumBuffer;
+ GLboolean haveDepthBuffer;
+ GLboolean haveStencilBuffer;
+
+ GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
+ GLuint redMask, greenMask, blueMask, alphaMask;
+ GLint rgbBits; /* total bits for rgb */
+ GLint indexBits; /* total bits for colorindex */
+
+ GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+ GLint depthBits;
+ GLint stencilBits;
+
+ GLint numAuxBuffers;
+
+ GLint level;
+
+ GLint pixmapMode;
+
+ /* GLX */
+ GLint visualID;
+ GLint visualType; /**< One of the GLX X visual types. (i.e.,
+ * \c GLX_TRUE_COLOR, etc.)
+ */
+
+ /* EXT_visual_rating / GLX 1.2 */
+ GLint visualRating;
+
+ /* EXT_visual_info / GLX 1.2 */
+ GLint transparentPixel;
+ /* colors are floats scaled to ints */
+ GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+ GLint transparentIndex;
+
+ /* ARB_multisample / SGIS_multisample */
+ GLint sampleBuffers;
+ GLint samples;
+
+ /* SGIX_fbconfig / GLX 1.3 */
+ GLint drawableType;
+ GLint renderType;
+ GLint xRenderable;
+ GLint fbconfigID;
+
+ /* SGIX_pbuffer / GLX 1.3 */
+ GLint maxPbufferWidth;
+ GLint maxPbufferHeight;
+ GLint maxPbufferPixels;
+ GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
+ GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
+
+ /* SGIX_visual_select_group */
+ GLint visualSelectGroup;
+
+ /* OML_swap_method */
+ GLint swapMethod;
+
+ GLint screen;
+
+ /* EXT_texture_from_pixmap */
+ GLint bindToTextureRgb;
+ GLint bindToTextureRgba;
+ GLint bindToMipmapTexture;
+ GLint bindToTextureTargets;
+ GLint yInverted;
+} __GLcontextModes;
+
+/* Several fields of __GLcontextModes can take these as values. Since
+ * GLX header files may not be available everywhere they need to be used,
+ * redefine them here.
+ */
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+
+#define GLX_DONT_CARE 0xFFFFFFFF
+
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#endif /* __gl_core_h_ */
diff --git a/glproto/glproto.pc.in b/glproto/glproto.pc.in
new file mode 100644
index 0000000..bd275d8
--- /dev/null
+++ b/glproto/glproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: GLProto
+Description: GL extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/glproto/glxint.h b/glproto/glxint.h
new file mode 100644
index 0000000..9da4910
--- /dev/null
+++ b/glproto/glxint.h
@@ -0,0 +1,137 @@
+#ifndef __GLX_glxint_h__
+#define __GLX_glxint_h__
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include <X11/X.h>
+#include <X11/Xdefs.h>
+#include "GL/gl.h"
+
+typedef struct __GLXvisualConfigRec __GLXvisualConfig;
+typedef struct __GLXFBConfigRec __GLXFBConfig;
+
+struct __GLXvisualConfigRec {
+ VisualID vid;
+ int class;
+ Bool rgba;
+ int redSize, greenSize, blueSize, alphaSize;
+ unsigned long redMask, greenMask, blueMask, alphaMask;
+ int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
+ Bool doubleBuffer;
+ Bool stereo;
+ int bufferSize;
+ int depthSize;
+ int stencilSize;
+ int auxBuffers;
+ int level;
+ /* Start of Extended Visual Properties */
+ int visualRating; /* visual_rating extension */
+ int transparentPixel; /* visual_info extension */
+ /* colors are floats scaled to ints */
+ int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+ int transparentIndex;
+ int multiSampleSize;
+ int nMultiSampleBuffers;
+ int visualSelectGroup;
+};
+
+#define __GLX_MIN_CONFIG_PROPS 18
+#define __GLX_MAX_CONFIG_PROPS 500
+
+#define __GLX_EXT_CONFIG_PROPS 10
+
+/*
+** Since we send all non-core visual properties as token, value pairs,
+** we require 2 words across the wire. In order to maintain backwards
+** compatibility, we need to send the total number of words that the
+** VisualConfigs are sent back in so old libraries can simply "ignore"
+** the new properties.
+*/
+#define __GLX_TOTAL_CONFIG (__GLX_MIN_CONFIG_PROPS + \
+ 2 * __GLX_EXT_CONFIG_PROPS)
+
+struct __GLXFBConfigRec {
+ int visualType;
+ int transparentType;
+ /* colors are floats scaled to ints */
+ int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+ int transparentIndex;
+
+ int visualCaveat;
+
+ int associatedVisualId;
+ int screen;
+
+ int drawableType;
+ int renderType;
+
+ int maxPbufferWidth, maxPbufferHeight, maxPbufferPixels;
+ int optimalPbufferWidth, optimalPbufferHeight; /* for SGIX_pbuffer */
+
+ int visualSelectGroup; /* visuals grouped by select priority */
+
+ unsigned int id;
+
+ GLboolean rgbMode;
+ GLboolean colorIndexMode;
+ GLboolean doubleBufferMode;
+ GLboolean stereoMode;
+ GLboolean haveAccumBuffer;
+ GLboolean haveDepthBuffer;
+ GLboolean haveStencilBuffer;
+
+ /* The number of bits present in various buffers */
+ GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+ GLint depthBits;
+ GLint stencilBits;
+ GLint indexBits;
+ GLint redBits, greenBits, blueBits, alphaBits;
+ GLuint redMask, greenMask, blueMask, alphaMask;
+
+ GLuint multiSampleSize; /* Number of samples per pixel (0 if no ms) */
+
+ GLuint nMultiSampleBuffers; /* Number of availble ms buffers */
+ GLint maxAuxBuffers;
+
+ /* frame buffer level */
+ GLint level;
+
+ /* color ranges (for SGI_color_range) */
+ GLboolean extendedRange;
+ GLdouble minRed, maxRed;
+ GLdouble minGreen, maxGreen;
+ GLdouble minBlue, maxBlue;
+ GLdouble minAlpha, maxAlpha;
+};
+
+#define __GLX_TOTAL_FBCONFIG_PROPS 35
+
+#endif /* !__GLX_glxint_h__ */
diff --git a/glproto/glxmd.h b/glproto/glxmd.h
new file mode 100644
index 0000000..96c07db
--- /dev/null
+++ b/glproto/glxmd.h
@@ -0,0 +1,54 @@
+#ifndef _GLX_glxmd_h_
+#define _GLX_glxmd_h_
+
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+/*
+** Machine dependent declarations.
+*/
+
+/*
+** Define floating point wire types. These are in IEEE format on the wire.
+*/
+typedef float FLOAT32;
+typedef double FLOAT64;
+
+/*
+** Like B32, but this is used to store floats in a request.
+**
+** NOTE: Machines that have a native 32-bit IEEE float can define this as
+** nothing. Machines that don't might mimic the float with an integer,
+** and then define this to :32.
+*/
+#define F32
+
+#endif /* _GLX_glxmd_h_ */
diff --git a/glproto/glxproto.h b/glproto/glxproto.h
new file mode 100644
index 0000000..4783fee
--- /dev/null
+++ b/glproto/glxproto.h
@@ -0,0 +1,2613 @@
+#ifndef _GLX_glxproto_h_
+#define _GLX_glxproto_h_
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include <GL/glxmd.h>
+
+/*****************************************************************************/
+
+/*
+** Errrors.
+*/
+#define GLXBadContext 0
+#define GLXBadContextState 1
+#define GLXBadDrawable 2
+#define GLXBadPixmap 3
+#define GLXBadContextTag 4
+#define GLXBadCurrentWindow 5
+#define GLXBadRenderRequest 6
+#define GLXBadLargeRequest 7
+#define GLXUnsupportedPrivateRequest 8
+#define GLXBadFBConfig 9
+#define GLXBadPbuffer 10
+#define GLXBadCurrentDrawable 11
+#define GLXBadWindow 12
+
+#define __GLX_NUMBER_ERRORS 13
+
+/*
+** Events.
+** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
+** event - this helps initialization if the server supports the pbuffer
+** extension and the client doesn't.
+*/
+#define GLX_PbufferClobber 0
+#define GLX_BufferSwapComplete 1
+
+#define __GLX_NUMBER_EVENTS 17
+
+#define GLX_EXTENSION_NAME "GLX"
+#define GLX_EXTENSION_ALIAS "SGI-GLX"
+
+#define __GLX_MAX_CONTEXT_PROPS 3
+
+#ifndef GLX_VENDOR
+#define GLX_VENDOR 0x1
+#endif
+#ifndef GLX_VERSION
+#define GLX_VERSION 0x2
+#endif
+#ifndef GLX_EXTENSIONS
+#define GLX_EXTENSIONS 0x3
+#endif
+
+/*****************************************************************************/
+
+/*
+** For the structure definitions in this file, we must redefine these types in
+** terms of Xmd.h types, which may include bitfields. All of these are
+** undef'ed at the end of this file, restoring the definitions in glx.h.
+*/
+#define GLXContextID CARD32
+#define GLXPixmap CARD32
+#define GLXDrawable CARD32
+#define GLXPbuffer CARD32
+#define GLXWindow CARD32
+#define GLXFBConfigID CARD32
+#define GLXFBConfigIDSGIX CARD32
+#define GLXPbufferSGIX CARD32
+
+/*
+** ContextTag is not exposed to the API.
+*/
+typedef CARD32 GLXContextTag;
+
+/*****************************************************************************/
+
+/*
+** Sizes of basic wire types.
+*/
+#define __GLX_SIZE_INT8 1
+#define __GLX_SIZE_INT16 2
+#define __GLX_SIZE_INT32 4
+#define __GLX_SIZE_CARD8 1
+#define __GLX_SIZE_CARD16 2
+#define __GLX_SIZE_CARD32 4
+#define __GLX_SIZE_FLOAT32 4
+#define __GLX_SIZE_FLOAT64 8
+
+/*****************************************************************************/
+
+/* Requests */
+
+/*
+** Render command request. A bunch of rendering commands are packed into
+** a single X extension request.
+*/
+typedef struct GLXRender {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXRenderReq;
+#define sz_xGLXRenderReq 8
+
+/*
+** The maximum size that a GLXRender command can be. The value must fit
+** in 16 bits and should be a multiple of 4.
+*/
+#define __GLX_MAX_RENDER_CMD_SIZE 64000
+
+/*
+** Large render command request. A single large rendering command
+** is output in multiple X extension requests. The first packet
+** contains an opcode dependent header (see below) that describes
+** the data that follows.
+*/
+typedef struct GLXRenderLarge {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ CARD16 requestNumber B16;
+ CARD16 requestTotal B16;
+ CARD32 dataBytes B32;
+} xGLXRenderLargeReq;
+#define sz_xGLXRenderLargeReq 16
+
+/*
+** GLX single request. Commands that go over as single GLX protocol
+** requests use this structure. The glxCode will be one of the X_GLsop
+** opcodes.
+*/
+typedef struct GLXSingle {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXSingleReq;
+#define sz_xGLXSingleReq 8
+
+/*
+** glXQueryVersion request
+*/
+typedef struct GLXQueryVersion {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xGLXQueryVersionReq;
+#define sz_xGLXQueryVersionReq 12
+
+/*
+** glXIsDirect request
+*/
+typedef struct GLXIsDirect {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXIsDirectReq;
+#define sz_xGLXIsDirectReq 8
+
+/*
+** glXCreateContext request
+*/
+typedef struct GLXCreateContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+ CARD32 visual B32;
+ CARD32 screen B32;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateContextReq;
+#define sz_xGLXCreateContextReq 24
+
+/*
+** glXDestroyContext request
+*/
+typedef struct GLXDestroyContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXDestroyContextReq;
+#define sz_xGLXDestroyContextReq 8
+
+/*
+** glXMakeCurrent request
+*/
+typedef struct GLXMakeCurrent {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+ GLXContextID context B32;
+ GLXContextTag oldContextTag B32;
+} xGLXMakeCurrentReq;
+#define sz_xGLXMakeCurrentReq 16
+
+/*
+** glXWaitGL request
+*/
+typedef struct GLXWaitGL {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXWaitGLReq;
+#define sz_xGLXWaitGLReq 8
+
+/*
+** glXWaitX request
+*/
+typedef struct GLXWaitX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXWaitXReq;
+#define sz_xGLXWaitXReq 8
+
+/*
+** glXCopyContext request
+*/
+typedef struct GLXCopyContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID source B32;
+ GLXContextID dest B32;
+ CARD32 mask B32;
+ GLXContextTag contextTag B32;
+} xGLXCopyContextReq;
+#define sz_xGLXCopyContextReq 20
+
+/*
+** glXSwapBuffers request
+*/
+typedef struct GLXSwapBuffers {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ GLXDrawable drawable B32;
+} xGLXSwapBuffersReq;
+#define sz_xGLXSwapBuffersReq 12
+
+/*
+** glXUseXFont request
+*/
+typedef struct GLXUseXFont {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ CARD32 font B32;
+ CARD32 first B32;
+ CARD32 count B32;
+ CARD32 listBase B32;
+} xGLXUseXFontReq;
+#define sz_xGLXUseXFontReq 24
+
+/*
+** glXCreateGLXPixmap request
+*/
+typedef struct GLXCreateGLXPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 visual B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+} xGLXCreateGLXPixmapReq;
+#define sz_xGLXCreateGLXPixmapReq 20
+
+/*
+** glXDestroyGLXPixmap request
+*/
+typedef struct GLXDestroyGLXPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPixmap glxpixmap B32;
+} xGLXDestroyGLXPixmapReq;
+#define sz_xGLXDestroyGLXPixmapReq 8
+
+/*
+** glXGetVisualConfigs request
+*/
+typedef struct GLXGetVisualConfigs {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXGetVisualConfigsReq;
+#define sz_xGLXGetVisualConfigsReq 8
+
+/*
+** glXVendorPrivate request.
+*/
+typedef struct GLXVendorPrivate {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag contextTag B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXVendorPrivateReq;
+#define sz_xGLXVendorPrivateReq 12
+
+/*
+** glXVendorPrivateWithReply request
+*/
+typedef struct GLXVendorPrivateWithReply {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag contextTag B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXVendorPrivateWithReplyReq;
+#define sz_xGLXVendorPrivateWithReplyReq 12
+
+/*
+** glXQueryExtensionsString request
+*/
+typedef struct GLXQueryExtensionsString {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXQueryExtensionsStringReq;
+#define sz_xGLXQueryExtensionsStringReq 8
+
+/*
+** glXQueryServerString request
+*/
+typedef struct GLXQueryServerString {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 name B32;
+} xGLXQueryServerStringReq;
+#define sz_xGLXQueryServerStringReq 12
+
+/*
+** glXClientInfo request
+*/
+typedef struct GLXClientInfo {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 major B32;
+ CARD32 minor B32;
+ CARD32 numbytes B32;
+} xGLXClientInfoReq;
+#define sz_xGLXClientInfoReq 16
+
+/*** Start of GLX 1.3 requests */
+
+/*
+** glXGetFBConfigs request
+*/
+typedef struct GLXGetFBConfigs {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXGetFBConfigsReq;
+#define sz_xGLXGetFBConfigsReq 8
+
+/*
+** glXCreatePixmap request
+*/
+typedef struct GLXCreatePixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreatePixmapReq;
+#define sz_xGLXCreatePixmapReq 24
+
+/*
+** glXDestroyPixmap request
+*/
+typedef struct GLXDestroyPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPixmap glxpixmap B32;
+} xGLXDestroyPixmapReq;
+#define sz_xGLXDestroyPixmapReq 8
+
+/*
+** glXCreateNewContext request
+*/
+typedef struct GLXCreateNewContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 screen B32;
+ CARD32 renderType;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateNewContextReq;
+#define sz_xGLXCreateNewContextReq 28
+
+/*
+** glXQueryContext request
+*/
+typedef struct GLXQueryContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXQueryContextReq;
+#define sz_xGLXQueryContextReq 8
+
+/*
+** glXMakeContextCurrent request
+*/
+typedef struct GLXMakeContextCurrent {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag oldContextTag B32;
+ GLXDrawable drawable B32;
+ GLXDrawable readdrawable B32;
+ GLXContextID context B32;
+} xGLXMakeContextCurrentReq;
+#define sz_xGLXMakeContextCurrentReq 20
+
+/*
+** glXCreatePbuffer request
+*/
+typedef struct GLXCreatePbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ GLXPbuffer pbuffer B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreatePbufferReq;
+#define sz_xGLXCreatePbufferReq 20
+
+/*
+** glXDestroyPbuffer request
+*/
+typedef struct GLXDestroyPbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPbuffer pbuffer B32;
+} xGLXDestroyPbufferReq;
+#define sz_xGLXDestroyPbufferReq 8
+
+/*
+** glXGetDrawableAttributes request
+*/
+typedef struct GLXGetDrawableAttributes {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+} xGLXGetDrawableAttributesReq;
+#define sz_xGLXGetDrawableAttributesReq 8
+
+/*
+** glXChangeDrawableAttributes request
+*/
+typedef struct GLXChangeDrawableAttributes {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXChangeDrawableAttributesReq;
+#define sz_xGLXChangeDrawableAttributesReq 12
+
+/*
+** glXCreateWindow request
+*/
+typedef struct GLXCreateWindow {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 window B32;
+ GLXWindow glxwindow B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreateWindowReq;
+#define sz_xGLXCreateWindowReq 24
+
+/*
+** glXDestroyWindow request
+*/
+typedef struct GLXDestroyWindow {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXWindow glxwindow B32;
+} xGLXDestroyWindowReq;
+#define sz_xGLXDestroyWindowReq 8
+
+/* Replies */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 error B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetErrorReply;
+#define sz_xGLXGetErrorReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXMakeCurrentReply;
+#define sz_xGLXMakeCurrentReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXReadPixelsReply;
+#define sz_xGLXReadPixelsReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 depth B32;
+ CARD32 pad6 B32;
+} xGLXGetTexImageReply;
+#define sz_xGLXGetTexImageReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetSeparableFilterReply;
+#define sz_xGLXGetSeparableFilterReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetConvolutionFilterReply;
+#define sz_xGLXGetConvolutionFilterReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetHistogramReply;
+#define sz_xGLXGetHistogramReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetMinmaxReply;
+#define sz_xGLXGetMinmaxReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 newMode B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXRenderModeReply;
+#define sz_xGLXRenderModeReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryVersionReply;
+#define sz_xGLXQueryVersionReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numVisuals B32;
+ CARD32 numProps B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetVisualConfigsReply;
+#define sz_xGLXGetVisualConfigsReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL isDirect;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGLXIsDirectReply;
+#define sz_xGLXIsDirectReply 32
+
+/*
+** This reply structure is used for all single replies. Single replies
+** ship either 1 piece of data or N pieces of data. In these cases
+** size indicates how much data is to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 pad3 B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXSingleReply;
+#define sz_xGLXSingleReply 32
+
+/*
+** This reply structure is used for all Vendor Private replies. Vendor
+** Private replies can ship up to 24 bytes within the header or can
+** be variable sized, in which case, the reply length field indicates
+** the number of words of data which follow the header.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXVendorPrivReply;
+#define sz_xGLXVendorPrivReply 32
+
+/*
+** QueryExtensionsStringReply
+** n indicates the number of bytes to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryExtensionsStringReply;
+#define sz_xGLXQueryExtensionsStringReply 32
+
+/*
+** QueryServerString Reply struct
+** n indicates the number of bytes to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 pad3 B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryServerStringReply;
+#define sz_xGLXQueryServerStringReply 32
+
+/*** Start of GLX 1.3 replies */
+
+/*
+** glXGetFBConfigs reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numFBConfigs B32;
+ CARD32 numAttribs B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetFBConfigsReply;
+#define sz_xGLXGetFBConfigsReply 32
+
+/*
+** glXQueryContext reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 n B32; /* number of attribute/value pairs */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryContextReply;
+#define sz_xGLXQueryContextReply 32
+
+/*
+** glXMakeContextCurrent reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXMakeContextCurrentReply;
+#define sz_xGLXMakeContextCurrentReply 32
+
+/*
+** glXCreateGLXPbuffer reply
+** This is used only in the direct rendering case on SGIs - otherwise
+** CreateGLXPbuffer has no reply. It is not part of GLX 1.3.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 success;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXCreateGLXPbufferReply;
+#define sz_xGLXCreateGLXPbufferReply 32
+
+/*
+** glXGetDrawableAttributes reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numAttribs B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetDrawableAttributesReply;
+#define sz_xGLXGetDrawableAttributesReply 32
+
+/*
+** glXGetColorTable reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetColorTableReply;
+#define sz_xGLXGetColorTableReply 32
+
+/************************************************************************/
+
+/* GLX extension requests and replies */
+
+/*
+** glXQueryContextInfoEXT request
+*/
+typedef struct GLXQueryContextInfoEXT {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXContextID context B32;
+} xGLXQueryContextInfoEXTReq;
+#define sz_xGLXQueryContextInfoEXTReq 16
+
+/*
+** glXQueryContextInfoEXT reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 n B32; /* number of attribute/value pairs */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryContextInfoEXTReply;
+#define sz_xGLXQueryContextInfoEXTReply 32
+
+/*
+** glXMakeCurrentReadSGI request
+*/
+typedef struct GLXMakeCurrentReadSGI {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag oldContextTag B32;
+ GLXDrawable drawable B32;
+ GLXDrawable readable B32;
+ GLXContextID context B32;
+} xGLXMakeCurrentReadSGIReq;
+#define sz_xGLXMakeCurrentReadSGIReq 24
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 writeVid B32;
+ CARD32 writeType B32;
+ CARD32 readVid B32;
+ CARD32 readType B32;
+ CARD32 pad6 B32;
+} xGLXMakeCurrentReadSGIReply;
+#define sz_xGLXMakeCurrentReadSGIReply 32
+
+/*
+** glXGetFBConfigsSGIX request
+*/
+typedef struct GLXGetFBConfigsSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+} xGLXGetFBConfigsSGIXReq;
+#define sz_xGLXGetFBConfigsSGIXReq 16
+
+/*
+** glXCreateContextWithConfigSGIX request
+*/
+
+typedef struct GLXCreateContextWithConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXContextID context B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 screen B32;
+ CARD32 renderType;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateContextWithConfigSGIXReq;
+#define sz_xGLXCreateContextWithConfigSGIXReq 36
+
+/*
+** glXCreatePixmapWithConfigSGIX request
+*/
+
+typedef struct GLXCreateGLXPixmapWithConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+} xGLXCreateGLXPixmapWithConfigSGIXReq;
+#define sz_xGLXCreateGLXPixmapWithConfigSGIXReq 28
+
+/*
+** glXCreateGLXPbufferSGIX request
+*/
+typedef struct GLXCreateGLXPbufferSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ GLXPbuffer pbuffer B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ /* followed by attribute list */
+} xGLXCreateGLXPbufferSGIXReq;
+#define sz_xGLXCreateGLXPbufferSGIXReq 32
+
+/*
+** glXDestroyGLXPbufferSGIX request
+*/
+typedef struct GLXDestroyGLXPbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXPbuffer pbuffer B32;
+} xGLXDestroyGLXPbufferSGIXReq;
+#define sz_xGLXDestroyGLXPbufferSGIXReq 16
+
+/*
+** glXChangeDrawableAttributesSGIX request
+*/
+typedef struct GLXChangeDrawableAttributesSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXDrawable drawable B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXChangeDrawableAttributesSGIXReq;
+#define sz_xGLXChangeDrawableAttributesSGIXReq 20
+
+/*
+** glXGetDrawableAttributesSGIX request
+*/
+typedef struct GLXGetDrawableAttributesSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXDrawable drawable B32;
+} xGLXGetDrawableAttributesSGIXReq;
+#define sz_xGLXGetDrawableAttributesSGIXReq 16
+
+/*
+** glXGetDrawableAttributesSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numAttribs B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetDrawableAttributesSGIXReply;
+#define sz_xGLXGetDrawableAttributesSGIXReply 32
+
+/*
+** glXJoinSwapGroupSGIX request
+*/
+typedef struct GLXJoinSwapGroupSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ GLXDrawable drawable B32;
+ GLXDrawable member B32;
+} xGLXJoinSwapGroupSGIXReq;
+#define sz_xGLXJoinSwapGroupSGIXReq 20
+
+/*
+** glXBindSwapBarrierSGIX request
+*/
+typedef struct GLXBindSwapBarrierSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ GLXDrawable drawable B32;
+ CARD32 barrier B32;
+} xGLXBindSwapBarrierSGIXReq;
+#define sz_xGLXBindSwapBarrierSGIXReq 20
+
+/*
+** glXQueryMaxSwapBarriersSGIX request
+*/
+typedef struct GLXQueryMaxSwapBarriersSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ CARD32 screen B32;
+} xGLXQueryMaxSwapBarriersSGIXReq;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReq 16
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 max B32;
+ CARD32 size B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryMaxSwapBarriersSGIXReply;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReply 32
+
+/*
+** glXQueryHyperpipeNetworkSGIX request
+*/
+typedef struct GLXQueryHyperpipeNetworkSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+} xGLXQueryHyperpipeNetworkSGIXReq;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReq 16
+
+/*
+** glXQueryHyperpipeNetworkSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryHyperpipeNetworkSGIXReply;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReply 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX request
+*/
+typedef struct GLXDestroyHyperpipeConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 hpId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xGLXDestroyHyperpipeConfigSGIXReq;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReq 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 success B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXDestroyHyperpipeConfigSGIXReply;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReply 32
+
+/*
+** glXQueryHyperpipeConfigSGIX request
+*/
+typedef struct GLXQueryHyperpipeConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 hpId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xGLXQueryHyperpipeConfigSGIXReq;
+#define sz_xGLXQueryHyperpipeConfigSGIXReq 32
+
+/*
+** glXQueryHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryHyperpipeConfigSGIXReply;
+#define sz_xGLXQueryHyperpipeConfigSGIXReply 32
+
+/*
+** glXHyperpipeConfigSGIX request
+*/
+typedef struct GLXHyperpipeConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 npipes B32;
+ CARD32 networkId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ /* followed by attribute list */
+} xGLXHyperpipeConfigSGIXReq;
+#define sz_xGLXHyperpipeConfigSGIXReq 32
+
+/*
+** glXHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32;
+ CARD32 hpId B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXHyperpipeConfigSGIXReply;
+#define sz_xGLXHyperpipeConfigSGIXReply 32
+
+/************************************************************************/
+
+/*
+** Events
+*/
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16; /*** was clobber_class */
+ CARD16 draw_type B16;
+ CARD32 drawable B32;
+ CARD32 buffer_mask B32; /*** was mask */
+ CARD16 aux_buffer B16;
+ CARD16 x B16;
+ CARD16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD16 count B16;
+ CARD32 unused2 B32;
+} xGLXPbufferClobberEvent;
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+ CARD32 drawable;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+ CARD32 sbc_hi B32;
+ CARD32 sbc_lo B32;
+} xGLXBufferSwapComplete;
+
+/************************************************************************/
+
+/*
+** Size of the standard X request header.
+*/
+#define __GLX_SINGLE_HDR_SIZE sz_xGLXSingleReq
+#define __GLX_VENDPRIV_HDR_SIZE sz_xGLXVendorPrivateReq
+
+#define __GLX_RENDER_HDR \
+ CARD16 length B16; \
+ CARD16 opcode B16
+
+#define __GLX_RENDER_HDR_SIZE 4
+
+typedef struct {
+ __GLX_RENDER_HDR;
+} __GLXrenderHeader;
+
+#define __GLX_RENDER_LARGE_HDR \
+ CARD32 length B32; \
+ CARD32 opcode B32
+
+#define __GLX_RENDER_LARGE_HDR_SIZE 8
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+} __GLXrenderLargeHeader;
+
+/*
+** The glBitmap, glPolygonStipple, glTexImage[12]D, glTexSubImage[12]D
+** and glDrawPixels calls all have a pixel header transmitted after the
+** Render or RenderLarge header and before their own opcode specific
+** headers.
+*/
+#define __GLX_PIXEL_HDR \
+ BOOL swapBytes; \
+ BOOL lsbFirst; \
+ CARD8 reserved0; \
+ CARD8 reserved1; \
+ CARD32 rowLength B32; \
+ CARD32 skipRows B32; \
+ CARD32 skipPixels B32; \
+ CARD32 alignment B32
+
+#define __GLX_PIXEL_HDR_SIZE 20
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+} __GLXpixelHeader;
+
+/*
+** glTexImage[34]D and glTexSubImage[34]D calls
+** all have a pixel header transmitted after the Render or RenderLarge
+** header and before their own opcode specific headers.
+*/
+#define __GLX_PIXEL_3D_HDR \
+ BOOL swapBytes; \
+ BOOL lsbFirst; \
+ CARD8 reserved0; \
+ CARD8 reserved1; \
+ CARD32 rowLength B32; \
+ CARD32 imageHeight B32; \
+ CARD32 imageDepth B32; \
+ CARD32 skipRows B32; \
+ CARD32 skipImages B32; \
+ CARD32 skipVolumes B32; \
+ CARD32 skipPixels B32; \
+ CARD32 alignment B32
+
+#define __GLX_PIXEL_3D_HDR_SIZE 36
+
+/*
+** Data that is specific to a glBitmap call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Pixel header
+** Bitmap header
+*/
+#define __GLX_BITMAP_HDR \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ FLOAT32 xorig F32; \
+ FLOAT32 yorig F32; \
+ FLOAT32 xmove F32; \
+ FLOAT32 ymove F32
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXbitmapHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXbitmapLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXdispatchBitmapHeader;
+
+#define __GLX_BITMAP_HDR_SIZE 24
+
+#define __GLX_BITMAP_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+#define __GLX_BITMAP_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+} __GLXpolygonStippleHeader;
+
+#define __GLX_POLYGONSTIPPLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE)
+
+/*
+** Data that is specific to a glTexImage1D or glTexImage2D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** TexImage header
+** When a glTexImage1D call the height field is unexamined by the server.
+*/
+#define __GLX_TEXIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 components B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 border B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_TEXIMAGE_HDR_SIZE 32
+
+#define __GLX_TEXIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXtexImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXtexImageLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXdispatchTexImageHeader;
+
+/*
+** Data that is specific to a glTexImage3D or glTexImage4D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel 3D header
+** TexImage 3D header
+** When a glTexImage3D call the size4d and woffset fields are unexamined
+** by the server.
+** Could be used by all TexImage commands and perhaps should be in the
+** future.
+*/
+#define __GLX_TEXIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 size4d B32; \
+ CARD32 border B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullimage B32
+
+#define __GLX_TEXIMAGE_3D_HDR_SIZE 44
+
+#define __GLX_TEXIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+ __GLX_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXdispatchTexImage3DHeader;
+
+/*
+** Data that is specific to a glTexSubImage1D or glTexSubImage2D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** TexSubImage header
+** When a glTexSubImage1D call is made, the yoffset and height fields
+** are unexamined by the server and are considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullImage \
+
+#define __GLX_TEXSUBIMAGE_HDR_SIZE 36
+
+#define __GLX_TEXSUBIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXdispatchTexSubImageHeader;
+
+/*
+** Data that is specific to a glTexSubImage3D and 4D calls. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel 3D header
+** TexSubImage 3D header
+** When a glTexSubImage3D call is made, the woffset and size4d fields
+** are unexamined by the server and are considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 zoffset B32; \
+ CARD32 woffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 size4d B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullImage \
+
+#define __GLX_TEXSUBIMAGE_3D_HDR_SIZE 52
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+ __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchTexSubImage3DHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage1D or
+ * \c glCompressedTexImage2D call. The data is sent in the following
+ * order:
+ * - Render or RenderLarge header
+ * - CompressedTexImage header
+ *
+ * When a \c glCompressedTexImage1D call is made, the \c height field is
+ * not examined by the server and is considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalFormat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 border B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE 28
+
+#define __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXdispatchCompressedTexImageHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage1D or
+ * \c glCompressedTexSubImage2D call. The data is sent in the following
+ * order:
+ * - Render or RenderLarge header
+ * - CompressedTexSubImage header
+ *
+ * When a \c glCompressedTexSubImage1D call is made, the \c yoffset and
+ * \c height fields are not examined by the server and are considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXdispatchCompressedTexSubImageHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage3D call. The data is
+ * sent in the following order:
+ * - Render or RenderLarge header
+ * - CompressedTexImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalFormat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 border B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexImage3DHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage3D call. The data is
+ * sent in the following order:
+ * - Render or RenderLarge header
+ * - CompressedTexSubImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 zoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 format B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexSubImage3DHeader;
+
+/*
+** Data that is specific to a glDrawPixels call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Pixel header
+** DrawPixels header
+*/
+#define __GLX_DRAWPIXELS_HDR \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_DRAWPIXELS_HDR_SIZE 16
+
+#define __GLX_DRAWPIXELS_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+#define __GLX_DRAWPIXELS_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdispatchDrawPixelsHeader;
+
+/*
+** Data that is specific to a glConvolutionFilter1D or glConvolutionFilter2D
+** call. The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ConvolutionFilter header
+** When a glConvolutionFilter1D call the height field is unexamined by the server.
+*/
+#define __GLX_CONV_FILT_HDR \
+ CARD32 target B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_CONV_FILT_HDR_SIZE 24
+
+#define __GLX_CONV_FILT_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+
+#define __GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXdispatchConvolutionFilterHeader;
+
+/*
+** Data that is specific to a glDrawArraysEXT call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Draw Arrays header
+** a variable number of Component headers
+** vertex data for each component type
+*/
+
+#define __GLX_DRAWARRAYS_HDR \
+ CARD32 numVertexes B32; \
+ CARD32 numComponents B32; \
+ CARD32 primType B32
+
+#define __GLX_DRAWARRAYS_HDR_SIZE 12
+
+#define __GLX_DRAWARRAYS_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_DRAWARRAYS_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysLargeHeader;
+
+typedef struct {
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdispatchDrawArraysHeader;
+
+#define __GLX_COMPONENT_HDR \
+ CARD32 datatype B32; \
+ INT32 numVals B32; \
+ CARD32 component B32
+
+typedef struct {
+ __GLX_COMPONENT_HDR;
+} __GLXdispatchDrawArraysComponentHeader;
+
+#define __GLX_COMPONENT_HDR_SIZE 12
+
+/*
+** Data that is specific to a glColorTable call
+** The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ColorTable header
+*/
+
+#define __GLX_COLOR_TABLE_HDR \
+ CARD32 target B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_COLOR_TABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_TABLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_COLOR_TABLE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXdispatchColorTableHeader;
+
+/*
+** Data that is specific to a glColorSubTable call
+** The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ColorTable header
+*/
+
+#define __GLX_COLOR_SUBTABLE_HDR \
+ CARD32 target B32; \
+ CARD32 start B32; \
+ CARD32 count B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_COLOR_SUBTABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_SUBTABLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + \
+ __GLX_COLOR_SUBTABLE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXdispatchColorSubTableHeader;
+
+#define GLX_WINDOW_TYPE 1
+#define GLX_PIXMAP_TYPE 2
+#define GLX_VIDEO_SOURCE_TYPE 3
+#define GLX_PBUFFER_TYPE 4
+/* 5 is for DM_PBUFFER */
+#define GLX_GLXWINDOW_TYPE 6
+
+/*****************************************************************************/
+
+/*
+** Restore these definitions back to the typedefs in glx.h
+*/
+#undef GLXContextID
+#undef GLXPixmap
+#undef GLXDrawable
+#undef GLXPbuffer
+#undef GLXWindow
+#undef GLXFBConfigID
+#undef GLXFBConfigIDSGIX
+#undef GLXPbufferSGIX
+
+
+/* Opcodes for GLX commands */
+
+#define X_GLXRender 1
+#define X_GLXRenderLarge 2
+#define X_GLXCreateContext 3
+#define X_GLXDestroyContext 4
+#define X_GLXMakeCurrent 5
+#define X_GLXIsDirect 6
+#define X_GLXQueryVersion 7
+#define X_GLXWaitGL 8
+#define X_GLXWaitX 9
+#define X_GLXCopyContext 10
+#define X_GLXSwapBuffers 11
+#define X_GLXUseXFont 12
+#define X_GLXCreateGLXPixmap 13
+#define X_GLXGetVisualConfigs 14
+#define X_GLXDestroyGLXPixmap 15
+#define X_GLXVendorPrivate 16
+#define X_GLXVendorPrivateWithReply 17
+#define X_GLXQueryExtensionsString 18
+#define X_GLXQueryServerString 19
+#define X_GLXClientInfo 20
+#define X_GLXGetFBConfigs 21
+#define X_GLXCreatePixmap 22
+#define X_GLXDestroyPixmap 23
+#define X_GLXCreateNewContext 24
+#define X_GLXQueryContext 25
+#define X_GLXMakeContextCurrent 26
+#define X_GLXCreatePbuffer 27
+#define X_GLXDestroyPbuffer 28
+#define X_GLXGetDrawableAttributes 29
+#define X_GLXChangeDrawableAttributes 30
+#define X_GLXCreateWindow 31
+#define X_GLXDestroyWindow 32
+
+
+/* Opcodes for single commands (part of GLX command space) */
+
+#define X_GLsop_NewList 101
+#define X_GLsop_EndList 102
+#define X_GLsop_DeleteLists 103
+#define X_GLsop_GenLists 104
+#define X_GLsop_FeedbackBuffer 105
+#define X_GLsop_SelectBuffer 106
+#define X_GLsop_RenderMode 107
+#define X_GLsop_Finish 108
+#define X_GLsop_Flush 142
+#define X_GLsop_PixelStoref 109
+#define X_GLsop_PixelStorei 110
+#define X_GLsop_ReadPixels 111
+#define X_GLsop_GetBooleanv 112
+#define X_GLsop_GetClipPlane 113
+#define X_GLsop_GetDoublev 114
+#define X_GLsop_GetError 115
+#define X_GLsop_GetFloatv 116
+#define X_GLsop_GetIntegerv 117
+#define X_GLsop_GetLightfv 118
+#define X_GLsop_GetLightiv 119
+#define X_GLsop_GetMapdv 120
+#define X_GLsop_GetMapfv 121
+#define X_GLsop_GetMapiv 122
+#define X_GLsop_GetMaterialfv 123
+#define X_GLsop_GetMaterialiv 124
+#define X_GLsop_GetPixelMapfv 125
+#define X_GLsop_GetPixelMapuiv 126
+#define X_GLsop_GetPixelMapusv 127
+#define X_GLsop_GetPolygonStipple 128
+#define X_GLsop_GetString 129
+#define X_GLsop_GetTexEnvfv 130
+#define X_GLsop_GetTexEnviv 131
+#define X_GLsop_GetTexGendv 132
+#define X_GLsop_GetTexGenfv 133
+#define X_GLsop_GetTexGeniv 134
+#define X_GLsop_GetTexImage 135
+#define X_GLsop_GetTexParameterfv 136
+#define X_GLsop_GetTexParameteriv 137
+#define X_GLsop_GetTexLevelParameterfv 138
+#define X_GLsop_GetTexLevelParameteriv 139
+#define X_GLsop_IsEnabled 140
+#define X_GLsop_IsList 141
+#define X_GLsop_AreTexturesResident 143
+#define X_GLsop_DeleteTextures 144
+#define X_GLsop_GenTextures 145
+#define X_GLsop_IsTexture 146
+#define X_GLsop_GetColorTable 147
+#define X_GLsop_GetColorTableParameterfv 148
+#define X_GLsop_GetColorTableParameteriv 149
+#define X_GLsop_GetConvolutionFilter 150
+#define X_GLsop_GetConvolutionParameterfv 151
+#define X_GLsop_GetConvolutionParameteriv 152
+#define X_GLsop_GetSeparableFilter 153
+#define X_GLsop_GetHistogram 154
+#define X_GLsop_GetHistogramParameterfv 155
+#define X_GLsop_GetHistogramParameteriv 156
+#define X_GLsop_GetMinmax 157
+#define X_GLsop_GetMinmaxParameterfv 158
+#define X_GLsop_GetMinmaxParameteriv 159
+#define X_GLsop_GetCompressedTexImage 160
+
+
+/* Opcodes for rendering commands */
+
+#define X_GLrop_CallList 1
+#define X_GLrop_CallLists 2
+#define X_GLrop_ListBase 3
+#define X_GLrop_Begin 4
+#define X_GLrop_Bitmap 5
+#define X_GLrop_Color3bv 6
+#define X_GLrop_Color3dv 7
+#define X_GLrop_Color3fv 8
+#define X_GLrop_Color3iv 9
+#define X_GLrop_Color3sv 10
+#define X_GLrop_Color3ubv 11
+#define X_GLrop_Color3uiv 12
+#define X_GLrop_Color3usv 13
+#define X_GLrop_Color4bv 14
+#define X_GLrop_Color4dv 15
+#define X_GLrop_Color4fv 16
+#define X_GLrop_Color4iv 17
+#define X_GLrop_Color4sv 18
+#define X_GLrop_Color4ubv 19
+#define X_GLrop_Color4uiv 20
+#define X_GLrop_Color4usv 21
+#define X_GLrop_EdgeFlagv 22
+#define X_GLrop_End 23
+#define X_GLrop_Indexdv 24
+#define X_GLrop_Indexfv 25
+#define X_GLrop_Indexiv 26
+#define X_GLrop_Indexsv 27
+#define X_GLrop_Normal3bv 28
+#define X_GLrop_Normal3dv 29
+#define X_GLrop_Normal3fv 30
+#define X_GLrop_Normal3iv 31
+#define X_GLrop_Normal3sv 32
+#define X_GLrop_RasterPos2dv 33
+#define X_GLrop_RasterPos2fv 34
+#define X_GLrop_RasterPos2iv 35
+#define X_GLrop_RasterPos2sv 36
+#define X_GLrop_RasterPos3dv 37
+#define X_GLrop_RasterPos3fv 38
+#define X_GLrop_RasterPos3iv 39
+#define X_GLrop_RasterPos3sv 40
+#define X_GLrop_RasterPos4dv 41
+#define X_GLrop_RasterPos4fv 42
+#define X_GLrop_RasterPos4iv 43
+#define X_GLrop_RasterPos4sv 44
+#define X_GLrop_Rectdv 45
+#define X_GLrop_Rectfv 46
+#define X_GLrop_Rectiv 47
+#define X_GLrop_Rectsv 48
+#define X_GLrop_TexCoord1dv 49
+#define X_GLrop_TexCoord1fv 50
+#define X_GLrop_TexCoord1iv 51
+#define X_GLrop_TexCoord1sv 52
+#define X_GLrop_TexCoord2dv 53
+#define X_GLrop_TexCoord2fv 54
+#define X_GLrop_TexCoord2iv 55
+#define X_GLrop_TexCoord2sv 56
+#define X_GLrop_TexCoord3dv 57
+#define X_GLrop_TexCoord3fv 58
+#define X_GLrop_TexCoord3iv 59
+#define X_GLrop_TexCoord3sv 60
+#define X_GLrop_TexCoord4dv 61
+#define X_GLrop_TexCoord4fv 62
+#define X_GLrop_TexCoord4iv 63
+#define X_GLrop_TexCoord4sv 64
+#define X_GLrop_Vertex2dv 65
+#define X_GLrop_Vertex2fv 66
+#define X_GLrop_Vertex2iv 67
+#define X_GLrop_Vertex2sv 68
+#define X_GLrop_Vertex3dv 69
+#define X_GLrop_Vertex3fv 70
+#define X_GLrop_Vertex3iv 71
+#define X_GLrop_Vertex3sv 72
+#define X_GLrop_Vertex4dv 73
+#define X_GLrop_Vertex4fv 74
+#define X_GLrop_Vertex4iv 75
+#define X_GLrop_Vertex4sv 76
+#define X_GLrop_ClipPlane 77
+#define X_GLrop_ColorMaterial 78
+#define X_GLrop_CullFace 79
+#define X_GLrop_Fogf 80
+#define X_GLrop_Fogfv 81
+#define X_GLrop_Fogi 82
+#define X_GLrop_Fogiv 83
+#define X_GLrop_FrontFace 84
+#define X_GLrop_Hint 85
+#define X_GLrop_Lightf 86
+#define X_GLrop_Lightfv 87
+#define X_GLrop_Lighti 88
+#define X_GLrop_Lightiv 89
+#define X_GLrop_LightModelf 90
+#define X_GLrop_LightModelfv 91
+#define X_GLrop_LightModeli 92
+#define X_GLrop_LightModeliv 93
+#define X_GLrop_LineStipple 94
+#define X_GLrop_LineWidth 95
+#define X_GLrop_Materialf 96
+#define X_GLrop_Materialfv 97
+#define X_GLrop_Materiali 98
+#define X_GLrop_Materialiv 99
+#define X_GLrop_PointSize 100
+#define X_GLrop_PolygonMode 101
+#define X_GLrop_PolygonStipple 102
+#define X_GLrop_Scissor 103
+#define X_GLrop_ShadeModel 104
+#define X_GLrop_TexParameterf 105
+#define X_GLrop_TexParameterfv 106
+#define X_GLrop_TexParameteri 107
+#define X_GLrop_TexParameteriv 108
+#define X_GLrop_TexImage1D 109
+#define X_GLrop_TexImage2D 110
+#define X_GLrop_TexEnvf 111
+#define X_GLrop_TexEnvfv 112
+#define X_GLrop_TexEnvi 113
+#define X_GLrop_TexEnviv 114
+#define X_GLrop_TexGend 115
+#define X_GLrop_TexGendv 116
+#define X_GLrop_TexGenf 117
+#define X_GLrop_TexGenfv 118
+#define X_GLrop_TexGeni 119
+#define X_GLrop_TexGeniv 120
+#define X_GLrop_InitNames 121
+#define X_GLrop_LoadName 122
+#define X_GLrop_PassThrough 123
+#define X_GLrop_PopName 124
+#define X_GLrop_PushName 125
+#define X_GLrop_DrawBuffer 126
+#define X_GLrop_Clear 127
+#define X_GLrop_ClearAccum 128
+#define X_GLrop_ClearIndex 129
+#define X_GLrop_ClearColor 130
+#define X_GLrop_ClearStencil 131
+#define X_GLrop_ClearDepth 132
+#define X_GLrop_StencilMask 133
+#define X_GLrop_ColorMask 134
+#define X_GLrop_DepthMask 135
+#define X_GLrop_IndexMask 136
+#define X_GLrop_Accum 137
+#define X_GLrop_Disable 138
+#define X_GLrop_Enable 139
+#define X_GLrop_PopAttrib 141
+#define X_GLrop_PushAttrib 142
+#define X_GLrop_Map1d 143
+#define X_GLrop_Map1f 144
+#define X_GLrop_Map2d 145
+#define X_GLrop_Map2f 146
+#define X_GLrop_MapGrid1d 147
+#define X_GLrop_MapGrid1f 148
+#define X_GLrop_MapGrid2d 149
+#define X_GLrop_MapGrid2f 150
+#define X_GLrop_EvalCoord1dv 151
+#define X_GLrop_EvalCoord1fv 152
+#define X_GLrop_EvalCoord2dv 153
+#define X_GLrop_EvalCoord2fv 154
+#define X_GLrop_EvalMesh1 155
+#define X_GLrop_EvalPoint1 156
+#define X_GLrop_EvalMesh2 157
+#define X_GLrop_EvalPoint2 158
+#define X_GLrop_AlphaFunc 159
+#define X_GLrop_BlendFunc 160
+#define X_GLrop_LogicOp 161
+#define X_GLrop_StencilFunc 162
+#define X_GLrop_StencilOp 163
+#define X_GLrop_DepthFunc 164
+#define X_GLrop_PixelZoom 165
+#define X_GLrop_PixelTransferf 166
+#define X_GLrop_PixelTransferi 167
+#define X_GLrop_PixelMapfv 168
+#define X_GLrop_PixelMapuiv 169
+#define X_GLrop_PixelMapusv 170
+#define X_GLrop_ReadBuffer 171
+#define X_GLrop_CopyPixels 172
+#define X_GLrop_DrawPixels 173
+#define X_GLrop_DepthRange 174
+#define X_GLrop_Frustum 175
+#define X_GLrop_LoadIdentity 176
+#define X_GLrop_LoadMatrixf 177
+#define X_GLrop_LoadMatrixd 178
+#define X_GLrop_MatrixMode 179
+#define X_GLrop_MultMatrixf 180
+#define X_GLrop_MultMatrixd 181
+#define X_GLrop_Ortho 182
+#define X_GLrop_PopMatrix 183
+#define X_GLrop_PushMatrix 184
+#define X_GLrop_Rotated 185
+#define X_GLrop_Rotatef 186
+#define X_GLrop_Scaled 187
+#define X_GLrop_Scalef 188
+#define X_GLrop_Translated 189
+#define X_GLrop_Translatef 190
+#define X_GLrop_Viewport 191
+#define X_GLrop_DrawArrays 193
+#define X_GLrop_PolygonOffset 192
+#define X_GLrop_CopyTexImage1D 4119
+#define X_GLrop_CopyTexImage2D 4120
+#define X_GLrop_CopyTexSubImage1D 4121
+#define X_GLrop_CopyTexSubImage2D 4122
+#define X_GLrop_TexSubImage1D 4099
+#define X_GLrop_TexSubImage2D 4100
+#define X_GLrop_BindTexture 4117
+#define X_GLrop_PrioritizeTextures 4118
+#define X_GLrop_Indexubv 194
+#define X_GLrop_BlendColor 4096
+#define X_GLrop_BlendEquation 4097
+#define X_GLrop_ColorTable 2053
+#define X_GLrop_ColorTableParameterfv 2054
+#define X_GLrop_ColorTableParameteriv 2055
+#define X_GLrop_CopyColorTable 2056
+#define X_GLrop_ColorSubTable 195
+#define X_GLrop_CopyColorSubTable 196
+#define X_GLrop_ConvolutionFilter1D 4101
+#define X_GLrop_ConvolutionFilter2D 4102
+#define X_GLrop_ConvolutionParameterf 4103
+#define X_GLrop_ConvolutionParameterfv 4104
+#define X_GLrop_ConvolutionParameteri 4105
+#define X_GLrop_ConvolutionParameteriv 4106
+#define X_GLrop_CopyConvolutionFilter1D 4107
+#define X_GLrop_CopyConvolutionFilter2D 4108
+#define X_GLrop_SeparableFilter2D 4109
+#define X_GLrop_Histogram 4110
+#define X_GLrop_Minmax 4111
+#define X_GLrop_ResetHistogram 4112
+#define X_GLrop_ResetMinmax 4113
+#define X_GLrop_TexImage3D 4114
+#define X_GLrop_TexSubImage3D 4115
+#define X_GLrop_CopyTexSubImage3D 4123
+#define X_GLrop_DrawArraysEXT 4116
+
+/* Added for core GL version 1.3 */
+
+#define X_GLrop_ActiveTextureARB 197
+#define X_GLrop_MultiTexCoord1dvARB 198
+#define X_GLrop_MultiTexCoord1fvARB 199
+#define X_GLrop_MultiTexCoord1ivARB 200
+#define X_GLrop_MultiTexCoord1svARB 201
+#define X_GLrop_MultiTexCoord2dvARB 202
+#define X_GLrop_MultiTexCoord2fvARB 203
+#define X_GLrop_MultiTexCoord2ivARB 204
+#define X_GLrop_MultiTexCoord2svARB 205
+#define X_GLrop_MultiTexCoord3dvARB 206
+#define X_GLrop_MultiTexCoord3fvARB 207
+#define X_GLrop_MultiTexCoord3ivARB 208
+#define X_GLrop_MultiTexCoord3svARB 209
+#define X_GLrop_MultiTexCoord4dvARB 210
+#define X_GLrop_MultiTexCoord4fvARB 211
+#define X_GLrop_MultiTexCoord4ivARB 212
+#define X_GLrop_MultiTexCoord4svARB 213
+#define X_GLrop_CompressedTexImage1D 214
+#define X_GLrop_CompressedTexImage2D 215
+#define X_GLrop_CompressedTexImage3D 216
+#define X_GLrop_CompressedTexSubImage1D 217
+#define X_GLrop_CompressedTexSubImage2D 218
+#define X_GLrop_CompressedTexSubImage3D 219
+#define X_GLrop_SampleCoverageARB 229
+
+/* Added for core GL version 1.4 */
+
+#define X_GLrop_WindowPos3fARB 230
+#define X_GLrop_FogCoordfv 4124
+#define X_GLrop_FogCoorddv 4125
+#define X_GLrop_PointParameterfARB 2065
+#define X_GLrop_PointParameterfvARB 2066
+#define X_GLrop_SecondaryColor3bv 4126
+#define X_GLrop_SecondaryColor3sv 4127
+#define X_GLrop_SecondaryColor3iv 4128
+#define X_GLrop_SecondaryColor3fv 4129
+#define X_GLrop_SecondaryColor3dv 4130
+#define X_GLrop_SecondaryColor3ubv 4131
+#define X_GLrop_SecondaryColor3usv 4132
+#define X_GLrop_SecondaryColor3uiv 4133
+#define X_GLrop_BlendFuncSeparate 4134
+#define X_GLrop_PointParameteri 4221
+#define X_GLrop_PointParameteriv 4222
+
+/* Added for core GL version 1.5 */
+/* XXX opcodes not defined in the spec */
+
+/* Opcodes for Vendor Private commands */
+
+
+#define X_GLvop_GetConvolutionFilterEXT 1
+#define X_GLvop_GetConvolutionParameterfvEXT 2
+#define X_GLvop_GetConvolutionParameterivEXT 3
+#define X_GLvop_GetSeparableFilterEXT 4
+#define X_GLvop_GetHistogramEXT 5
+#define X_GLvop_GetHistogramParameterfvEXT 6
+#define X_GLvop_GetHistogramParameterivEXT 7
+#define X_GLvop_GetMinmaxEXT 8
+#define X_GLvop_GetMinmaxParameterfvEXT 9
+#define X_GLvop_GetMinmaxParameterivEXT 10
+#define X_GLvop_AreTexturesResidentEXT 11
+#define X_GLvop_DeleteTexturesEXT 12
+#define X_GLvop_GenTexturesEXT 13
+#define X_GLvop_IsTextureEXT 14
+#define X_GLvop_GetCombinerInputParameterfvNV 1270
+#define X_GLvop_GetCombinerInputParameterivNV 1271
+#define X_GLvop_GetCombinerOutputParameterfvNV 1272
+#define X_GLvop_GetCombinerOutputParameterivNV 1273
+#define X_GLvop_GetFinalCombinerOutputParameterfvNV 1274
+#define X_GLvop_GetFinalCombinerOutputParameterivNV 1275
+#define X_GLvop_DeleteFenceNV 1276
+#define X_GLvop_GenFencesNV 1277
+#define X_GLvop_IsFenceNV 1278
+#define X_GLvop_TestFenceNV 1279
+#define X_GLvop_GetFenceivNV 1280
+#define X_GLvop_AreProgramsResidentNV 1293
+#define X_GLvop_DeleteProgramARB 1294
+#define X_GLvop_GenProgramsARB 1295
+#define X_GLvop_GetProgramEnvParameterfvARB 1296
+#define X_GLvop_GetProgramEnvParameterdvARB 1297
+#define X_GLvop_GetProgramEnvParameterivNV 1298
+#define X_GLvop_GetProgramStringNV 1299
+#define X_GLvop_GetTrackMatrixivNV 1300
+#define X_GLvop_GetVertexAttribdvARB 1301
+#define X_GLvop_GetVertexAttribfvARB 1302
+#define X_GLvop_GetVertexAttribivARB 1303
+#define X_GLvop_IsProgramARB 1304
+#define X_GLvop_GetProgramLocalParameterfvARB 1305
+#define X_GLvop_GetProgramLocalParameterdvARB 1306
+#define X_GLvop_GetProgramivARB 1307
+#define X_GLvop_GetProgramStringARB 1308
+#define X_GLvop_GetProgramNamedParameter4fvNV 1310
+#define X_GLvop_GetProgramNamedParameter4dvNV 1311
+#define X_GLvop_SampleMaskSGIS 2048
+#define X_GLvop_SamplePatternSGIS 2049
+#define X_GLvop_GetDetailTexFuncSGIS 4096
+#define X_GLvop_GetSharpenTexFuncSGIS 4097
+#define X_GLvop_GetColorTableSGI 4098
+#define X_GLvop_GetColorTableParameterfvSGI 4099
+#define X_GLvop_GetColorTableParameterivSGI 4100
+#define X_GLvop_GetTexFilterFuncSGIS 4101
+#define X_GLvop_GetInstrumentsSGIX 4102
+#define X_GLvop_InstrumentsBufferSGIX 4103
+#define X_GLvop_PollInstrumentsSGIX 4104
+#define X_GLvop_FlushRasterSGIX 4105
+
+/* Opcodes for GLX vendor private commands */
+
+#define X_GLXvop_QueryContextInfoEXT 1024
+#define X_GLXvop_BindTexImageEXT 1330
+#define X_GLXvop_ReleaseTexImageEXT 1331
+#define X_GLXvop_SwapIntervalSGI 65536
+#define X_GLXvop_MakeCurrentReadSGI 65537
+#define X_GLXvop_CreateGLXVideoSourceSGIX 65538
+#define X_GLXvop_DestroyGLXVideoSourceSGIX 65539
+#define X_GLXvop_GetFBConfigsSGIX 65540
+#define X_GLXvop_CreateContextWithConfigSGIX 65541
+#define X_GLXvop_CreateGLXPixmapWithConfigSGIX 65542
+#define X_GLXvop_CreateGLXPbufferSGIX 65543
+#define X_GLXvop_DestroyGLXPbufferSGIX 65544
+#define X_GLXvop_ChangeDrawableAttributesSGIX 65545
+#define X_GLXvop_GetDrawableAttributesSGIX 65546
+#define X_GLXvop_JoinSwapGroupSGIX 65547
+#define X_GLXvop_BindSwapBarrierSGIX 65548
+#define X_GLXvop_QueryMaxSwapBarriersSGIX 65549
+#define X_GLXvop_QueryHyperpipeNetworkSGIX 65550
+#define X_GLXvop_QueryHyperpipeConfigSGIX 65551
+#define X_GLXvop_HyperpipeConfigSGIX 65552
+#define X_GLXvop_DestroyHyperpipeConfigSGIX 65553
+
+/* ARB extension opcodes */
+
+/* 1. GL_ARB_multitexture - see GL 1.2 opcodes */
+/* 5. GL_ARB_multisample - see GL 1.3 opcodes */
+/* 12. GL_ARB_texture_compression - see GL 1.3 opcodes */
+/* 14. GL_ARB_point_parameters - see GL 1.4 opcodees */
+
+/* 15. GL_ARB_vertex_blend */
+#define X_GLrop_WeightbvARB 220
+#define X_GLrop_WeightubvARB 221
+#define X_GLrop_WeightsvARB 222
+#define X_GLrop_WeightusvARB 223
+#define X_GLrop_WeightivARB 224
+#define X_GLrop_WeightuivARB 225
+#define X_GLrop_VertexBlendARB 226
+#define X_GLrop_WeightfvARB 227
+#define X_GLrop_WeightdvARB 228
+
+/* 16. GL_ARB_matrix_palette */
+/* XXX opcodes not defined in the spec */
+
+/* 25. GL_ARB_window_pos - see GL 1.4 opcodes */
+
+/* 26. GL_ARB_vertex_program */
+#define X_GLrop_BindProgramARB 4180
+#define X_GLrop_ProgramEnvParameter4fvARB 4184
+#define X_GLrop_ProgramEnvParameter4dvARB 4185
+#define X_GLrop_VertexAttrib1svARB 4189
+#define X_GLrop_VertexAttrib2svARB 4190
+#define X_GLrop_VertexAttrib3svARB 4191
+#define X_GLrop_VertexAttrib4svARB 4192
+#define X_GLrop_VertexAttrib1fvARB 4193
+#define X_GLrop_VertexAttrib2fvARB 4194
+#define X_GLrop_VertexAttrib3fvARB 4195
+#define X_GLrop_VertexAttrib4fvARB 4196
+#define X_GLrop_VertexAttrib1dvARB 4197
+#define X_GLrop_VertexAttrib2dvARB 4198
+#define X_GLrop_VertexAttrib3dvARB 4199
+#define X_GLrop_ProgramLocalParameter4fvARB 4215
+#define X_GLrop_ProgramLocalParameter4dvARB 4216
+#define X_GLrop_ProgramStringARB 4217
+#define X_GLrop_VertexAttrib4dvARB 4200
+#define X_GLrop_VertexAttrib4NubvARB 4201
+#define X_GLrop_VertexAttrib4bvARB 4230
+#define X_GLrop_VertexAttrib4ivARB 4231
+#define X_GLrop_VertexAttrib4ubvARB 4232
+#define X_GLrop_VertexAttrib4usvARB 4233
+#define X_GLrop_VertexAttrib4uivARB 4234
+#define X_GLrop_VertexAttrib4NbvARB 4235
+#define X_GLrop_VertexAttrib4NsvARB 4236
+#define X_GLrop_VertexAttrib4NivARB 4237
+#define X_GLrop_VertexAttrib4NusvARB 4238
+#define X_GLrop_VertexAttrib4NuivARB 4239
+
+/* 27. GL_ARB_fragment_program - see GL_ARB_vertex_program opcodes */
+
+/* 29. GL_ARB_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+
+/* New extension opcodes */
+
+/* 145. GL_EXT_secondary_color - see GL 1.4 opcodes */
+
+/* 188. GL_EXT_vertex_weighting */
+#define X_GLrop_VertexWeightfvEXT 4135
+
+/* 191. GL_NV_register_combiners */
+#define X_GLrop_CombinerParameterfNV 4136
+#define X_GLrop_CombinerParameterfvNV 4137
+#define X_GLrop_CombinerParameteriNV 4138
+#define X_GLrop_CombinerParameterivNV 4139
+#define X_GLrop_CombinerInputNV 4140
+#define X_GLrop_CombinerOutputNV 4141
+#define X_GLrop_FinalCombinerInputNV 4142
+
+/* 222. GL_NV_fence */
+#define X_GLrop_SetFenceNV 4143
+#define X_GLrop_FinishFenceNV 4144
+
+/* 227. GL_NV_register_combiners2 */
+/* XXX opcodes not defined in the spec */
+
+/* 233. GL_NV_vertex_program - see also GL_ARB_vertex_program opcodes */
+#define X_GLrop_ExecuteProgramNV 4181
+#define X_GLrop_RequestResidentProgramsNV 4182
+#define X_GLrop_LoadProgamNV 4183
+#define X_GLrop_ProgramParameters4fvNV 4186
+#define X_GLrop_ProgramParameters4dvNV 4187
+#define X_GLrop_TrackMatrixNV 4188
+#define X_GLrop_VertexAttribs1svNV 4202
+#define X_GLrop_VertexAttribs2svNV 4203
+#define X_GLrop_VertexAttribs3svNV 4204
+#define X_GLrop_VertexAttribs4svNV 4205
+#define X_GLrop_VertexAttribs1fvNV 4206
+#define X_GLrop_VertexAttribs2fvNV 4207
+#define X_GLrop_VertexAttribs3fvNV 4208
+#define X_GLrop_VertexAttribs4fvNV 4209
+#define X_GLrop_VertexAttribs1dvNV 4210
+#define X_GLrop_VertexAttribs2dvNV 4211
+#define X_GLrop_VertexAttribs3dvNV 4212
+#define X_GLrop_VertexAttribs4dvNV 4213
+#define X_GLrop_VertexAttribs4ubvNV 4214
+
+/* 261. GL_NV_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+/* 262. GL_NV_point_sprite - see GL 1.4 opcodes */
+
+/* 268. GL_EXT_stencil_two_side */
+#define X_GLrop_ActiveStencilFaceEXT 4220
+
+/* 282. GL_NV_fragment_program - see also GL_NV_vertex_program and GL_ARB_vertex_program opcodes */
+#define X_GLrop_ProgramNamedParameter4fvNV 4218
+#define X_GLrop_ProgramNamedParameter4dvNV 4219
+
+/* 285. GL_NV_primitive_restart */
+/* XXX opcodes not defined in the spec */
+
+/* 297. GL_EXT_depth_bounds_test */
+#define X_GLrop_DepthBoundsEXT 4229
+
+/* 299. GL_EXT_blend_equation_separate */
+#define X_GLrop_BlendEquationSeparateEXT 4228
+
+/* 310. GL_EXT_framebuffer_object */
+#define X_GLvop_IsRenderbufferEXT 1422
+#define X_GLvop_GenRenderbuffersEXT 1423
+#define X_GLvop_GetRenderbufferParameterivEXT 1424
+#define X_GLvop_IsFramebufferEXT 1425
+#define X_GLvop_GenFramebuffersEXT 1426
+#define X_GLvop_CheckFramebufferStatusEXT 1427
+#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428
+
+#endif /* _GLX_glxproto_h_ */
diff --git a/glproto/glxtokens.h b/glproto/glxtokens.h
new file mode 100644
index 0000000..949935b
--- /dev/null
+++ b/glproto/glxtokens.h
@@ -0,0 +1,285 @@
+#ifndef __GLX_glxtokens_h__
+#define __GLX_glxtokens_h__
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+/*
+** Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
+*/
+#define GLX_USE_GL 1 /* support GLX rendering */
+#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */
+#define GLX_LEVEL 3 /* level in plane stacking */
+#define GLX_RGBA 4 /* true if RGBA mode */
+#define GLX_DOUBLEBUFFER 5 /* double buffering supported */
+#define GLX_STEREO 6 /* stereo buffering supported */
+#define GLX_AUX_BUFFERS 7 /* number of aux buffers */
+#define GLX_RED_SIZE 8 /* number of red component bits */
+#define GLX_GREEN_SIZE 9 /* number of green component bits */
+#define GLX_BLUE_SIZE 10 /* number of blue component bits */
+#define GLX_ALPHA_SIZE 11 /* number of alpha component bits */
+#define GLX_DEPTH_SIZE 12 /* number of depth bits */
+#define GLX_STENCIL_SIZE 13 /* number of stencil bits */
+#define GLX_ACCUM_RED_SIZE 14 /* number of red accum bits */
+#define GLX_ACCUM_GREEN_SIZE 15 /* number of green accum bits */
+#define GLX_ACCUM_BLUE_SIZE 16 /* number of blue accum bits */
+#define GLX_ACCUM_ALPHA_SIZE 17 /* number of alpha accum bits */
+/*
+** FBConfig-specific attributes
+*/
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_CONFIG_CAVEAT 0x20 /* Like visual_info VISUAL_CAVEAT_EXT */
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_VISUAL_ID 0x800B
+
+/* FBConfigSGIX Attributes */
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+
+/*
+** Error return values from glXGetConfig. Success is indicated by
+** a value of 0.
+*/
+#define GLX_BAD_SCREEN 1 /* screen # is bad */
+#define GLX_BAD_ATTRIBUTE 2 /* attribute to get is bad */
+#define GLX_NO_EXTENSION 3 /* no glx extension on server */
+#define GLX_BAD_VISUAL 4 /* visual # not known by GLX */
+#define GLX_BAD_CONTEXT 5 /* returned only by import_context EXT? */
+#define GLX_BAD_VALUE 6 /* returned only by glXSwapIntervalSGI? */
+#define GLX_BAD_ENUM 7 /* unused? */
+
+/* FBConfig attribute values */
+
+/*
+** Generic "don't care" value for glX ChooseFBConfig attributes (except
+** GLX_LEVEL)
+*/
+#define GLX_DONT_CARE 0xFFFFFFFF
+
+/* GLX_RENDER_TYPE bits */
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+
+/* GLX_DRAWABLE_TYPE bits */
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+
+/* GLX_CONFIG_CAVEAT attribute values */
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+
+/* GLX_X_VISUAL_TYPE attribute values */
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+
+/* GLX_TRANSPARENT_TYPE attribute values */
+/* #define GLX_NONE 0x8000 */
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+
+/* glXCreateGLXPbuffer attributes */
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_PBUFFER_HEIGHT 0x8040 /* New for GLX 1.3 */
+#define GLX_PBUFFER_WIDTH 0x8041 /* New for GLX 1.3 */
+
+/* glXQueryGLXPBuffer attributes */
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+
+/* glXCreateNewContext render_type attribute values */
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+
+/* glXQueryContext attributes */
+/* #define GLX_FBCONFIG_ID 0x8013 */
+/* #define GLX_RENDER_TYPE 0x8011 */
+#define GLX_SCREEN 0x800C
+
+/* glXSelectEvent event mask bits */
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
+
+/* GLXPbufferClobberEvent event_type values */
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
+#define GLX_BLIT_COMPLETE_INTEL 0x8181
+#define GLX_FLIP_COMPLETE_INTEL 0x8182
+
+/* GLXPbufferClobberEvent draw_type values */
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+
+/* GLXPbufferClobberEvent buffer_mask bits */
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+
+/*
+** Extension return values from glXGetConfig. These are also
+** accepted as parameter values for glXChooseVisual.
+*/
+
+#define GLX_X_VISUAL_TYPE_EXT 0x22 /* visual_info extension type */
+#define GLX_TRANSPARENT_TYPE_EXT 0x23 /* visual_info extension */
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 /* visual_info extension */
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 /* visual_info extension */
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 /* visual_info extension */
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 /* visual_info extension */
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 /* visual_info extension */
+
+/* Property values for visual_type */
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+
+/* Property values for transparent pixel */
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+
+/* Property values for visual_rating */
+#define GLX_VISUAL_CAVEAT_EXT 0x20 /* visual_rating extension type */
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+
+/* Property values for swap method (GLX_OML_swap_method) */
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+
+/* Property values for multi-sampling */
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 /* visuals grouped by select priority */
+
+/*
+** Names for attributes to glXGetClientString.
+*/
+#define GLX_VENDOR 0x1
+#define GLX_VERSION 0x2
+#define GLX_EXTENSIONS 0x3
+
+/*
+** Names for attributes to glXQueryContextInfoEXT.
+*/
+#define GLX_SHARE_CONTEXT_EXT 0x800A /* id of share context */
+#define GLX_VISUAL_ID_EXT 0x800B /* id of context's visual */
+#define GLX_SCREEN_EXT 0x800C /* screen number */
+
+/*
+** GLX_EXT_texture_from_pixmap
+*/
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__GLX_glxtokens_h__ */
diff --git a/inputproto/.gitignore b/inputproto/.gitignore
new file mode 100644
index 0000000..d1359e6
--- /dev/null
+++ b/inputproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for inputproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/inputproto/COPYING b/inputproto/COPYING
new file mode 100644
index 0000000..f0b75c0
--- /dev/null
+++ b/inputproto/COPYING
@@ -0,0 +1,63 @@
+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 © 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/inputproto/Makefile.am b/inputproto/Makefile.am
new file mode 100644
index 0000000..77d1ea7
--- /dev/null
+++ b/inputproto/Makefile.am
@@ -0,0 +1,24 @@
+inputdir = $(includedir)/X11/extensions
+input_HEADERS = \
+ XI.h \
+ XIproto.h \
+ XI2.h \
+ XI2proto.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = inputproto.pc
+
+dist_doc_DATA = XI2proto.txt XIproto.txt
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/inputproto/README b/inputproto/README
new file mode 100644
index 0000000..6b98e2b
--- /dev/null
+++ b/inputproto/README
@@ -0,0 +1,30 @@
+ X Input Extension
+
+This extension defines a protocol to provide additional input devices
+management such as graphic tablets.
+
+Extension name: XInputExtension
+
+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/proto/inputproto
+
+ http://cgit.freedesktop.org/xorg/proto/inputproto
+
+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/inputproto/XI.h b/inputproto/XI.h
new file mode 100644
index 0000000..7b44399
--- /dev/null
+++ b/inputproto/XI.h
@@ -0,0 +1,308 @@
+/************************************************************
+
+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 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 sz_xListDevicePropertiesReq 8
+#define sz_xListDevicePropertiesReply 32
+#define sz_xChangeDevicePropertyReq 20
+#define sz_xDeleteDevicePropertyReq 12
+#define sz_xGetDevicePropertyReq 24
+#define sz_xGetDevicePropertyReply 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 XI_JOYSTICK "JOYSTICK"
+
+/* 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
+/* DO NOT ADD TO HERE -> XI2 */
+
+#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 XI_Add_DevicePresenceNotify_Major 1
+#define XI_Add_DevicePresenceNotify_Minor 4
+
+#define XI_Add_DeviceProperties_Major 1
+#define XI_Add_DeviceProperties_Minor 5
+
+#define DEVICE_RESOLUTION 1
+#define DEVICE_ABS_CALIB 2
+#define DEVICE_CORE 3
+#define DEVICE_ENABLE 4
+#define DEVICE_ABS_AREA 5
+
+#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 IsXExtensionKeyboard 3
+#define IsXExtensionPointer 4
+
+#define AsyncThisDevice 0
+#define SyncThisDevice 1
+#define ReplayThisDevice 2
+#define AsyncOtherDevices 3
+#define AsyncAll 4
+#define SyncAll 5
+
+#define FollowKeyboard 3
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 3
+#endif
+
+#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 AttachClass 7
+
+#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 _devicePresence 0
+
+#define _deviceEnter 0
+#define _deviceLeave 1
+
+/* Device presence notify states */
+#define DeviceAdded 0
+#define DeviceRemoved 1
+#define DeviceEnabled 2
+#define DeviceDisabled 3
+#define DeviceUnrecoverable 4
+#define DeviceControlChanged 5
+
+/* XI Errors */
+#define XI_BadDevice 0
+#define XI_BadEvent 1
+#define XI_BadMode 2
+#define XI_DeviceBusy 3
+#define XI_BadClass 4
+
+/*
+ * Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
+ * definition of XEventClass since that would be a library interface change.
+ * See the top of X.h for more _XSERVER64 magic.
+ *
+ * But, don't actually use the CARD32 type. We can't get it defined here
+ * without polluting the namespace.
+ */
+#ifdef _XSERVER64
+typedef unsigned int XEventClass;
+#else
+typedef unsigned long XEventClass;
+#endif
+
+/*******************************************************************
+ *
+ * Extension version structure.
+ *
+ */
+
+typedef struct {
+ int present;
+ short major_version;
+ short minor_version;
+} XExtensionVersion;
+
+#endif /* _XI_H_ */
diff --git a/inputproto/XI2.h b/inputproto/XI2.h
new file mode 100644
index 0000000..6ba1377
--- /dev/null
+++ b/inputproto/XI2.h
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ *
+ */
+
+#ifndef _XI2_H_
+#define _XI2_H_
+
+/* Indices into the versions[] array (XExtInt.c). Used as a index to
+ * retrieve the minimum version of XI from _XiCheckExtInit.
+ * For indices 0 to 6 see XI.h */
+#ifndef Dont_Check /* defined in XI.h */
+#define Dont_Check 0
+#endif
+#define XInput_2_0 7
+
+
+#define XI_2_Major 2
+#define XI_2_Minor 0
+
+/* Property event flags */
+#define XIPropertyDeleted 0
+#define XIPropertyCreated 1
+#define XIPropertyModified 2
+
+/* Enter/Leave and Focus In/Out modes */
+#define XINotifyNormal 0
+#define XINotifyGrab 1
+#define XINotifyUngrab 2
+#define XINotifyWhileGrabbed 3
+#define XINotifyPassiveGrab 4
+#define XINotifyPassiveUngrab 5
+
+/* Enter/Leave and focus In/out detail */
+#define XINotifyAncestor 0
+#define XINotifyVirtual 1
+#define XINotifyInferior 2
+#define XINotifyNonlinear 3
+#define XINotifyNonlinearVirtual 4
+#define XINotifyPointer 5
+#define XINotifyPointerRoot 6
+#define XINotifyDetailNone 7
+
+/* Passive grab types */
+#define XIGrabtypeButton 0
+#define XIGrabtypeKeycode 1
+#define XIGrabtypeEnter 2
+#define XIGrabtypeFocusIn 3
+
+/* Passive grab modifier */
+#define XIAnyModifier (1U << 31)
+#define XIAnyButton 0
+#define XIAnyKeycode 0
+
+/* XIAllowEvents event-modes */
+#define XIAsyncDevice 0
+#define XISyncDevice 1
+#define XIReplayDevice 2
+#define XIAsyncPairedDevice 3
+#define XIAsyncPair 4
+#define XISyncPair 5
+
+/* DeviceChangedEvent change reasons */
+#define XISlaveSwitch 1
+#define XIDeviceChange 2
+
+/* Hierarchy flags */
+#define XIMasterAdded (1 << 0)
+#define XIMasterRemoved (1 << 1)
+#define XISlaveAdded (1 << 2)
+#define XISlaveRemoved (1 << 3)
+#define XISlaveAttached (1 << 4)
+#define XISlaveDetached (1 << 5)
+#define XIDeviceEnabled (1 << 6)
+#define XIDeviceDisabled (1 << 7)
+
+/* ChangeHierarchy constants */
+#define XIAddMaster 1
+#define XIRemoveMaster 2
+#define XIAttachSlave 3
+#define XIDetachSlave 4
+
+#define XIAttachToMaster 1
+#define XIFloating 2
+
+/* Valuator modes */
+#define XIModeRelative 0
+#define XIModeAbsolute 1
+
+/* Device types */
+#define XIMasterPointer 1
+#define XIMasterKeyboard 2
+#define XISlavePointer 3
+#define XISlaveKeyboard 4
+#define XIFloatingSlave 5
+
+/* Device classes */
+#define XIKeyClass 0
+#define XIButtonClass 1
+#define XIValuatorClass 2
+
+/* Device event flags (common) */
+/* Device event flags (key events only) */
+#define XIKeyRepeat (1 << 16)
+/* Device event flags (pointer events only) */
+
+/* XI2 event mask macros */
+#define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7)))
+#define XIClearMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &= ~(1 << ((event) & 7)))
+#define XIMaskIsSet(ptr, event) (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7)))
+#define XIMaskLen(event) (((event + 7) >> 3))
+
+/* Fake device ID's for event selection */
+#define XIAllDevices 0
+#define XIAllMasterDevices 1
+
+/* Event types */
+#define XI_DeviceChanged 1
+#define XI_KeyPress 2
+#define XI_KeyRelease 3
+#define XI_ButtonPress 4
+#define XI_ButtonRelease 5
+#define XI_Motion 6
+#define XI_Enter 7
+#define XI_Leave 8
+#define XI_FocusIn 9
+#define XI_FocusOut 10
+#define XI_HierarchyChanged 11
+#define XI_PropertyEvent 12
+#define XI_RawKeyPress 13
+#define XI_RawKeyRelease 14
+#define XI_RawButtonPress 15
+#define XI_RawButtonRelease 16
+#define XI_RawMotion 17
+#define XI_LASTEVENT XI_RawMotion
+/* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
+ * as XI_LASTEVENT if the server is supposed to handle masks etc. for this
+ * type of event. */
+
+/* Event masks.
+ * Note: the protocol spec defines a mask to be of (1 << type). Clients are
+ * free to create masks by bitshifting instead of using these defines.
+ */
+#define XI_DeviceChangedMask (1 << XI_DeviceChanged)
+#define XI_KeyPressMask (1 << XI_KeyPress)
+#define XI_KeyReleaseMask (1 << XI_KeyRelease)
+#define XI_ButtonPressMask (1 << XI_ButtonPress)
+#define XI_ButtonReleaseMask (1 << XI_ButtonRelease)
+#define XI_MotionMask (1 << XI_Motion)
+#define XI_EnterMask (1 << XI_Enter)
+#define XI_LeaveMask (1 << XI_Leave)
+#define XI_FocusInMask (1 << XI_FocusIn)
+#define XI_FocusOutMask (1 << XI_FocusOut)
+#define XI_HierarchyChangedMask (1 << XI_HierarchyChanged)
+#define XI_PropertyEventMask (1 << XI_PropertyEvent)
+#define XI_RawKeyPressMask (1 << XI_RawKeyPress)
+#define XI_RawKeyReleaseMask (1 << XI_RawKeyRelease)
+#define XI_RawButtonPressMask (1 << XI_RawButtonPress)
+#define XI_RawButtonReleaseMask (1 << XI_RawButtonRelease)
+#define XI_RawMotionMask (1 << XI_RawMotion)
+
+#endif /* _XI2_H_ */
diff --git a/inputproto/XI2proto.h b/inputproto/XI2proto.h
new file mode 100644
index 0000000..2fd91eb
--- /dev/null
+++ b/inputproto/XI2proto.h
@@ -0,0 +1,976 @@
+/*
+ * 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.
+ *
+ */
+
+/* Conventions for this file:
+ * Names:
+ * structs: always typedef'd, prefixed with xXI, CamelCase
+ * struct members: lower_case_with_underscores
+ * Exceptions: reqType, ReqType, repType, RepType, sequenceNumber are
+ * named as such for historical reasons.
+ * request opcodes: X_XIRequestName as CamelCase
+ * defines: defines used in client applications must go in XI2.h
+ * defines used only in protocol handling: XISOMENAME
+ *
+ * Data types: unless there is a historical name for a datatype (e.g.
+ * Window), use stdint types specifying the size of the datatype.
+ * historical data type names must be defined and undefined at the top and
+ * end of the file.
+ *
+ * General:
+ * spaces, not tabs.
+ * structs specific to a request or reply added before the request
+ * definition. structs used in more than one request, reply or event
+ * appended to the common structs section before the definition of the
+ * first request.
+ * members of structs vertically aligned on column 16 if datatypes permit.
+ * otherwise alingned on next available 8n column.
+ */
+
+/**
+ * Protocol definitions for the XI2 protocol.
+ * This file should not be included by clients that merely use XI2, but do not
+ * need the wire protocol. Such clients should include XI2.h, or the matching
+ * header from the library.
+ *
+ */
+#ifndef _XI2PROTO_H_
+#define _XI2PROTO_H_
+
+#include <X11/Xproto.h>
+#include <X11/X.h>
+#include <X11/extensions/XI2.h>
+
+/* make sure types have right sizes for protocol structures. */
+#define Window uint32_t
+#define Time uint32_t
+#define Atom uint32_t
+#define Cursor uint32_t
+
+/**
+ * XI2 Request opcodes
+ */
+#define X_XIQueryPointer 40
+#define X_XIWarpPointer 41
+#define X_XIChangeCursor 42
+#define X_XIChangeHierarchy 43
+#define X_XISetClientPointer 44
+#define X_XIGetClientPointer 45
+#define X_XISelectEvents 46
+#define X_XIQueryVersion 47
+#define X_XIQueryDevice 48
+#define X_XISetFocus 49
+#define X_XIGetFocus 50
+#define X_XIGrabDevice 51
+#define X_XIUngrabDevice 52
+#define X_XIAllowEvents 53
+#define X_XIPassiveGrabDevice 54
+#define X_XIPassiveUngrabDevice 55
+#define X_XIListProperties 56
+#define X_XIChangeProperty 57
+#define X_XIDeleteProperty 58
+#define X_XIGetProperty 59
+#define X_XIGetSelectedEvents 60
+
+/** Number of XI requests */
+#define XI2REQUESTS (X_XIGetSelectedEvents - X_XIQueryPointer + 1)
+/** Number of XI2 events */
+#define XI2EVENTS (XI_LASTEVENT + 1)
+
+/*************************************************************************************
+ * *
+ * COMMON STRUCTS *
+ * *
+ *************************************************************************************/
+/** Fixed point 16.16 */
+typedef int32_t FP1616;
+
+/** Fixed point 32.32 */
+typedef struct {
+ int32_t integral;
+ uint32_t frac;
+} FP3232;
+
+/**
+ * Struct to describe a device.
+ *
+ * For a MasterPointer or a MasterKeyboard, 'attachment' specifies the
+ * paired master device.
+ * For a SlaveKeyboard or SlavePointer, 'attachment' specifies the master
+ * device this device is attached to.
+ * For a FloatingSlave, 'attachment' is undefined.
+ */
+typedef struct {
+ uint16_t deviceid;
+ uint16_t use; /**< ::XIMasterPointer, ::XIMasterKeyboard,
+ ::XISlavePointer, ::XISlaveKeyboard,
+ ::XIFloatingSlave */
+ uint16_t attachment; /**< Current attachment or pairing.*/
+ uint16_t num_classes; /**< Number of classes following this struct. */
+ uint16_t name_len; /**< Length of name in bytes. */
+ uint8_t enabled; /**< TRUE if device is enabled. */
+ uint8_t pad;
+} xXIDeviceInfo;
+
+/**
+ * Default template for a device class.
+ * A device class is equivalent to a device's capabilities. Multiple classes
+ * are supported per device.
+ */
+typedef struct {
+ uint16_t type; /**< One of *class */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint16_t pad;
+} xXIAnyInfo;
+
+/**
+ * Denotes button capability on a device.
+ * Struct is followed by num_buttons * Atom that names the buttons in the
+ * device-native setup (i.e. ignoring button mappings).
+ */
+typedef struct {
+ uint16_t type; /**< Always ButtonClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint16_t num_buttons; /**< Number of buttons provide */
+} xXIButtonInfo;
+
+/**
+ * Denotes key capability on a device.
+ * Struct is followed by num_keys * CARD32 that lists the keycodes available
+ * on the device.
+ */
+typedef struct {
+ uint16_t type; /**< Always KeyClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint16_t num_keycodes; /**< Number of keys provided */
+} xXIKeyInfo;
+
+/**
+ * Denotes an valuator capability on a device.
+ * One XIValuatorInfo describes exactly one valuator (axis) on the device.
+ */
+typedef struct {
+ uint16_t type; /**< Always ValuatorClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint16_t number; /**< Valuator number */
+ Atom label; /**< Axis label */
+ FP3232 min; /**< Min value */
+ FP3232 max; /**< Max value */
+ FP3232 value; /**< Last published value */
+ uint32_t resolution; /**< Resolutions in units/m */
+ uint8_t mode; /**< ModeRelative or ModeAbsolute */
+ uint8_t pad1;
+ uint16_t pad2;
+} xXIValuatorInfo;
+
+
+/**
+ * Used to select for events on a given window.
+ * Struct is followed by (mask_len * CARD8), with each bit set representing
+ * the event mask for the given type. A mask bit represents an event type if
+ * (mask == (1 << type)).
+ */
+typedef struct {
+ uint16_t deviceid; /**< Device id to select for */
+ uint16_t mask_len; /**< Length of mask in 4 byte units */
+} xXIEventMask;
+
+/**
+ * XKB modifier information.
+ * The effective modifier is a binary mask of base, latched, and locked
+ * modifiers.
+ */
+typedef struct
+{
+ uint32_t base_mods; /**< Logically pressed modifiers */
+ uint32_t latched_mods; /**< Logically latched modifiers */
+ uint32_t locked_mods; /**< Logically locked modifiers */
+ uint32_t effective_mods; /**< Effective modifiers */
+} xXIModifierInfo;
+
+/**
+ * XKB group information.
+ * The effective group is the mathematical sum of base, latched, and locked
+ * group after group wrapping is taken into account.
+ */
+typedef struct
+{
+ uint8_t base_group; /**< Logically "pressed" group */
+ uint8_t latched_group; /**< Logically latched group */
+ uint8_t locked_group; /**< Logically locked group */
+ uint8_t effective_group; /**< Effective group */
+} xXIGroupInfo;
+
+
+/*************************************************************************************
+ * *
+ * REQUESTS *
+ * *
+ *************************************************************************************/
+
+/**
+ * Query the server for the supported X Input extension version.
+ */
+
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIQueryVersion */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t major_version;
+ uint16_t minor_version;
+} xXIQueryVersionReq;
+#define sz_xXIQueryVersionReq 8
+
+typedef struct {
+ uint8_t repType; /**< ::X_Reply */
+ uint8_t RepType; /**< Always ::X_XIQueryVersion */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t major_version;
+ uint16_t minor_version;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIQueryVersionReply;
+#define sz_xXIQueryVersionReply 32
+
+/**
+ * Query the server for information about a specific device or all input
+ * devices.
+ */
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIQueryDevice */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+ uint16_t pad;
+} xXIQueryDeviceReq;
+#define sz_xXIQueryDeviceReq 8
+
+typedef struct {
+ uint8_t repType; /**< ::X_Reply */
+ uint8_t RepType; /**< Always ::X_XIQueryDevice */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t num_devices;
+ uint16_t pad0;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIQueryDeviceReply;
+#define sz_xXIQueryDeviceReply 32
+
+/**
+ * Select for events on a given window.
+ */
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XISelectEvents */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+ uint16_t num_masks;
+ uint16_t pad;
+} xXISelectEventsReq;
+#define sz_xXISelectEventsReq 12
+
+/**
+ * Query for selected events on a given window.
+ */
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIGetSelectedEvents */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+} xXIGetSelectedEventsReq;
+#define sz_xXIGetSelectedEventsReq 8
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIGetSelectedEvents */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t num_masks; /**< Number of xXIEventMask structs
+ trailing the reply */
+ uint16_t pad0;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIGetSelectedEventsReply;
+#define sz_xXIGetSelectedEventsReply 32
+
+/**
+ * Query the given device's screen/window coordinates.
+ */
+
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIQueryPointer */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+ uint16_t deviceid;
+ uint16_t pad1;
+} xXIQueryPointerReq;
+#define sz_xXIQueryPointerReq 12
+
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIQueryPointer */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ Window root;
+ Window child;
+ FP1616 root_x;
+ FP1616 root_y;
+ FP1616 win_x;
+ FP1616 win_y;
+ uint8_t same_screen;
+ uint8_t pad0;
+ uint16_t buttons_len;
+ xXIModifierInfo mods;
+ xXIGroupInfo group;
+} xXIQueryPointerReply;
+#define sz_xXIQueryPointerReply 56
+
+/**
+ * Warp the given device's pointer to the specified position.
+ */
+
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIWarpPointer */
+ uint16_t length; /**< Length in 4 byte units */
+ Window src_win;
+ Window dst_win;
+ FP1616 src_x;
+ FP1616 src_y;
+ uint16_t src_width;
+ uint16_t src_height;
+ FP1616 dst_x;
+ FP1616 dst_y;
+ uint16_t deviceid;
+ uint16_t pad1;
+} xXIWarpPointerReq;
+#define sz_xXIWarpPointerReq 36
+
+/**
+ * Change the given device's sprite to the given cursor.
+ */
+
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIChangeCursor */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+ Cursor cursor;
+ uint16_t deviceid;
+ uint16_t pad1;
+} xXIChangeCursorReq;
+#define sz_xXIChangeCursorReq 16
+
+/**
+ * Modify the device hierarchy.
+ */
+
+typedef struct {
+ uint8_t reqType; /**< Input extension major code */
+ uint8_t ReqType; /**< Always ::X_XIChangeHierarchy */
+ uint16_t length; /**< Length in 4 byte units */
+ uint8_t num_changes;
+ uint8_t pad0;
+ uint16_t pad1;
+} xXIChangeHierarchyReq;
+#define sz_xXIChangeHierarchyReq 8
+
+/**
+ * Generic header for any hierarchy change.
+ */
+typedef struct {
+ uint16_t type;
+ uint16_t length; /**< Length in 4 byte units */
+} xXIAnyHierarchyChangeInfo;
+
+/**
+ * Create a new master device.
+ * Name of new master follows struct (4-byte padded)
+ */
+typedef struct {
+ uint16_t type; /**< Always ::XIAddMaster */
+ uint16_t length; /**< 2 + (namelen + padding)/4 */
+ uint16_t name_len;
+ uint8_t send_core;
+ uint8_t enable;
+} xXIAddMasterInfo;
+
+/**
+ * Delete a master device. Will automatically delete the master device paired
+ * with the given master device.
+ */
+typedef struct {
+ uint16_t type; /**< Always ::XIRemoveMaster */
+ uint16_t length; /**< 3 */
+ uint16_t deviceid;
+ uint8_t return_mode; /**< ::XIAttachToMaster, ::XIFloating */
+ uint8_t pad;
+ uint16_t return_pointer; /**< Pointer to attach slave ptr devices to */
+ uint16_t return_keyboard; /**< keyboard to attach slave keybd devices to*/
+} xXIRemoveMasterInfo;
+
+/**
+ * Attach an SD to a new device.
+ * NewMaster has to be of same type (pointer->pointer, keyboard->keyboard);
+ */
+typedef struct {
+ uint16_t type; /**< Always ::XIAttachSlave */
+ uint16_t length; /**< 2 */
+ uint16_t deviceid;
+ uint16_t new_master; /**< id of new master device */
+} xXIAttachSlaveInfo;
+
+/**
+ * Detach an SD from its current master device.
+ */
+typedef struct {
+ uint16_t type; /**< Always ::XIDetachSlave */
+ uint16_t length; /**< 2 */
+ uint16_t deviceid;
+ uint16_t pad;
+} xXIDetachSlaveInfo;
+
+
+/**
+ * Set the window/client's ClientPointer.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XISetClientPointer */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+ uint16_t deviceid;
+ uint16_t pad1;
+} xXISetClientPointerReq;
+#define sz_xXISetClientPointerReq 12
+
+/**
+ * Query the given window/client's ClientPointer setting.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_GetClientPointer */
+ uint16_t length; /**< Length in 4 byte units */
+ Window win;
+} xXIGetClientPointerReq;
+#define sz_xXIGetClientPointerReq 8
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_GetClientPointer */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ BOOL set; /**< client pointer is set? */
+ uint8_t pad0;
+ uint16_t deviceid;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIGetClientPointerReply;
+#define sz_xXIGetClientPointerReply 32
+
+/**
+ * Set the input focus to the specified window.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XISetFocus */
+ uint16_t length; /**< Length in 4 byte units */
+ Window focus;
+ Time time;
+ uint16_t deviceid;
+ uint16_t pad0;
+} xXISetFocusReq;
+#define sz_xXISetFocusReq 16
+
+/**
+ * Query the current input focus.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIGetDeviceFocus */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+ uint16_t pad0;
+} xXIGetFocusReq;
+#define sz_xXIGetFocusReq 8
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIGetFocus */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ Window focus;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIGetFocusReply;
+#define sz_xXIGetFocusReply 32
+
+
+/**
+ * Grab the given device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIGrabDevice */
+ uint16_t length; /**< Length in 4 byte units */
+ Window grab_window;
+ Time time;
+ Cursor cursor;
+ uint16_t deviceid;
+ uint8_t grab_mode;
+ uint8_t paired_device_mode;
+ uint8_t owner_events;
+ uint8_t pad;
+ uint16_t mask_len;
+} xXIGrabDeviceReq;
+#define sz_xXIGrabDeviceReq 24
+
+/**
+ * Return codes from a XIPassiveGrabDevice request.
+ */
+typedef struct {
+ uint32_t modifiers; /**< Modifier state */
+ uint8_t status; /**< Grab status code */
+ uint8_t pad0;
+ uint16_t pad1;
+} xXIGrabModifierInfo;
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIGrabDevice */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint8_t status;
+ uint8_t pad0;
+ uint16_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+ uint32_t pad6;
+} xXIGrabDeviceReply;
+#define sz_xXIGrabDeviceReply 32
+
+/**
+ * Ungrab the specified device.
+ *
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIUngrabDevice */
+ uint16_t length; /**< Length in 4 byte units */
+ Time time;
+ uint16_t deviceid;
+ uint16_t pad;
+} xXIUngrabDeviceReq;
+#define sz_xXIUngrabDeviceReq 12
+
+
+/**
+ * Allow or replay events on the specified grabbed device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIAllowEvents */
+ uint16_t length; /**< Length in 4 byte units */
+ Time time;
+ uint16_t deviceid;
+ uint8_t mode;
+ uint8_t pad;
+} xXIAllowEventsReq;
+#define sz_xXIAllowEventsReq 12
+
+
+/**
+ * Passively grab the device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIPassiveGrabDevice */
+ uint16_t length; /**< Length in 4 byte units */
+ Time time;
+ Window grab_window;
+ Cursor cursor;
+ uint32_t detail;
+ uint16_t deviceid;
+ uint16_t num_modifiers;
+ uint16_t mask_len;
+ uint8_t grab_type;
+ uint8_t grab_mode;
+ uint8_t paired_device_mode;
+ uint8_t owner_events;
+ uint16_t pad1;
+} xXIPassiveGrabDeviceReq;
+#define sz_xXIPassiveGrabDeviceReq 32
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIPassiveGrabDevice */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t num_modifiers;
+ uint16_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+ uint32_t pad6;
+} xXIPassiveGrabDeviceReply;
+#define sz_xXIPassiveGrabDeviceReply 32
+
+/**
+ * Delete a passive grab for the given device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIPassiveUngrabDevice */
+ uint16_t length; /**< Length in 4 byte units */
+ Window grab_window;
+ uint32_t detail;
+ uint16_t deviceid;
+ uint16_t num_modifiers;
+ uint8_t grab_type;
+ uint8_t pad0;
+ uint16_t pad1;
+} xXIPassiveUngrabDeviceReq;
+#define sz_xXIPassiveUngrabDeviceReq 20
+
+/**
+ * List all device properties on the specified device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIListProperties */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+ uint16_t pad;
+} xXIListPropertiesReq;
+#define sz_xXIListPropertiesReq 8
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always ::X_XIListProperties */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t num_properties;
+ uint16_t pad0;
+ uint32_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+ uint32_t pad4;
+ uint32_t pad5;
+} xXIListPropertiesReply;
+#define sz_xXIListPropertiesReply 32
+
+/**
+ * Change a property on the specified device.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always ::X_XIChangeProperty */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+ uint8_t mode;
+ uint8_t format;
+ Atom property;
+ Atom type;
+ uint32_t num_items;
+} xXIChangePropertyReq;
+#define sz_xXIChangePropertyReq 20
+
+/**
+ * Delete the specified property.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always X_XIDeleteProperty */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+ uint16_t pad0;
+ Atom property;
+} xXIDeletePropertyReq;
+#define sz_xXIDeletePropertyReq 12
+
+/**
+ * Query the specified property's values.
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /**< Always X_XIGetProperty */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t deviceid;
+#if defined(__cplusplus) || defined(c_plusplus)
+ uint8_t c_delete;
+#else
+ uint8_t delete;
+#endif
+ uint8_t pad0;
+ Atom property;
+ Atom type;
+ uint32_t offset;
+ uint32_t len;
+} xXIGetPropertyReq;
+#define sz_xXIGetPropertyReq 24
+
+typedef struct {
+ uint8_t repType; /**< Input extension major opcode */
+ uint8_t RepType; /**< Always X_XIGetProperty */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ Atom type;
+ uint32_t bytes_after;
+ uint32_t num_items;
+ uint8_t format;
+ uint8_t pad0;
+ uint16_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+} xXIGetPropertyReply;
+#define sz_xXIGetPropertyReply 32
+
+/*************************************************************************************
+ * *
+ * EVENTS *
+ * *
+ *************************************************************************************/
+
+/**
+ * Generic XI2 event header. All XI2 events use the same header.
+ */
+typedef struct
+{
+ uint8_t type;
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length;
+ uint16_t evtype;
+ uint16_t deviceid;
+ Time time;
+} xXIGenericDeviceEvent;
+
+/**
+ * Device hierarchy information.
+ */
+typedef struct
+{
+ uint16_t deviceid;
+ uint16_t attachment; /**< ID of master or paired device */
+ uint8_t use; /**< ::XIMasterKeyboard,
+ ::XIMasterPointer,
+ ::XISlaveKeyboard,
+ ::XISlavePointer,
+ ::XIFloatingSlave */
+ BOOL enabled; /**< TRUE if the device is enabled */
+ uint16_t pad;
+ uint32_t flags; /**< ::XIMasterAdded, ::XIMasterRemoved,
+ ::XISlaveAttached, ::XISlaveDetached,
+ ::XISlaveAdded, ::XISlaveRemoved,
+ ::XIDeviceEnabled, ::XIDeviceDisabled */
+} xXIHierarchyInfo;
+
+/**
+ * The device hierarchy has been modified. This event includes the device
+ * hierarchy after the modification has been applied.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte units */
+ uint16_t evtype; /**< ::XI_Hierarchy */
+ uint16_t deviceid;
+ Time time;
+ uint32_t flags; /**< ::XIMasterAdded, ::XIMasterDeleted,
+ ::XISlaveAttached, ::XISlaveDetached,
+ ::XISlaveAdded, ::XISlaveRemoved,
+ ::XIDeviceEnabled, ::XIDeviceDisabled */
+ uint16_t num_info;
+ uint16_t pad0;
+ uint32_t pad1;
+ uint32_t pad2;
+} xXIHierarchyEvent;
+
+/**
+ * A device has changed capabilities.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte units */
+ uint16_t evtype; /**< XI_DeviceChanged */
+ uint16_t deviceid; /**< Device that has changed */
+ Time time;
+ uint16_t num_classes; /**< Number of classes that have changed */
+ uint16_t sourceid; /**< Source of the new classes */
+ uint8_t reason; /**< ::XISlaveSwitch, ::XIDeviceChange */
+ uint8_t pad0;
+ uint16_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+} xXIDeviceChangedEvent;
+
+/**
+ * Default input event for pointer or keyboard input.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte uints */
+ uint16_t evtype;
+ uint16_t deviceid;
+ Time time;
+ uint32_t detail; /**< Keycode or button */
+ Window root;
+ Window event;
+ Window child;
+/* └──────── 32 byte boundary ────────┘ */
+ FP1616 root_x; /**< Always screen coords, 16.16 fixed point */
+ FP1616 root_y;
+ FP1616 event_x; /**< Always screen coords, 16.16 fixed point */
+ FP1616 event_y;
+ uint16_t buttons_len; /**< Len of button flags in 4 b units */
+ uint16_t valuators_len; /**< Len of val. flags in 4 b units */
+ uint16_t sourceid; /**< The source device */
+ uint16_t pad0;
+ uint32_t flags; /**< ::XIKeyRepeat */
+ xXIModifierInfo mods;
+ xXIGroupInfo group;
+} xXIDeviceEvent;
+
+
+/**
+ * Sent when an input event is generated. RawEvents include valuator
+ * information in both device-specific data (i.e. unaccelerated) and
+ * processed data (i.e. accelerated, if applicable).
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte uints */
+ uint16_t evtype; /**< ::XI_RawEvent */
+ uint16_t deviceid;
+ Time time;
+ uint32_t detail;
+ uint16_t pad0;
+ uint16_t valuators_len; /**< Length of trailing valuator
+ mask in 4 byte units */
+ uint32_t flags; /**< ::XIKeyRepeat */
+ uint32_t pad2;
+} xXIRawEvent;
+
+/**
+ * Note that the layout of root, event, child, root_x, root_y, event_x,
+ * event_y must be identical to the xXIDeviceEvent.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte uints */
+ uint16_t evtype; /**< ::XI_Enter */
+ uint16_t deviceid;
+ Time time;
+ uint16_t sourceid;
+ uint8_t mode;
+ uint8_t detail;
+ Window root;
+ Window event;
+ Window child;
+/* └──────── 32 byte boundary ────────┘ */
+ FP1616 root_x;
+ FP1616 root_y;
+ FP1616 event_x;
+ FP1616 event_y;
+ BOOL same_screen;
+ BOOL focus;
+ uint16_t buttons_len; /**< Length of trailing button mask
+ in 4 byte units */
+ xXIModifierInfo mods;
+ xXIGroupInfo group;
+} xXIEnterEvent;
+
+typedef xXIEnterEvent xXILeaveEvent;
+typedef xXIEnterEvent xXIFocusInEvent;
+typedef xXIEnterEvent xXIFocusOutEvent;
+
+/**
+ * Sent when a device property is created, modified or deleted. Does not
+ * include property data, the client is required to query the data.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte uints */
+ uint16_t evtype; /**< ::XI_PropertyEvent */
+ uint16_t deviceid;
+ Time time;
+ Atom property;
+ uint8_t what; /**< ::XIPropertyDeleted,
+ ::XIPropertyCreated,
+ ::XIPropertyMotified */
+ uint8_t pad0;
+ uint16_t pad1;
+ uint32_t pad2;
+ uint32_t pad3;
+} xXIPropertyEvent;
+
+
+#undef Window
+#undef Time
+#undef Atom
+#undef Cursor
+
+#endif /* _XI2PROTO_H_ */
diff --git a/inputproto/XI2proto.txt b/inputproto/XI2proto.txt
new file mode 100644
index 0000000..706f50a
--- /dev/null
+++ b/inputproto/XI2proto.txt
@@ -0,0 +1,1677 @@
+
+ The X Input Extension
+ Version 2.0
+
+ Peter Hutterer
+ peter.hutterer@redhat.com
+ Red Hat, Inc.
+
+
+
+1. Introduction
+
+The X Input Extension version 2.0 (XI2) is the second major release of the X
+Input Extension.
+
+XI2 provides a number of enhancements over version 1.5, including:
+- use of XGE and GenericEvents. GenericEvents are of flexible length with a
+ minimum length of 32 bytes.
+- explicit device hierarchy of master and slave devices. See Section 4.
+- use of multiple independent master devices (Multi-Poiner X or MPX).
+- the ability for devices to change capabilities at runtime.
+- raw device events
+
+XI2's intent is to replace both core input processing and prior versions of
+the X Input Extension. Historically, the majority of applications employed the
+core protocol requests and events to handle user input. The core protocol does
+not provide information about which device generated the event. The X Input
+Extension version up to 1.5 requires the differentiation between core and
+extended devices. Extended devices may not be core devices and thus cannot be
+used on applications employing the core protocol. XI2 addresses both of these
+issues by enabling devices to be both extended and core devices and providing
+device information in each event (with the exception of core events).
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+
+2. Notations used in this document
+
+Notation for requests:
+┌───
+ Name of request
+ name of request field: type of request field
+ name of request field: type of request field
+ ▶
+ name of reply field: type of reply field
+└───
+
+Notation for events:
+┌───
+ Name of event
+ name of field: type of field
+ name of field: type of field
+└───
+
+Complex fields are specified in the following notation:
+ name of field: COMPLEXFIELDTYPE
+or, if multiple of these fields exist:
+ name of field: LISTofCOMPLEXFIELDTYPE
+
+COMPLEXFIELDTYPE: { name of subfield: type of subfield,
+ name of subfield: type of subfield }
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+
+3. Interoperability between version 1.x and 2.0
+
+There is little interaction between 1.x and 2.x versions of the X Input
+Extension. Clients are requested to avoid mixing XI1.x and XI2 code as much as
+possible. Several direct incompatibilities are observable:
+
+3.1 Limitations resulting from different variable ranges
+
+XI2 provides a larger range for some fields than XI1. As a result, XI1 clients
+may not receive data an XI2 client receives.
+These fields include:
+- devices with a deviceid of greater than 127 are invisible to XI1 clients.
+- key events and key grabs featuring larger than 255 can only be sent to XI2
+ clients.
+- no subpixel information is avialable to XI1 clients. If motion events are in
+ a subpixel range only, the server may omit these events and an XI 1.x client
+ will not receive events until the pixel boundary is crossed.
+
+
+3.2 Blocking of grabs
+
+XI1 grabs are different to XI2 grab and a device may not be grabbed through an
+XI2 grab if an XI1 grab is currently active on this device or vice versa.
+Likewise, a keycode or button already grabbed by an XI 1.x or XI2 client may
+not be grabbed with the same modifier combination by an XI2 or XI 1.x client,
+respectively.
+
+3.3 Invisibility of Master Devices
+
+XI 1.x was not designed with support for multiple master devices (see Section
+4). As a result, only the first master pointer and master keyboard are visible
+to XI 1.x clients, all other master devices are invisible and cannot be
+accessed from XI 1.x calls.
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+
+4. The Master/Slave device hierarchy
+
+XI2 introduces a device hierarchy split up into so-called Master Devices (MD)
+and Slave Devices (SD).
+
+4.1 Master devices
+An MD is a virtual device created and managed by the server. MDs may send core
+events and XI events. However, an MD does not represent a physical device and
+relies on SDs for event generation. MDs come in two forms: as master pointers
+or as master keyboards. A master pointer is represented by a visible cursor on
+the screen. A master keyboard is represented by a keyboard focus.
+
+Each master pointer is paired with the respective master keyboard and vice
+versa, and this pairing is constant for the lifetime of both input devices.
+Clients can use this pairing behaviour to implement input paradigms that
+require pointer and keyboard interation (e.g. SHIFT + Click).
+
+4.2 Slave devices
+An SD is usually a physical device configured in the server. SDs are not
+represented by a cursor or keyboard focus and may be attached to a master
+pointer or master keyboard. SDs can only be attached to any master of the same
+type (e.g. a physical pointer device can be attached to any master pointer).
+
+If an event is generated by an SD
+- if the SD is attached to a master pointer, it changes the position and/or
+ button state of the master pointer.
+- if the SD is attached to a master keyboard, it sends events to this
+ keyboard's focus window (if applicable) and/or changes the modifier state of
+ this keyboard.
+- if the SD is not attached to an MD ("floating"), it does not change
+ any master device. The SD has its own (invisible) sprite and its own focus.
+ Both the sprite and the focus must be managed explicitly by the client
+ program.
+
+4.3 Event processing for attached slave devices
+
+Whenever an SD changes its logical state,
+- the event is delivered as an XI event to any interested clients. If the
+ device is floating, event processing stops.
+ Otherwise, if the device is attached,
+- the master device changes its classes to reflect the SD's capabilities. All
+ interested clients are notified of this device change.
+- then, the event is delivered as an XI event from the MD to any interested
+ clients. If the event has been delivered, event processing stops.
+ Otherwise,
+- the event is delivered as a core event to any interested clients.
+
+Given that W is the event window, and P the parent window of W, event delivery
+to P is only attempted if neither the XI event, nor the core event has been
+delivered on W. Once an event has been delivered as either XI or core event,
+event processing stops.
+
+4.4. The ClientPointer principle
+
+Many core protocol and some extension requests are ambiguous when multiple
+master devices are available (e.g. QueryPointer does not specfy which pointer).
+The X server does not have the knowledge to chose the contextually correct
+master device. For each client, one master pointer is designated as this
+clients's "ClientPointer". Whenever a client sends an ambiguous request (e.g.
+QueryPointer), the ClientPointer or the keyboard paired with the ClientPointer
+is chosen to provide the data for this request.
+
+This ClientPointer may be explicitly assigned to a client with the
+SetClientPointer call. If no ClientPointer is set when a client issues an
+ambiguous request, the server choses one device as the ClientPointer. The
+method of chosing a ClientPointer from the available master pointers is
+implementation-specific.
+
+If the master pointer currently set as ClientPointer for one or more clients is
+removed, the server may either unset the ClientPointer setting or change the
+ClientPointer to a different master pointer.
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+5. Data types
+
+BUTTONMASK
+ A binary mask defined as (1 << button number).
+ A SETofBUTTONMASK is a binary OR of zero or more BUTTONMASK.
+
+DEVICE { DEVICEID, AllDevices, AllMasterDevices }
+ A DEVICE specifies either a DEVICEID or AllDevices or
+ AllMasterDevices.
+
+DEVICEID { CARD16 }
+ A DEVICEID is a numerical ID for a device currently available in the
+ server. The server may re-use a device ID after a device's removal.
+ The device IDs 0 and 1 are reserved.
+ AllDevices ........ 0
+ AllMasterDevices .. 1
+
+DEVICEUSE { MasterPointer, MasterKeyboard, SlavePointer,
+ SlaveKeyboard, FloatingSlave }
+ A DEVICEUSE field specifies the current use of a device in the MD/SD
+ device hierarchy. See Section 4 for more information.
+
+EVENTMASK
+ An EVENTMASK is a binary mask defined as (1 << event type).
+ A SETofEVENTMASK is a binary OR of zero or more EVENTMASK.
+
+FP1616
+ Fixed point decimal in 16.16 format as one INT16 and one CARD16.
+ The INT16 contains the integral part, the CARD32 the decimal fraction
+ shifted by 16.
+
+FP3232
+ Fixed point decimal in 32.32 format as one INT32 and one CARD32.
+ The INT32 contains the integral part, the CARD32 the decimal fraction
+ shifted by 32.
+
+VALUATORMASK
+ A binary mask defined as (1 << valuator number).
+ A SETofVALUATORMASK is a binary OR of zero or more VALUATORMASK.
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+6. Errors
+
+Errors are sent using core X error reports.
+
+Device
+ A value for a DEVICE argument does not specify a valid DEVICE.
+
+ ❧❧❧❧❧❧❧❧❧❧❧
+7. Requests:
+
+The server does not guarantee that the length of a reply remains constant in
+future revisions of XI2. A client must always retrieve the exact length of the
+protocol reply from the connection, even if the reply is longer than defined
+for the XI2 version supported by the client.
+Additional bytes in a request may include data supported in later versions of
+XI2. Clients should ignore this data. Padding bytes in XI2 protocol requests
+are required to be 0.
+
+7.1 Requests introduced in version 2.0
+
+ ┌───
+ XIQueryVersion
+ major_version: CARD16
+ minor_version: CARD16
+ ▶
+ major_version: CARD16
+ minor_version: CARD16
+ └───
+
+ The client sends the highest supported version to the server and the
+ server sends the highest version it supports, but no higher than the
+ requested version. Major versions changes can introduce incompatibilities
+ in existing functionality, minor version changes introduce only backward
+ compatible changes. It is the client's responsibility to ensure that the
+ server supports a version which is compatible with its expectations.
+
+ major_version
+ Major XI2 version.
+ minor_version
+ Minor XI2 version.
+
+ If major_version is less than 2, a BadValue error occurs.
+
+ ┌───
+ XIQueryDevice
+ DEVICE deviceid
+ ▶
+ num_devices: CARD16
+ deviceinfo: LISTofDEVICEINFO
+ └───
+
+ DEVICEINFO { deviceid: DEVICEID
+ use: DEVICEUSE
+ attachment: DEVICEID
+ enabled: BOOL
+ num_classes: CARD16
+ name_len: CARD16
+ name: LISTofCHAR8
+ classes: LISTofCLASS }
+
+ CLASS { BUTTONCLASS, KEYCLASS, AXISCLASS }
+
+ BUTTONCLASS { type: ButtonClass
+ length: CARD16
+ sourceid: CARD16
+ buttons_len: CARD16
+ state: SETofBUTTONMASK
+ labels: LISTofATOM }
+
+ KEYCLASS { type: KeyClass
+ length: CARD16
+ sourceid: CARD16
+ num_keys: CARD16
+ keys: LISTofCARD32 }
+
+ AXISCLASS { type: AxisClass
+ length: CARD16
+ sourceid: CARD16
+ axisnumber: CARD16
+ label: ATOM
+ min: FP3232
+ max: FP3232
+ value: FP3232
+ resolution: CARD32 }
+
+ XIQueryDevices details information about the requested input devices.
+
+ devices
+ The device to list. If devices is AllDevices, all enabled and
+ disabled devices are listed. If devices is AllMasterDevices, all
+ enabled and disabled master devices are listed. If devices is a
+ valid DEVICE, only this DEVICE is listed and num_devices is 1.
+ num_devices
+ The number of deviceinfos returned.
+
+ Each deviceinfo is detailed as follows:
+ deviceid
+ The unique ID of the device. Device IDs may get re-used when a device
+ is removed.
+ use
+ If the device is a master pointer, use is MasterPointer.
+ If the device is a master keyboard, use is MasterKeyboard.
+ If the device is a slave pointer, use is SlavePointer.
+ If the device is a slave keyboard, use is SlaveKeyboard.
+ If the device is a floating slave, use is FloatingSlave.
+ attachment
+ If the device is a master pointer or a master keyboard, attachment
+ specifies the paired master keyboard, or the paired master pointer,
+ respectively. If the device is a non-floating slave device
+ attachment specifies the master device this device is attached to.
+ If the device is a floating slave, attachment is undefined.
+ enabled
+ Zero if the device is disabled, non-zero otherwise.
+ num_classes
+ Number of classes provided.
+ name_len
+ Length of the name in bytes not including padding.
+ classes
+ Details the available classes provided by the device in an undefined
+ order.
+ name
+ The device's name. padded to a multiple of 4 bytes.
+
+ For all classes, type specifies the device class. Clients are required
+ to ignore unknown device classes. The length field specifies the length
+ of the class in 4 byte units.
+ The following classes may occur only once: ButtonClass, KeyClass
+
+ ButtonClass:
+ type
+ Always ButtonClass.
+ length
+ Length in 4 byte units.
+ sourceid
+ The device this class originates from.
+ num_buttons
+ Number of buttons provided by the device.
+ labels
+ List of Atoms specifying the label for each button. An Atom of None
+ specifies an unlabeled button. Buttons are listed in the device-native
+ order regardless of the current button mapping.
+ state
+ The current button mask for this device after button mapping is
+ applied. Each bit representing a button is 1 if this button is
+ logically down, or 0 otherwise. State is a multiple of 4-byte units
+ and always contains at least num_buttons bits.
+
+ KeyClass:
+ type
+ Always KeyClass.
+ length
+ Length in 4 byte units.
+ sourceid
+ The device this class originates from.
+ num_keys
+ Number of keycodes provided by the device.
+ keys
+ List of keycodes provided.
+
+ AxisClass:
+ type
+ Always AxisClass.
+ length
+ Length in 4 byte units.
+ sourceid
+ The device this class originates from.
+ axisnumber
+ Axis number of this axis. The axis number is in device-native
+ order and potential axis mappings are ignored.
+ label
+ Atom specifying the axis name. An Atom of None specifies an unlabeled
+ axis.
+ min
+ Minimum value.
+ max
+ Minimum value.
+ resolution
+ Resolution in counts/meter.
+ mode
+ Relative or Absolute.
+ value
+ Last published axis value (if mode is absolute).
+
+ An axis in Relative mode may specify min and max as a hint to the
+ client. If no min and max information is available, both must be 0.
+
+ ┌───
+ XISelectEvents
+ window: Window
+ num_masks: CARD16
+ masks: LISTofEVENTMASK
+
+ └───
+
+ EVENTMASK { deviceid: DEVICE,
+ mask_len: CARD16,
+ mask: SETofEVENTMASK
+
+ window
+ The window to select the events on.
+ num_masks
+ Number of items in masks.
+ deviceid
+ Numerical deviceid, or AllDevices, or AllMasterDevices.
+ mask_len
+ Length of mask in 4 byte units.
+ mask
+ Event mask. An event mask for an event type T is defined as (1 << T).
+
+ XISelectEvents selects for XI2 events on window.
+
+ If num_masks is 0, a BadValue error occurs.
+
+ Each mask sets the (and overwrites a previous) event mask for the DEVICE
+ specified through deviceid. The device AllDevices or
+ AllMasterDevices is treated as a separate device by server. A client's
+ event mask is the union of AllDevices, AllMasterDevices and the
+ per-device event mask.
+ The removal of device from the server unsets the event masks for the
+ device. If an event mask is set for AllDevices or AllMasterDevices, the
+ event mask is not cleared on device removal and affects all future
+ devices.
+
+ If mask_len is 0, the event mask for the given device is cleared.
+
+ The mask for XIHierarchyEvents may only be selected for XIAllDevices.
+ Setting it for any other device results in a BadValue error.
+
+ ┌───
+ XIGetSelectedEvents
+ window: Window
+ ▶
+ num_masks: CARD16
+ masks: LISTofEVENTMASK
+ └───
+
+ window
+ The window to select the events on.
+ num_masks
+ Number of items in masks.
+ masks
+ Selected event masks by this client.
+
+ Masks are returned on a per-device basis, with masks for AllDevices and
+ AllMasterDevices returned separately. A client can calculate the
+ effective mask for a device with a bitwise OR of the AllDevices, the
+ AllMasterDevices and the device-specific mask.
+
+ If num_masks is 0, no events have been selected by this client on the
+ given window.
+
+ ┌───
+ XIQueryPointer
+ window: Window
+ deviceid: DEVICEID
+ ▶
+ root: Window
+ child: Window
+ root_x: FP1616
+ root_y: FP1616
+ win_x: FP1616
+ win_y: FP1616
+ same_screen: BOOL
+ mods: MODIFIERINFO
+ group: GROUPINFO
+ buttons_len: CARD16
+ buttons: SETofBUTTONMASK
+ └───
+
+ Query a master pointer device for its current position.
+
+ root
+ The root window the pointer is logically on.
+ child
+ The child window of window that contains the pointer or None.
+ root_x
+ root_y
+ Pointer position relative to the root window's origin.
+ win_x
+ win_y
+ Pointer position relative to window or 0 if same_screen is false.
+ same_screen
+ True if window is on the same screen as the pointer.
+ mods
+ XKB modifier state on the paired device.
+ group
+ XKB group state on the paired device.
+ buttons_len
+ The length of buttons in 4 byte units.
+ buttons
+ Button state.
+
+ If the device is not a master pointer device or not a floating slave
+ pointer, a BadDevice error results.
+
+ ┌───
+ XIWarpPointer
+ src_win: Window
+ dst_win: Window
+ src_x: FP1616
+ src_y: FP1616
+ src_width: INT16
+ src_height: INT16
+ dst_x: FP1616
+ dst_y: FP1616
+ deviceid: DEVICEID
+ └───
+
+ WarpPointer moves the pointer of deviceid as if the user had moved
+ the pointer. WarpPointer can only be called for MasterPointer and
+ FloatingSlave devices.
+
+ src_win
+ If src_window is not None, the move only takes place if src_window
+ contains the pointer and the pointer is contained in the specified
+ rectangle of src_window.
+ dst_win
+ If dst_win is None, this request moves the pointer by offsets
+ dst_x/dst_y relative to the current position of the pointer. If
+ dst_window is a window, this request moves the pointer to
+ dst_x/dst_y relative to dst_win's origin.
+ src_x
+ src_y
+ src_width
+ src_height
+ Specifies the source window rectangle.
+ dst_x
+ dst_y
+ The relative coordinates to move the pointer if dst_win is None, or
+ the absolute coordinates if dst_win is a window.
+ deviceid
+ The device to warp.
+
+ This request cannot be used to move the pointer outside the confine-to
+ window of an active pointer grab. An attempt will only move the pointer as
+ far as the closest edge of the confine-to window.
+
+ This request will generate events just as if the user had instantaneously
+ moved the pointer.
+
+ ┌───
+ XIChangeCursor
+ win: Window
+ cursor: Cursor
+ deviceid: DEVICEID
+ └───
+
+ Change a master pointer's cursor on the specified window.
+
+ window
+ The window.
+ cursor
+ The new cursor or None.
+ deviceid
+ The master pointer device.
+
+ Whenever device enters a window W, the cursor shape is selected in the
+ following order:
+ - if the current window has a device cursor C(d) defined for device,
+ display this cursor C(d).
+ - otherwise, if the current window has a cursor C(w) defined in the core
+ protocol's window attributes, display cursor C(w).
+ - repeat on parent window until a cursor has been found.
+
+ The device cursor for a given window is reset once the window is destroyed
+ or the device is removed, whichever comes earlier.
+
+ If deviceid does not specify a master pointer, a BadDevice error
+ is returned.
+
+ ┌───
+ XIChangeHierarchy
+ num_changes: CARD8
+ changes: LISTofHIERARCHYCHANGES
+ └───
+
+ HIERARCHYCHANGE { ADDMASTER, REMOVEMASTER, ATTACHSLAVE, DETACHSLAVE }
+
+ HIERARCHYCHANGETYPE { AddMaster, RemoveMaster, AttachSlave, DetachSlave }
+
+ CHANGEMODE { Float, Attach }
+
+ ADDMASTER { type: HIERARCHYCHANGETYPE
+ length: CARD16
+ name_len: CARD16
+ send_core: BOOL
+ enable: BOOL
+ name: LISTofCHAR8 }
+
+ REMOVEMASTER { type: HIERARCHYCHANGETYPE
+ length: CARD16
+ deviceid: DEVICEID
+ return_mode: CHANGEMODE
+ return_pointer: DEVICEID
+ return_keyboard: DEVICEID }
+
+ ATTACHSLAVE { type: HIERARCHYCHANGETYPE
+ length: CARD16
+ deviceid: DEVICEID
+ master: DEVICEID }
+
+ DETACHSLAVE { type: HIERARCHYCHANGETYPE
+ length: CARD16
+ deviceid: DEVICEID }
+
+ XIChangeHierarchy allows a client to modify the MD/SD device
+ hierarchy (see Section 4).
+
+ num_changes
+ The number of changes to apply to the current hierarchy.
+ changes
+ The list of changes.
+
+ The server processes the changes in the order received from the client and
+ applies each requested change immediately. If an error occurs, processing
+ stops at the current change and returns the number of successfully applied
+ changes in the error.
+
+ ADDMASTER creates a pair of master devices.
+ type
+ Always AddMaster.
+ length
+ Length in 4 byte units.
+ name_len
+ Length of name in bytes.
+ send_core
+ True if the device should send core events.
+ enable
+ True if the device is to be enabled immediately.
+ name
+ The name for the new master devices. The master pointer's name is
+ automatically appended with " pointer", the master keyboard's name is
+ automatically appended with " keyboard".
+
+ REMOVEMASTER removes an existing master device.
+ type
+ Always RemoveMaster.
+ length
+ Length in 4 byte units.
+ deviceid
+ The device to remove.
+ return_mode
+ Return mode for attached slave devices.
+ If return_mode is Float, all slave devices are set to floating.
+ If return_mode is Attach, slave pointers are attached to
+ return_pointer and slave keyboards are attached to
+ return_keyboard.
+ return_pointer
+ return_keyboard
+ The master pointer and master keyboard to attach slave devices to, if
+ return_mode is Attach. If return_mode is Float, return_pointer
+ and return_keyboard are undefined.
+
+ Removing a master pointer removes the paired master keyboard and vice
+ versa.
+
+ ATTACHSLAVE attaches a slave device to a given master device.
+ type
+ Always ChangeAttachment.
+ length
+ Length in 4 byte units.
+ deviceid
+ Deviceid of the slave device.
+ master
+ The new master device to attach this slave device to.
+
+ DETACHSLAVE detaches a slave device from its current master device.
+ type
+ Always ChangeAttachment.
+ length
+ Length in 4 byte units.
+ deviceid
+ Deviceid of the slave device.
+
+ ┌───
+ XISetClientPointer
+ win: Window
+ deviceid: DEVICEID
+ └───
+
+ Set the ClientPointer for the client owning win to the given device.
+
+ win
+ Window or client ID.
+ deviceid
+ The master pointer or master keyboard that acts as ClientPointer.
+
+ Some protocol requests are ambiguous and the server has to choose a device
+ to provide data for a request or a reply. By default, the server will
+ choose a client's ClientPointer device to provide the data, unless the
+ client currently has a grab on another device. See section 4.4 for more
+ details.
+
+ If win is None, the ClientPointer for this client is set to the given
+ device. Otherwise, if win is a valid window, the ClientPointer for the
+ client owning this window is set to the given device. Otherwise, if win is
+ not a valid window but a client with the client mask equal to win exists,
+ this client's ClientPointer is set to the given device.
+
+ If deviceid does not specify a master pointer or master keyboard, a
+ BadDevice error is returned.
+
+ If window does not specify a valid window or client ID and is not None, a
+ BadWindow error is returned.
+
+ ┌───
+ XIGetClientPointer
+ win: Window
+ ▶
+ set: BOOL
+ deviceid: DEVICEID
+ └───
+
+ Query the ClientPointer for the client owning win.
+
+ win
+ The window or client ID.
+ set
+ True if the client has a ClientPointer set.
+ deviceid
+ The master pointer that acts as a ClientPointer if set is True.
+
+ No difference is made between a ClientPointer set explicitly through
+ XISetClientPointer and a ClientPointer implicitly assigned by the server
+ in response to an ambiguous request.
+
+ ┌───
+ XISetFocus
+ focus: Window
+ deviceid: DEVICEID
+ time: Time
+ └───
+
+ Set the focus for the given device to the given window. Future key events
+ from this device are sent to this window.
+ This request generates FocusIn and FocusOut events.
+
+ focus
+ A viewable window or None.
+ deviceid
+ The device to modify the focus window for.
+ time
+ Specifies the time to change the focus or CurrentTime.
+
+ If focus is None, key events from this device are discarded until a new
+ focus window is set. If focus is a viewable window, key events from this
+ device are sent to this window. If the window becomes unviewable, the
+ window's first viewable ancestor automatically becomes the focus window
+ and FocusIn and FocusOut events are sent as if a client had changed the
+ focus window.
+ This is equivalent to RevertToParent in the core XSetInputFocus window.
+
+ This request 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.
+
+ ┌───
+ XIGetFocus
+ deviceid: DEVICEID
+ ▶
+ focus: Window
+ └───
+
+ Return the current focus window for the given device.
+
+ ┌───
+ XIGrabDevice
+ deviceid: DEVICEID
+ grab_window: Window
+ owner_events: BOOL
+ grab_mode: { Synchronous, Asynchronous }
+ paired_device_mode: { Synchronous, Asynchronous }
+ time: TIMESTAMP or CurrentTime
+ cursor: Cursor
+ mask_len: CARD16
+ masks: SETofEVENTMASK
+ ▶
+ status: Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable
+ └───
+
+ This request actively grabs control of the specified input device. Further
+ input events from this device are reported only to the grabbing client.
+ This request overides any previous active grab by this client for this
+ device.
+
+ deviceid
+ The device to grab.
+ grab_window
+ Events are reported relative to the grab window.
+ owner_events
+ Specifies whether event will be reported normally or relative to the
+ grab window.
+ grab_mode
+ Specifies if this device will be frozen as a result of the grab.
+ paired_device_mode
+ Specifies if the master device paired with this device will be frozen
+ as a result of the grab.
+ time
+ A valid server time or CurrentTime.
+ cursor
+ The cursor to display for the duration of the grab or None.
+ mask_len
+ Length of mask in 4 byte units.
+ mask
+ Event mask. An event mask for an event type T is defined as (1 << T).
+ status
+ Success or the reason why the grab could not be established.
+
+ The masks parameter specifies which events the client wishes to receive
+ while the device is grabbed.
+
+ If owner-events is False, input events generated from this device are
+ reported with respect to grab-window, and are only reported if selected by
+ being included in the 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 selected by being included in the event-list. For
+ either value of owner-events, unreported events are discarded.
+
+ If grab-mode is Asynchronous, device event processing continues normally.
+ If the device is currently frozen by this client, then processing of
+ device events is resumed. If grab-mode is Synchronous, the state of the
+ grabbed device (as seen by means of the protocol) appears to freeze,
+ and no further device events are generated by the server until the
+ grabbing client issues a releasing XIAllowEvents request 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 device is a slave device, the paired-device-mode is ignored.
+ Otherwise, if this device is a master device and paired-device-mode is
+ Asynchronous, event processing is unaffected by activation of the grab. If
+ this device is a master device and paired-device-mode is Synchronous, the
+ state of the master device paired with this device (as seen by means of the
+ protocol) appears to freeze, and no further events are generated by the
+ server until the grabbing client issues a releasing XIAllowEvents request
+ or until the device grab is released. Actual events are not lost while the
+ devices are frozen; they are simply queued for later processing.
+
+ If the cursor is not None and the device is a master pointer device, the
+ cursor will be displayed until the device is ungrabbed.
+
+ This request fails and returns:
+ AlreadyGrabbed: If the device is actively grabbed by some other client.
+ NotViewable: If grab-window is not viewable.
+ InvalidTime: If the specified time is earlier than the last-grab-time for
+ the specified device or later than the current X server time.
+ 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.
+ Frozen: If the device is frozen by an active grab of another client.
+
+ To release a grab of a device, use XIUngrabDevice.
+
+ ┌───
+ XIUngrabDevice
+ deviceid: DEVICEID
+ time: TIMESTAMP or CurrentTime
+ └───
+
+ This request releases the device if this client has it actively grabbed
+ (from either XIGrabDevice, XIGrabDeviceKey or XIGrabDeviceButton) and
+ releases any queued events. If any devices were frozen by the grab,
+ XIUngrabDevice thaws them.
+
+ deviceid
+ The device to grab.
+ time
+ A valid server time or CurrentTime.
+
+ The request has no effect if the specified time is earlier than the
+ last-device-grab time or is later than the current server time.
+ This request generates FocusIn and FocusOut events.
+ An XIUngrabDevice is performed automatically if the event window for an
+ active device grab becomes not viewable.
+
+ ┌───
+ XIAllowEvents:
+ deviceid: DEVICEID
+ time: TIMESTAMP or CurrentTime
+ event_mode: { AsyncDevice, SyncDevice,
+ AsyncPairedDevice, SyncPairedDevice,
+ ReplayDevice, AsyncPair, SyncPair }
+ └───
+
+ The XIAllowEvents request releases some queued events if the client
+ has caused a device to freeze.
+
+ deviceid
+ The device to grab.
+ time
+ A valid server time or CurrentTime.
+ event_mode
+ Specifies whether a device is to be thawed and events are to be
+ replayed.
+
+ The request has no effect if the specified time is earlier than the
+ last-grab time of the most recent active grab for the client, 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:
+ AsyncDevice:
+ 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, AsyncDevice thaws for
+ all.
+ AsyncDevice has no effect if the specified device is not frozen by the
+ client, but the device need not be grabbed by the client.
+ SyncDevice:
+ If the specified device is frozen and actively grabbed by the client,
+ event processing for that device continues normally until the next
+ 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.
+ SyncDevice has no effect if the specified device is not frozen by the
+ client or is not grabbed by the client.
+ ReplayDevice:
+ 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 XIGrabButton or from a previous XIAllowEvents with
+ mode SyncDevice, 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 (towards 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.
+ AsyncPairedDevice
+ If the paired master device is frozen by the client, event processing
+ for it continues as usual. If the paired device is frozen multiple
+ times by the client on behalf of multiple separate grabs,
+ AsyncPairedDevice thaws for all.
+ AsyncPairedDevice has no effect if the device is not frozen by the
+ client, but those devices need not be grabbed by the client.
+ AsyncPairedDevice has no effect if deviceid specifies a slave device.
+ SyncPairedDevice
+ If the paired master device is frozen by the client, event processing (for
+ the paired master device) continues normally until the next button or key
+ event is reported to the client for the grabbed device (button event for
+ the grabbed device, key or motion event for the device), at which time
+ the device again appears to freeze. However, if the reported event causes
+ the grab to be released, then the device does not freeze.
+ SyncPairedDevice has no effect if the specified device is not grabbed
+ by the client or if it is no frozen as the result of an event.
+ SyncPairedDevice has no effect if deviceid specifies a slave device.
+ SyncPair
+ If both the device and the paired master device are frozen by the
+ client, event processing (for both devices) continues normally until
+ the next XIButtonPress, XIButtonRelease, XIKeyPress, or XIKeyRelease
+ event is reported to the client for a grabbed device (button event for
+ a pointer, key event for a keyboard), 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 the other device is
+ still grabbed, then a subsequent event for it will still cause both
+ devices to freeze).
+ SyncPair has no effect unless both the device and the paired master
+ device are frozen by the client. If the device or paired master device
+ is frozen twice by the client on behalf of two separate grabs,
+ SyncPair thaws for both (but a subsequent freeze for SyncPair will
+ only freeze each device once).
+ SyncPair has no effect if deviceid specifies a slave device.
+ AsyncPair
+ If the device and the paired master device are frozen by the client,
+ event processing for both devices continues normally. If a device is
+ frozen twice by the client on behalf of two separate grabs, AsyncBoth
+ thaws for both. AsyncPair has no effect unless both the device and the
+ paired master device frozen by the client.
+ AsyncPair has no effect if deviceid specifies a slave device.
+
+ ┌───
+ XIPassiveGrabDevice
+ deviceid: DEVICE
+ detail: CARD32
+ grab_type: GRABTYPE
+ grab_window: Window
+ cursor: Cursor
+ owner_events: Bool
+ grab_mode: { Synchronous, Asynchronous }
+ paired_device_mode: { Synchronous, Asynchronous }
+ num_modifiers: INT16
+ mask_len: CARD16
+ masks: SETofEVENTMASK
+ modifiers: CARD32 or GrabAnyModifier
+ ▶
+ num_modifiers_return: INT16
+ modifiers_return: GRABMODIFIERINFO
+ └───
+
+ GRABTYPE { GrabtypeButton, GrabtypeKeycode, GrabtypeEnter,
+ GrabTypeFocusIn}
+
+ GRABMODIFIERINFO { status: Access
+ modifiers: CARD32 }
+
+ Establish an explicit passive grab for a button or keycode
+ on the specified input device.
+
+ cursor
+ The cursor to display for the duration of the grab. If grab_type
+ is not GrabtypeButton, this argument is ignored.
+ deviceid
+ The device to establish the passive grab on or AllDevices or
+ AllMasterDevices.
+ detail
+ The button number, or key symbol to grab for.
+ Must be 0 for GrabtypeEnter and GrabtypeFocusIn.
+ grab_type
+ The type of grab to establish.
+ grab_window
+ Events are reported relative to the grab window.
+ grab_mode
+ If grab-mode is Asynchronous, device event processing continues
+ normally. If the device is currently frozen by this client, then
+ processing of device events is resumed. If grab-mode is
+ Synchronous, the state of the grabbed device (as seen by means of
+ the protocol) appears to freeze, and no further device events are
+ generated by the server until the grabbing client issues a
+ releasing XIAllowEvents request 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.
+ mask_len
+ Length of mask in 4 byte units.
+ mask
+ Event mask. An event mask for an event type T is defined as (1 << T).
+ modifiers
+ XKB modifier state to activate this passive grab.
+ num_modifiers
+ Number of elements in modifiers.
+ owner_events
+ Specifies whether event will be reported normally or relative to the
+ grab window.
+ num_modifiers_return
+ Number of elements in modifiers_return
+ modifiers_return
+ XKB modifier state that could not be grabbed.
+
+ If owner-events is False, input events generated from this device are
+ reported with respect to grab-window, and are only reported if
+ selected by being included in the 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 selected
+ by being included in the event-list. For either value of
+ owner-events, unreported events are discarded.
+
+ If deviceid specifies a master pointer, the modifiers of the paired
+ master keyboard are used. If deviceid specifies a slave pointer
+ the modifiers of the master keyboard paired with the attached master
+ pointers are used. If deviceid specifies a slave keyboard, the
+ modifiers of the attached master keyboard are used. Note that
+ activating a grab on a slave device detaches the device from its
+ master. In this case, the modifiers after activation of the grab are
+ from the slave device only and may be different to the modifier state
+ when the grab was triggered.
+
+ In the future, if grab_type is GrabtypeButton or GrabtypeKeyboard, the
+ device is actively grabbed if:
+ - the device is not grabbed, and
+ - the specified modifier keys are down, and
+ - the grab_type is GrabtypeButton and the button specified in detail
+ is logically pressed or the grab_type is GrabtypeKeycode and the
+ keycode specified in detail is logically pressed, and
+ - the grab_window contains the pointer, and
+ - a passive grab on the same button/keycode + modifier
+ combination does not exist on an ancestor of grab_window.
+
+ Otherwise, if grab_type is GrabtypeEnter or GrabtypeFocusIn, the
+ device is actively grabbed if:
+ - the device is not actively grabbed, and
+ - the specified modifier keys are down, and
+ - the grab_type is GrabtypeEnter and the device's pointer has moved
+ into grab_window or a descendant of grab_window, or the grab_type is
+ GrabtypeFocusIn and the device's focus has been set to the
+ grab_window or a descendant of grab_window,
+ - a passive grab of the same grab_type + modifier combination does not
+ does not exist on an ancestor of grab_window.
+
+ A modifier of GrabAnyModifier is equivalent to issuing the request for
+ all possible modifier combinations (including no modifiers). A client
+ may request a grab for GrabAnyModifier and explicit modifier
+ combinations in the same request.
+
+ A GrabtypeButton or GrabtypeKeyboard grab is released when all buttons
+ or keycode are released, independent of the state of modifier keys.
+ A GrabtypeEnter or GrabtypeFocusIn grab is released when the
+ pointer or focus leaves the window and all of its descendants,
+ independent of the state of modifier keys.
+ Note that the logical state of a device (as seen by means of the
+ protocol) may lag the physical state if device event processing is
+ frozen.
+
+ This request overrides all previous passive grabs by the same
+ client on the same button/key/enter/focus in + modifier combinations
+ on the same window.
+
+ If some other client already has issued a XIPassiveGrabDevice request
+ with the same button or keycode and modifier combination, the
+ failed modifier combinations is returned in modifiers_return. If some
+ other client already has issued an XIPassiveGrabDevice request of
+ grab_type XIGrabtypeEnter or XIGrabtypeFocusIn with the same
+ grab_window and the same modifier combination, the failed modifier
+ combinations are returned in modifiers_return. If num_modifiers_return
+ is zero, all passive grabs have been successful.
+
+ If a button grab or enter grab activates, EnterNotify and LeaveNotify
+ events with mode Grab are generated as if the pointer were to suddenly
+ warp from its current position some position in the grab_window.
+ However, the pointer does not warp, and the pointer position is used
+ as both the initial and final positions for the events.
+
+ If a keycode grab or focus grab activates, FocusIn and FocusOut events
+ with mode Grab are generated as if the focus were to change from the
+ current window to the grab_window.
+
+ If an enter or focus in grab activates, additional EnterNotify events
+ with mode XIPassiveGrabNotify are generated as if the pointer or focus
+ were to suddenly warp from its current position to some position in
+ the grab window. These events are sent to the grabbing client only
+ and only if the grab event mask has selected for it. If such a passive
+ grab deactivates, addional LeaveNotify events with mode
+ XIPassiveUngrabNotify are generated and sent to the grabbing client
+ before the grab deactivates.
+
+ ┌───
+ XIPassiveUngrabDevice
+ deviceid: DEVICEID
+ detail: CARD32
+ grab_type: GRABTYPE
+ grab_window: Window
+ num_modifiers: INT16
+ modifiers: MODIFIERINFO
+ └───
+
+ Release an explicit passive grab on the specified input device.
+
+ deviceid
+ The device to establish the passive grab on.
+ detail
+ The button number or key symbol to ungrab.
+ Must be 0 for GrabtypeEnter and GrabtypeFocusIn.
+ grab_type
+ The type of grab to establish.
+ grab_window
+ Events are reported relative to the grab window.
+ modifiers
+ XKB modifier state to activate this passive grab.
+ num_modifiers
+ Number of elements in modifiers.
+
+ This request has no effect if the client does not have a passive grab
+ of the same type, same button or keycode (if applicable) and modifier
+ combination on the grab_window.
+
+ ┌───
+ XIListProperties
+ deviceid: DEVICEID
+ ▶
+ num_properties: INT16
+ properties: LISTofATOM
+ └───
+
+ List the properties associated with the given device.
+
+ deviceid
+ The device to list the properties for.
+ num_atoms
+ Number of atoms in the reply
+ atoms
+ All properties on the device.
+
+ ┌───
+ XIChangeProperty
+ deviceid: DEVICEID
+ property: ATOM
+ type: ATOM
+ format: { 8, 16, 32 }
+ mode: { Append, Prepend, Replace }
+ num_items: CARD32
+ data: LISTofINT8, or LISTofINT16, or LISTofINT32
+ └───
+
+ Change the given property on the given device.
+
+ deviceid
+ The device to change the property on.
+ property
+ The property to modify.
+ type
+ The property's type.
+ mode
+ One of Append, Prepend, or Replace
+ num_items
+ Number of items following this request.
+ data
+ Property data (nitems * format/8 bytes)
+
+ The type is uninterpreted by the server. The format specifies whether
+ the data should be viewed as a list of 8-bit, 16-bit, or 32-bit
+ quantities so that the server can correctly byte-swap as necessary.
+
+ If the mode is Replace, the previous propert y value is discarded. If
+ the mode is Prepend or Append, then the type and format must match the
+ existing property value (or a Match error results). If the property is
+ undefined, it is treated as defined with the correct type and format
+ with zero-length data. For Prepend, the data is tacked on to the
+ beginning of the existing data, and for Append, it is tacked on to the
+ end of the existing data.
+
+ The lifetime of a property is not tied to the storing client. Properties
+ remain until explicitly deleted, until the device is removed, or
+ until server reset.
+
+ A property cannot be deleted by setting nitems to zero. To delete a
+ property, use XIDeleteDeviceProperty.
+
+ This request generates an XIPropertyEvent.
+
+ ┌───
+ XIDeleteProperty
+ deviceid: DEVICEID
+ property: ATOM
+ └───
+
+ Deletes the given property on the given device.
+
+ deviceid
+ The device to delete the property on.
+ property
+ The property to delete.
+
+ If the property is deleted, an XIPropertyEvent is generated on the device.
+ If the property does not exist, this request does nothing.
+
+ ┌───
+ XIGetProperty
+ deviceid: DEVICEID
+ property: ATOM
+ type: Atom or AnyPropertyType
+ offset: CARD32
+ len: CARD32
+ delete: BOOL
+ ▶
+ type: Atom
+ bytes_after: CARD32
+ num_items: CARD32
+ format: { 8, 16, 32 }
+ data: LISTofINT8, or LISTofINT16, or LISTofINT32
+ └───
+
+ Get the data for the given property on the given device.
+
+ deviceid
+ The device to retrieve the property data from.
+ property
+ The property to retrieve the data from..
+ type
+ The property type to retrieve or AnyPropertyType
+ offset
+ The offset in 4-byte units.
+ len
+ Number of bytes to receive in 4-byte units.
+ delete
+ Delete the property after retrieving the data.
+ bytes_after
+ Number of unread bytes in the stored property
+ num_items
+ Number of items in data
+ format
+ 8, 16, or 32
+ data
+ Property data (nitems * format/8 bytes)
+
+ If the specified property does not exist for the specified device, then
+ the return type is None, the format and bytes-after are zero, and the value is
+ empty. The delete argument is ignored in this case. If the specified property
+ exists but its type does not match the specified type, then the return
+ type is the actual type of the property, the format is the actual format of the
+ property (never zero), the bytes-after is the length of the property in bytes
+ (even if the format is 16 or 32), and the value is empty. The delete
+ argument is ignored in this case. If the specified property exists and
+ either AnyPropertyType is specified or the specified type matches the actual
+ type of the property, then the return type is the actual type of the property,
+ the format is the actual format of the property
+ (never zero), and the bytes-after and value are as follows, given:
+ N = actual length of the stored property in bytes
+ (even if the format is 16 or 32)
+ I = 4 * long-offset
+ T = N−I
+ L = MINIMUM(T, 4 * long-length)
+ A = N − (I + L)
+ The returned value starts at byte index I in the property (indexing
+ from 0), and its length in bytes is L. However, it is a Value error if
+ offset is given such that L is negative. The value of bytes_after is A,
+ giving the number of trailing unread bytes in the stored property. If
+ delete is True and the bytes_after is zero, the property is also
+ deleted from the device, and a XIPropertyNotify event is generated on
+ the device.
+
+
+8. Events:
+
+An event specifies its length in 4-byte units after the initial 32 bytes.
+Future versions of the protocol may provide additional information
+in the same event, thus increasing the event size. Clients are required to
+always read the number of bytes specified by the event, not the size of the
+event they may have been compiled against.
+
+
+The following event types are available in XI2.
+
+Version 2.0:
+ HierarchyChanged
+ DeviceChanged
+ KeyPress
+ KeyRelease
+ ButtonPress
+ ButtonRelease
+ Motion
+ RawKeyPress
+ RawKeyRelease
+ RawButtonPress
+ RawButtonRelease
+ RawMotion
+ Enter
+ Leave
+ FocusIn
+ FocusOut
+ PropertyEvent
+
+All events have a set of common fields specified as EVENTHEADER.
+
+
+EVENTHEADER { type: BYTE
+ extension: BYTE
+ sequenceNumber: CARD16
+ length: CARD32
+ evtype: CARD16
+ deviceid: DEVICEID
+ time: Time }
+
+ type
+ Always GenericEvent.
+ extension
+ Always the X Input extension offset.
+ sequenceNumber
+ Sequence number of last request processed by the server.
+ length
+ Length in 4-byte units after the initial 32 bytes.
+ evtype
+ XI-specific event type.
+ deviceid
+ Numerical device id for a device.
+ time
+ Time in ms.
+
+
+ ┌───
+ HierarchyEvent:
+ EVENTHEADER
+ flags: SETofHIERARCHYMASK
+ num_info: CARD16
+ info: LISTofHIERARCHYINFO
+ └───
+
+
+ HIERARCHYMASK { MasterAdded, MasterRemoved, SlaveAttached, SlaveDetached,
+ SlaveAdded, SlaveRemoved, DeviceEnabled, DeviceDisabled }
+
+ HIERARCHYINFO { deviceid: DEVICEID,
+ attachment: DEVICEID,
+ type: DEVICEUSE
+ enabled: BOOL
+ flags: SETofHIERARCHYMASK}
+
+ flags
+ Set of the changes that have occured, causing this event.
+ num_info
+ The number of device info structs following the request.
+ info:
+ The current hierarchy information.
+
+ An XIHierarchyEvent is sent whenever the device hierarchy been
+ changed. The flags specify all types of hierarchy modifiations that have
+ occured.
+ For all devices, info details the hierarchy information after the
+ modification of the hierarchy has occured. For each device specified with
+ deviceid:
+ - if type is MasterPointer or MasterKeyboard, attachment decribes the
+ pairing of this device.
+ - if type is SlavePointer or SlaveKeyboard, attachment describes the
+ master device this device is attached to.
+ - if type is FloatingSlave device, attachment is undefined.
+
+ enabled
+ True if the device is enabled and can send events. A disabled master
+ device will not forward events from an attached, enabled slave
+ device.
+
+ Note: Multiple devices may be affected in one hierarchy change,
+ deviceid in an XIHierarchyEvent is always the first affected
+ device. Clients should ignore deviceid and instead use the devices list.
+
+ ┌───
+ DeviceChangedEvent:
+ EVENTHEADER
+ reason: CHANGEREASON
+ source: DEVICEID
+ num_classes: CARD16
+ classes: LISTofCLASS
+ └───
+
+ CHANGEREASON { SlaveSwitch, DeviceChange }
+
+ A DeviceChangeEvent is sent whenever a device changes it's capabilities.
+ This can happen either by a new slave device sending events through a
+ master device, or by a physical device changing capabilities at runtime.
+
+ reason
+ The reason for generating this event.
+ If reason is SlaveSwitch, the slave device sending events through
+ this device has changed and source specifies the new slave device.
+ A SlaveSwitch reason can only occur on a master device.
+ If reason is DeviceChange, the device itself has changed through
+ other means (e.g. a physical device change) and source is
+ the device itself.
+ source
+ The source of the new classes.
+ num_classes
+ Number of classes provided.
+ classes
+ Details the available classes provided by the device. The order the
+ classes are provided in is undefined.
+
+ For a detailed description of classes, see the XQueryInputDevice
+ request.
+
+ ┌───
+ DeviceEvent:
+ EVENTHEADER
+ detail: CARD32
+ root: Window
+ event: Window
+ child: Window
+ root_x: FP1616
+ root_y: FP1616
+ event_x: FP1616
+ event_y: FP1616
+ buttons_len: CARD16
+ valuators_len: CARD16
+ sourceid: DEVICEID
+ mods: MODIFIERINFO
+ group: GROUPINFO
+ flags: DEVICEEEVENTFLAGS
+ buttons: SETofBUTTONMASK
+ valuators: SETofVALUATORMASK
+ axisvalues: LISTofFP3232
+ └───
+
+ BUTTONBIT { (1 << Button1), (1 << Button2), ... , (1 << ButtonN) }
+ VALUATORBIT { (1 << 1), ( 1 << 2), ... ( 1 << n) }
+
+ MODIFIERINFO { base_mods: CARD32,
+ latched_mods: CARD32,
+ locked_mods: CARD32,
+ effective_mods: CARD32}
+ GROUPINFO { base_group: CARD8,
+ latched_group: CARD8,
+ locked_group: CARD8,
+ effective_group: CARD8}
+
+ DEVICEEVENTFLAGS (all events): none
+ DEVICEEVENTFLAGS (key events only): { KeyRepeat }
+ DEVICEEVENTFLAGS (pointer events only): none
+
+ An XIDeviceEvent is generated whenever the logical state of a device
+ changes in response to a button press, a button release, a motion, a key
+ press or a key release.
+
+ detail
+ The button number or key code, or 0.
+ root
+ event
+ child
+ The root window, event window or subwindow, respectively. See core
+ protocol specification for more detail.
+ root_x
+ root_y
+ The position of the pointer in screen coordinates (16.16 fixed point).
+ event_x
+ event_y
+ The position of the pointer in screen coordinates relative to the
+ event window (16.16 fixed point).
+
+ buttons_len
+ The length of buttons in 4 byte units.
+ valuators_len
+ The length of valuators in 4 byte units.
+ sourceid
+ The source device that originally generated the event.
+ mods
+ XKB modifier state before the event occured.
+ group
+ XKB group state before the event.
+ buttons
+ Button state before the event.
+ valuators
+ Bitmask of valuators provided in axisvalues.
+ axisvalues
+ Valuator data in device-native resolution.
+ flags
+ Miscellaneous information about this event; the union of the
+ common flag set and either the key or pointer flag set,
+ depending on the event type.
+ KeyRepeat means that this event is for repeating purposes, and
+ the physical state of the key has not changed. This is only
+ valid for KeyPress events.
+
+ Modifier state in mods is detailed as follows:
+ base_mods
+ XKB base modifier state.
+ latched_mods
+ XKB latched modifier state.
+ locked_mods
+ XKB locked modifier state.
+
+ Group state in group is detailed as follows:
+ base_group
+ XKB base group state.
+ latched_group
+ XKB latched group state.
+ locked_group
+ XKB locked group state.
+
+ ┌───
+ RawEvent
+ EVENTHEADER
+ detail: CARD32
+ flags: DEVICEEVENTFLAGS
+ valuators_len: CARD16
+ valuators: SETofVALUATORMASK
+ axisvalues: LISTofFP3232
+ axisvalues_raw: LISTofFP3232
+ └───
+
+ A RawDevice event provides the information provided by the driver to the
+ client. RawDevice provide both the raw data as supplied by the driver and
+ transformed data as used in the server. Transformations include, but are
+ not limited to, axis clipping and acceleration.
+ Transformed valuator data may be equivalent to raw data. In this case,
+ both raw and transformed valuator data is provided.
+ RawEvents are sent exclusively to all root windows or to the client
+ that grabbed the device only.
+
+ eventtype
+ The type of event that occured on the device.
+ detail
+ The button number or keycode.
+ flags
+ Flags as described in DeviceEvent.
+ valuators_len
+ The length of valuators in 4 byte units.
+ valuators
+ Bitmask of valuators provided in axisvalues and axisvalues_raw.
+ axisvalues
+ Valuator data in device-native resolution.
+ axisvalues_raw
+ Untransformed valuator data in device-native resolution.
+
+ ┌───
+ Enter or Leave or FocusIn or FocusOut
+ EVENTHEADER
+ root: Window
+ event: Window
+ child: Window
+ sourceid: DEVICEID
+ root_x: FP1616
+ root_y: FP1616
+ event_x FP1616
+ event_y: FP1616
+ mode: NOTIFYMODE
+ detail: NOTIFYDETAIL
+ same_screen: BOOL
+ focus: BOOL
+ mods: MODIFIERINFO
+ group: GROUPINFO
+ buttons_len: CARD16
+ buttons: SETofBUTTONMASK
+ └───
+
+ NOTIFYMODE { Normal, Grab, Ungrab }
+ NOTIFYDETAIL { Ancestor, Virtual, Inferior, Nonlinear, NonlinearVirtual,
+ Pointer, PointerRoot, None }
+
+ Enter or Leave events are sent whenever a device's pointer enters or
+ leaves a window.
+ FocusIn or FocusOut events are sent whenever a device's focus is set to or
+ away from a window.
+ The enter/leave and focus in/out model is described in the core protocol
+ specification, Section 11. (EnterNotify, LeaveNotify events).
+
+ For enter and leave events, the modifier and group state is the state of
+ the paired master device if the device is a master device, or the state of
+ the attached master keyboard if the device is an attached slave device, or
+ zero if the device is a floating slave device.
+
+ For focus in and out events, the button state is the state of the paired
+ master device if the device is a master device, or the state of the
+ attached master keyboard if the device is an attached slave device, or
+ zero if the device is a floating slave device.
+
+ root
+ event
+ child
+ The root window, event window, and child window, respectively. See the
+ core protocol specification for more detail.
+ sourceid
+ The device that caused the pointer to move.
+ root_x
+ root_y
+ The pointer coordinates relative to the root window.
+ event_x
+ event_y
+ The pointer coordinates relative to the event window.
+ mode
+ Normal pointer motion events have mode Normal. Pseudo-motion events
+ when a grab activates have mode Grab, and pseudo-motion events when a
+ grab deactivates have mode Ungrab. Pseudo-motion events caused by the
+ activation or deactivation of a passive enter or focus in grab have mode
+ XIPassiveGrabNotify or XIPassiveUngrabNotify.
+ detail
+ Specifies the relation of the event window to the window the pointer
+ entered or left. See the core protocol spec for details.
+ same_screen
+ True if the event window is on the same screen as the pointer's root
+ window.
+ focus
+ If the event window is the focus window or an inferior of the focus
+ window, then focus is True. Otherwise, focus is False. This field is
+ unspecified for focus in/out events.
+ mods
+ XKB modifier state before the event occured.
+ group
+ XKB group state before the event.
+ buttons_len
+ The length of buttons in 4 byte units.
+ buttons
+ Button state before the event.
+
+ ┌───
+ XIPropertyEvent
+ EVENTHEADER
+ property: ATOM
+ what: { PropertyCreated, PropertyDeleted, PropertyModified }
+ └───
+
+ XIPropertyEvents are sent whenever a device property is created, deleted or
+ modified by a client.
+
+ property
+ The property that has been created, deleted, or modified
+ what
+ Specifies what has been changed.
+
+
+ ❧❧❧❧❧❧❧❧❧❧❧
diff --git a/inputproto/XIproto.h b/inputproto/XIproto.h
new file mode 100644
index 0000000..e00ab61
--- /dev/null
+++ b/inputproto/XIproto.h
@@ -0,0 +1,1756 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+#ifndef _XIPROTO_H
+#define _XIPROTO_H
+
+#include <X11/Xproto.h>
+#include <X11/X.h>
+
+/* make sure types have right sizes for protocol structures. */
+#define Window CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define Mask CARD32
+#define Atom CARD32
+#define Cursor CARD32
+
+/*********************************************************
+ *
+ * number of events, errors, and extension name.
+ *
+ */
+
+#define MORE_EVENTS 0x80
+#define DEVICE_BITS 0x7F
+
+#define InputClassBits 0x3F /* bits in mode field for input classes */
+#define ModeBitsShift 6 /* amount to shift the remaining bits */
+
+#define numInputClasses 7
+
+#define IEVENTS 17 /* does NOT include generic events */
+#define IERRORS 5
+#define IREQUESTS 39
+
+#define CLIENT_REQ 1
+
+typedef struct _XExtEventInfo
+ {
+ Mask mask;
+ BYTE type;
+ BYTE word;
+ } XExtEventInfo;
+
+typedef unsigned char *Pointer;
+
+struct tmask
+ {
+ Mask mask;
+ Pointer dev;
+ };
+
+/*********************************************************
+ *
+ * Event constants used by library.
+ *
+ */
+
+#define XI_DeviceValuator 0
+#define XI_DeviceKeyPress 1
+#define XI_DeviceKeyRelease 2
+#define XI_DeviceButtonPress 3
+#define XI_DeviceButtonRelease 4
+#define XI_DeviceMotionNotify 5
+#define XI_DeviceFocusIn 6
+#define XI_DeviceFocusOut 7
+#define XI_ProximityIn 8
+#define XI_ProximityOut 9
+#define XI_DeviceStateNotify 10
+#define XI_DeviceMappingNotify 11
+#define XI_ChangeDeviceNotify 12
+#define XI_DeviceKeystateNotify 13
+#define XI_DeviceButtonstateNotify 14
+#define XI_DevicePresenceNotify 15
+#define XI_DevicePropertyNotify 16
+
+/*********************************************************
+ *
+ * Protocol request constants
+ *
+ */
+
+#define X_GetExtensionVersion 1
+#define X_ListInputDevices 2
+#define X_OpenDevice 3
+#define X_CloseDevice 4
+#define X_SetDeviceMode 5
+#define X_SelectExtensionEvent 6
+#define X_GetSelectedExtensionEvents 7
+#define X_ChangeDeviceDontPropagateList 8
+#define X_GetDeviceDontPropagateList 9
+#define X_GetDeviceMotionEvents 10
+#define X_ChangeKeyboardDevice 11
+#define X_ChangePointerDevice 12
+#define X_GrabDevice 13
+#define X_UngrabDevice 14
+#define X_GrabDeviceKey 15
+#define X_UngrabDeviceKey 16
+#define X_GrabDeviceButton 17
+#define X_UngrabDeviceButton 18
+#define X_AllowDeviceEvents 19
+#define X_GetDeviceFocus 20
+#define X_SetDeviceFocus 21
+#define X_GetFeedbackControl 22
+#define X_ChangeFeedbackControl 23
+#define X_GetDeviceKeyMapping 24
+#define X_ChangeDeviceKeyMapping 25
+#define X_GetDeviceModifierMapping 26
+#define X_SetDeviceModifierMapping 27
+#define X_GetDeviceButtonMapping 28
+#define X_SetDeviceButtonMapping 29
+#define X_QueryDeviceState 30
+#define X_SendExtensionEvent 31
+#define X_DeviceBell 32
+#define X_SetDeviceValuators 33
+#define X_GetDeviceControl 34
+#define X_ChangeDeviceControl 35
+/* XI 1.5 */
+#define X_ListDeviceProperties 36
+#define X_ChangeDeviceProperty 37
+#define X_DeleteDeviceProperty 38
+#define X_GetDeviceProperty 39
+
+/*********************************************************
+ *
+ * Protocol request and reply structures.
+ *
+ * GetExtensionVersion.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetExtensionVersion */
+ CARD16 length B16;
+ CARD16 nbytes B16;
+ CARD8 pad1, pad2;
+} xGetExtensionVersionReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetExtensionVersion */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ BOOL present;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetExtensionVersionReply;
+
+/*********************************************************
+ *
+ * ListInputDevices.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ListInputDevices */
+ CARD16 length B16;
+} xListInputDevicesReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ListInputDevices */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 ndevices;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xListInputDevicesReply;
+
+typedef struct _xDeviceInfo *xDeviceInfoPtr;
+
+typedef struct _xAnyClassinfo *xAnyClassPtr;
+
+typedef struct _xAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ } xAnyClassInfo;
+
+typedef struct _xDeviceInfo {
+ CARD32 type B32;
+ CARD8 id;
+ CARD8 num_classes;
+ CARD8 use; /* IsXPointer | IsXKeyboard | IsXExtension... */
+ CARD8 attached; /* id of master dev (if IsXExtension..) */
+ } xDeviceInfo;
+
+typedef struct _xKeyInfo *xKeyInfoPtr;
+
+typedef struct _xKeyInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ KeyCode min_keycode;
+ KeyCode max_keycode;
+ CARD16 num_keys B16;
+ CARD8 pad1,pad2;
+ } xKeyInfo;
+
+typedef struct _xButtonInfo *xButtonInfoPtr;
+
+typedef struct _xButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD16 num_buttons B16;
+ } xButtonInfo;
+
+typedef struct _xValuatorInfo *xValuatorInfoPtr;
+
+typedef struct _xValuatorInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_axes;
+ CARD8 mode;
+ CARD32 motion_buffer_size B32;
+ } xValuatorInfo;
+
+typedef struct _xAxisInfo *xAxisInfoPtr;
+
+typedef struct _xAxisInfo {
+ CARD32 resolution B32;
+ CARD32 min_value B32;
+ CARD32 max_value B32;
+ } xAxisInfo;
+
+/*********************************************************
+ *
+ * OpenDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_OpenDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xOpenDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_OpenDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } xOpenDeviceReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 event_type_base;
+ } xInputClassInfo;
+
+/*********************************************************
+ *
+ * CloseDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_CloseDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xCloseDeviceReq;
+
+/*********************************************************
+ *
+ * SetDeviceMode.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceMode */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 mode;
+ BYTE pad1, pad2;
+} xSetDeviceModeReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceMode */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceModeReply;
+
+/*********************************************************
+ *
+ * SelectExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SelectExtensionEvent */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+} xSelectExtensionEventReq;
+
+/*********************************************************
+ *
+ * GetSelectedExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetSelectedExtensionEvents */
+ CARD16 length B16;
+ Window window B32;
+} xGetSelectedExtensionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetSelectedExtensionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 this_client_count B16;
+ CARD16 all_clients_count B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetSelectedExtensionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD8 mode;
+ BYTE pad;
+} xChangeDeviceDontPropagateListReq;
+
+/*********************************************************
+ *
+ * GetDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+} xGetDeviceDontPropagateListReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetDeviceDontPropagateList */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGetDeviceDontPropagateListReply;
+
+/*********************************************************
+ *
+ * GetDeviceMotionEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceMotionEvents*/
+ CARD16 length B16;
+ Time start B32;
+ Time stop B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceMotionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceMotionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nEvents B32;
+ CARD8 axes;
+ CARD8 mode;
+ BYTE pad1, pad2;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetDeviceMotionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeKeyboardDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeKeyboardDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xChangeKeyboardDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeKeyboardDevice*/
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangeKeyboardDeviceReply;
+
+/*********************************************************
+ *
+ * ChangePointerDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangePointerDevice */
+ CARD16 length B16;
+ CARD8 xaxis;
+ CARD8 yaxis;
+ CARD8 deviceid;
+ BYTE pad1;
+} xChangePointerDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangePointerDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangePointerDeviceReply;
+
+/*********************************************************
+ *
+ * GrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDevice */
+ CARD16 length B16;
+ Window grabWindow B32;
+ Time time B32;
+ CARD16 event_count B16;
+ CARD8 this_device_mode;
+ CARD8 other_devices_mode;
+ BOOL ownerEvents;
+ CARD8 deviceid;
+ CARD16 pad01 B16;
+} xGrabDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GrabDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGrabDeviceReply;
+
+/*********************************************************
+ *
+ * UngrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UnGrabDevice */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceReq;
+
+/*********************************************************
+ *
+ * GrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 grabbed_device;
+ CARD8 key;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 key;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * GrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD8 grabbed_device;
+ CARD8 modifier_device;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ CARD8 button;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 button;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * AllowDeviceEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_AllowDeviceEvents */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+} xAllowDeviceEventsReq;
+
+/*********************************************************
+ *
+ * GetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceFocus */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceFocusReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceFocus */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } xGetDeviceFocusReply;
+
+/*********************************************************
+ *
+ * SetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceFocus */
+ CARD16 length B16;
+ Window focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ CARD8 device;
+ CARD16 pad01 B16;
+} xSetDeviceFocusReq;
+
+/*********************************************************
+ *
+ * GetFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetFeedbackControl */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetFeedbackControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetFeedbackControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 num_feedbacks B16;
+ CARD16 pad01 B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+} xGetFeedbackControlReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class */
+#else
+ CARD8 class; /* feedback class */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+ BOOL global_auto_repeat;
+ CARD8 click;
+ CARD8 percent;
+ BYTE pad;
+ BYTE auto_repeats[32];
+} xKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD8 pad1,pad2;
+ CARD16 accelNum B16;
+ CARD16 accelDenom B16;
+ CARD16 threshold B16;
+} xPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 resolution B32;
+ INT32 min_value B32;
+ INT32 max_value B32;
+} xIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD16 max_symbols B16;
+ CARD16 num_syms_supported B16;
+} xStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD8 percent;
+ BYTE pad1, pad2, pad3;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+} xBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackState;
+
+/*********************************************************
+ *
+ * ChangeFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeFeedbackControl */
+ CARD16 length B16;
+ CARD32 mask B32;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ BYTE pad1, pad2;
+} xChangeFeedbackControlReq;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback length */
+ CARD16 length B16; /* feedback length */
+ KeyCode key;
+ CARD8 auto_repeat_mode;
+ INT8 click;
+ INT8 percent;
+ INT16 pitch B16;
+ INT16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xKbdFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ INT16 num B16;
+ INT16 denom B16;
+ INT16 thresh B16;
+} xPtrFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT32 int_to_display B32;
+} xIntegerFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ CARD16 num_keysyms B16;
+} xStringFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT8 percent;
+ BYTE pad1, pad2, pad3;
+ INT16 pitch B16;
+ INT16 duration B16;
+} xBellFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackCtl;
+
+/*********************************************************
+ *
+ * GetDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+} xGetDeviceKeyMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceKeyMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 keySymsPerKeyCode;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceKeyMappingReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 keySymsPerKeyCode;
+ CARD8 keyCodes;
+} xChangeDeviceKeyMappingReq;
+
+/*********************************************************
+ *
+ * GetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 numKeyPerModifier;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 numKeyPerModifier;
+ CARD16 pad1 B16;
+} xSetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 success;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * GetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 nElts;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_SetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 map_length;
+ BYTE pad1, pad2;
+} xSetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * QueryDeviceState.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_QueryDeviceState */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xQueryDeviceStateReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_QueryDeviceState */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xQueryDeviceStateReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_keys;
+ BYTE pad1;
+ CARD8 keys[32];
+} xKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_buttons;
+ BYTE pad1;
+ CARD8 buttons[32];
+} xButtonState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_valuators;
+ CARD8 mode;
+} xValuatorState;
+
+/*********************************************************
+ *
+ * SendExtensionEvent.
+ * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
+ * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_SendExtensionEvent */
+ CARD16 length B16;
+ Window destination B32;
+ CARD8 deviceid;
+ BOOL propagate;
+ CARD16 count B16;
+ CARD8 num_events;
+ BYTE pad1,pad2,pad3;
+} xSendExtensionEventReq;
+
+/*********************************************************
+ *
+ * DeviceBell.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_DeviceBell */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ CARD8 feedbackclass;
+ INT8 percent;
+} xDeviceBellReq;
+
+/*********************************************************
+ *
+ * SetDeviceValuators.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceValuators */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 first_valuator;
+ CARD8 num_valuators;
+ BYTE pad1;
+} xSetDeviceValuatorsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceValuators */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceValuatorsReply;
+
+/*********************************************************
+ *
+ * GetDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad2;
+} xGetDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD32 num_valuators B32; /* number of valuators */
+} xDeviceResolutionState;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ INT32 min_x B32;
+ INT32 max_x B32;
+ INT32 min_y B32;
+ INT32 max_y B32;
+ CARD32 flip_x B32;
+ CARD32 flip_y B32;
+ CARD32 rotation B32;
+ CARD32 button_threshold B32;
+} xDeviceAbsCalibState;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD32 offset_x B32;
+ CARD32 offset_y B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 screen B32;
+ CARD32 following B32;
+} xDeviceAbsAreaState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 status;
+ CARD8 iscore;
+ CARD16 pad1 B16;
+} xDeviceCoreState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 enable;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceEnableState;
+
+/*********************************************************
+ *
+ * ChangeDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad0;
+} xChangeDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xChangeDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceCtl;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 first_valuator; /* first valuator to change */
+ CARD8 num_valuators; /* number of valuators to change*/
+ CARD8 pad1,pad2;
+} xDeviceResolutionCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ INT32 min_x;
+ INT32 max_x;
+ INT32 min_y;
+ INT32 max_y;
+ CARD32 flip_x;
+ CARD32 flip_y;
+ CARD32 rotation;
+ CARD32 button_threshold;
+} xDeviceAbsCalibCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD32 offset_x;
+ CARD32 offset_y;
+ INT32 width;
+ INT32 height;
+ INT32 screen;
+ CARD32 following;
+} xDeviceAbsAreaCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD8 status;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceCoreCtl;
+
+typedef struct {
+ CARD16 control B16;
+ CARD16 length B16;
+ CARD8 enable;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeviceEnableCtl;
+
+/* XI 1.5 */
+
+/*********************************************************
+ *
+ * ListDeviceProperties.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major opcode */
+ CARD8 ReqType; /* always X_ListDeviceProperties */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xListDevicePropertiesReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ListDeviceProperties */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nAtoms B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xListDevicePropertiesReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceProperty.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major opcode */
+ CARD8 ReqType; /* always X_ChangeDeviceProperty */
+ CARD16 length B16;
+ Atom property B32;
+ Atom type B32;
+ CARD8 deviceid;
+ CARD8 format;
+ CARD8 mode;
+ CARD8 pad;
+ CARD32 nUnits B32;
+} xChangeDevicePropertyReq;
+
+/*********************************************************
+ *
+ * DeleteDeviceProperty.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major opcode */
+ CARD8 ReqType; /* always X_DeleteDeviceProperty */
+ CARD16 length B16;
+ Atom property B32;
+ CARD8 deviceid;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+} xDeleteDevicePropertyReq;
+
+/*********************************************************
+ *
+ * GetDeviceProperty.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major opcode */
+ CARD8 ReqType; /* always X_GetDeviceProperty */
+ CARD16 length B16;
+ Atom property B32;
+ Atom type B32;
+ CARD32 longOffset B32;
+ CARD32 longLength B32;
+ CARD8 deviceid;
+#if defined(__cplusplus) || defined(c_plusplus)
+ BOOL c_delete;
+#else
+ BOOL delete;
+#endif
+ CARD16 pad;
+} xGetDevicePropertyReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceProperty */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom propertyType B32;
+ CARD32 bytesAfter B32;
+ CARD32 nItems B32;
+ CARD8 format;
+ CARD8 deviceid;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xGetDevicePropertyReply;
+
+
+/**********************************************************
+ *
+ * Input extension events.
+ *
+ * DeviceValuator
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ CARD8 deviceid;
+ CARD16 sequenceNumber B16;
+ KeyButMask device_state B16;
+ CARD8 num_valuators;
+ CARD8 first_valuator;
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ INT32 valuator3 B32;
+ INT32 valuator4 B32;
+ INT32 valuator5 B32;
+ } deviceValuator;
+
+/**********************************************************
+ *
+ * DeviceKeyButtonPointer.
+ *
+ * Used for: DeviceKeyPress, DeviceKeyRelease,
+ * DeviceButtonPress, DeviceButtonRelease,
+ * ProximityIn, ProximityOut
+ * DeviceMotionNotify,
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window root B32;
+ Window event B32;
+ Window child B32;
+ INT16 root_x B16;
+ INT16 root_y B16;
+ INT16 event_x B16;
+ INT16 event_y B16;
+ KeyButMask state B16;
+ BOOL same_screen;
+ CARD8 deviceid;
+ } deviceKeyButtonPointer;
+
+/**********************************************************
+ *
+ * DeviceFocus.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window window B32;
+ BYTE mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } deviceFocus;
+
+/**********************************************************
+ *
+ * DeviceStateNotify.
+ *
+ * Note that the two high-order bits in the classes_reported
+ * field are the proximity state (InProximity or OutOfProximity),
+ * and the device mode (Absolute or Relative), respectively.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 num_keys;
+ CARD8 num_buttons;
+ CARD8 num_valuators;
+ CARD8 classes_reported;
+ CARD8 buttons[4];
+ CARD8 keys[4];
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ } deviceStateNotify;
+
+/**********************************************************
+ *
+ * DeviceKeyStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 keys[28];
+ } deviceKeyStateNotify;
+
+/**********************************************************
+ *
+ * DeviceButtonStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 buttons[28];
+ } deviceButtonStateNotify;
+
+/**********************************************************
+ *
+ * DeviceMappingNotify.
+ * Fields must be kept in sync with core mappingnotify event.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 request;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+ Time time B32;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } deviceMappingNotify;
+
+/**********************************************************
+ *
+ * ChangeDeviceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 request;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } changeDeviceNotify;
+
+/**********************************************************
+ *
+ * devicePresenceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE pad00;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ BYTE devchange; /* Device{Added|Removed|Enabled|Disabled|ControlChanged} */
+ BYTE deviceid;
+ CARD16 control B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+ } devicePresenceNotify;
+
+
+/*********************************************************
+ * DevicePropertyNotifyEvent
+ *
+ * Sent whenever a device's property changes.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE state; /* NewValue or Deleted */
+ CARD16 sequenceNumber B16;
+ CARD32 time B32;
+ Atom atom B32; /* affected property */
+ CARD32 pad0 B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD16 pad5 B16;
+ CARD8 pad4;
+ CARD8 deviceid; /* id of device */
+ } devicePropertyNotify;
+
+#undef Window
+#undef Time
+#undef KeyCode
+#undef Mask
+#undef Atom
+#undef Cursor
+
+#endif
diff --git a/inputproto/XIproto.txt b/inputproto/XIproto.txt
new file mode 100644
index 0000000..20cc02a
--- /dev/null
+++ b/inputproto/XIproto.txt
@@ -0,0 +1,2542 @@
+ X11 Input Extension Protocol Specification
+ Version 1.0
+ X Consortium Standard
+ X Version 11, Release 6.8
+ Mark Patrick, Ardent Computer
+ George Sachs, Hewlett-Packard
+
+ Version 1.5
+ Peter Hutterer
+
+ Copyright © 1989, 1990, 1991 by Hewlett-Packard Company and
+ 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.
+
+ Copyright © 2008 by Peter Hutterer
+
+ 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.
+
+1. Input Extension Overview
+
+ This document defines an extension to the X11 protocol to
+ support input devices other than the core X keyboard and
+ pointer. An accompanying document defines a corresponding
+ extension to Xlib (similar extensions for languages other than
+ C are anticipated). This first section gives an overview of the
+ input extension. The next section defines the new protocol
+ requests defined by the extension. We conclude with a
+ description of the new input events generated by the additional
+ input devices.
+
+ This document only describes the behaviour of servers supporting
+ up to the X Input Extension 1.5. For servers supporting the X
+ Input Extensions 2.0, see XI2proto.txt. New clients are discouraged
+ from using this protocol specification. Instead, the use of XI 2.x
+ is recommended.
+
+1.1 Design Approach
+
+ The design approach of the extension is to define requests and
+ events analogous to the core requests and events. This allows
+ extension input devices to be individually distinguishable from
+ each other and from the core input devices. These requests 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 reportable via the core input events.
+
+1.2 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.
+
+ In servers supporting XI 1.4 and above, the core pointer and
+ the core keyboard are virtual devices that do not represent a
+ physical device connected to the host computer.
+ In servers supporting XI 2.0 and above, there may be multiple
+ core pointers and keyboards. Refer to XI2proto.txt for more
+ information.
+
+ 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.
+
+ In servers supporting only XI 1.x, 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.
+ Requests are defined that allow client programs to change which
+ physical devices are used as the core devices.
+
+1.3 Extension Input Devices
+
+ The input extension v1.x 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.
+
+ A client that wishes to access a specific device must first
+ determine whether that device is connected to the X server.
+ This is done through the ListInputDevices request, which will
+ return a list of all devices that can be opened by the X
+ server. A client can then open one or more of these devices
+ using the OpenDevice request, specify what events they are
+ interested in receiving, and receive and process input events
+ from extension devices in the same way as events from the X
+ keyboard and X pointer. Input events from these devices are of
+ extension types ( DeviceKeyPress, DeviceKeyRelease,
+ DeviceButtonPress, DeviceButtonRelease, DeviceMotionNotify,
+ etc.) and contain a device identifier so that events of the
+ same type coming from different input devices can be
+ distinguished.
+
+ Any kind of input device may be used as an extension input
+ device. Extension input devices may have 0 or more keys, 0 or
+ more buttons, and may report 0 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 classes. Server implementors
+ may add new classes of input devices without changing the
+ protocol requests. Input classes are unique numbers registered
+ with the X Consortium. Each extension input device may support
+ multiple input classes.
+
+ In XI 1.x, 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.
+
+ Most input events reported by the server to a client are of
+ fixed size (32 bytes). In order to represent the change in
+ state of an input device the extension may need to generate a
+ sequence of input events. A client side library (such as Xlib)
+ will typically take these raw input events and format them into
+ a form more convenient to the client.
+
+1.4 Event Classes
+
+ In the core protocol a client registers interest in receiving
+ certain input events directed to a window by modifying that
+ window's event-mask. Most of the bits in the event mask are
+ already used to specify interest in core X events. The input
+ extension specifies a different mechanism by which a client can
+ express interest in events generated by this extension.
+
+ When a client opens a extension input device via the OpenDevice
+ request, an XDevice structure is returned. Macros are provided
+ that extract 32-bit numbers called event classes from that
+ structure, that a client can use to register interest in
+ extension events via the SelectExtensionEvent request. The
+ event class combines the desired event type and device id, and
+ may be thought of as the equivalent of core event masks.
+
+1.5 Input 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 requests. 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 and reports focus events.
+
+ FEEDBACK
+ The device supports feedbacks.
+
+ OTHER
+ The ChangeDeviceNotify, DeviceMappingNotify, and
+ DeviceStateNotify macros may be invoked passing the
+ XDevice structure returned for this device.
+
+ Each extension input device may support multiple input classes.
+ Additional classes may be added in the future. Requests that
+ support multiple input classes, such as the ListInputDevices
+ function that lists all available input devices, organize the
+ data they return by input class. Client programs that use these
+ requests 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 requests to be recompiled.
+
+2. Requests
+
+ Extension input devices are accessed by client programs through
+ the use of new protocol requests. This section summarizes the
+ new requests defined by this extension. The syntax and type
+ definitions used below follow the notation used for the X11
+ core protocol.
+
+2.1 Getting the Extension Version
+
+ The GetExtensionVersion request returns version information
+ about the input extension.
+
+ GetExtensionVersion
+ name: STRING
+ =>
+ present: BOOL
+ protocol-major-version: CARD16
+ protocol-minor-version: CARD16
+
+ The protocol version numbers returned indicate the version of
+ the input extension supported by the target X server. The
+ version numbers can be compared to constants defined in the
+ header file XI.h. Each version is a superset of the previous
+ versions.
+
+ The name must be the name of the Input Extension as defined
+ in the header file XI.h.
+
+2.2 Listing Available Devices
+
+ A client that wishes to access a specific device must first
+ determine whether that device is connected to the X server.
+ This is done through the ListInputDevices request, which will
+ return a list of all devices that can be opened by the X
+ server.
+
+ ListInputDevices
+ =>
+ input-devices: ListOfDeviceInfo
+
+ where
+
+ DEVICEINFO:
+ [type: ATOM
+ id: CARD8
+ num_classes: CARD8
+ use: {IsXKeyboard, IsXPointer, IsXExtensionPointer,
+ IsXExtensionKeyboard, IsExtensionDevice}
+ info: LISTofINPUTINFO
+ name: STRING8]
+
+ INPUTINFO: {KEYINFO, BUTTONINFO, VALUATORINFO}
+ KEYINFO:
+ [class: CARD8
+ length: CARD8
+ min-keycode: KEYCODE
+ max-keycode: KEYCODE
+ num-keys: CARD16]
+ BUTTONINFO:
+ [class: CARD8
+ length: CARD8
+ num-buttons: CARD16]
+ VALUATORINFO:
+ [class: CARD8
+ length: CARD8
+ num_axes: CARD8
+ mode: SETofDEVICEMODE
+ motion_buffer_size: CARD32
+ axes: LISTofAXISINFO]
+
+ AXISINFO:
+ [resolution: CARD32
+ min-val: CARD32
+ max-val: CARD32]
+ DEVICEMODE: {Absolute, Relative}
+
+ Errors: None
+
+ This request returns a list of all devices that can be opened
+ by the X server, including the core X keyboard and X pointer.
+ Some implementations may open all input devices as part of X
+ initialization, while others may not open an input device until
+ requested to do so by a client program.
+
+ The information returned for each device is as follows:
+
+ type
+ The type field is of type Atom and indicates the nature
+ of the device. Clients may determine device types by
+ invoking the XInternAtom request passing one of the
+ names defined in the header file XI.h. The following
+ names have been defined to date:
+
+ MOUSE
+ TABLET
+ KEYBOARD
+ TOUCHSCREEN
+ TOUCHPAD
+ BUTTONBOX
+ BARCODE
+ KNOB_BOX
+ TRACKBALL
+ QUADRATURE
+ SPACEBALL
+ DATAGLOVE
+ EYETRACKER
+ CURSORKEYS
+ FOOTMOUSE
+ ID_MODULE
+ ONE_KNOB
+ NINE_KNOB
+ JOYSTICK
+
+
+ id
+ The id is a small cardinal value in the range 0-128 that
+ uniquely identifies the device. It is assigned to the
+ device when it is initialized by the server. Some
+ implementations may not open an input device until
+ requested by a client program, and may close the device
+ when the last client accessing it requests that it be
+ closed. If a device is opened by a client program via
+ XOpenDevice, then closed via XCloseDevice, then opened
+ again, it is not guaranteed to have the same id after
+ the second open request.
+
+ num_classes
+ The num_classes field is a small cardinal value 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.
+
+ use
+ The use field specifies how the device is currently
+ being used. If the value is IsXKeyboard, the device is
+ currently being used as the X keyboard. If the value is
+ IsXPointer, the device is currently being used as the X
+ pointer. If the value is IsXExtensionPointer, the device
+ is available for use as an extension pointer. If the value
+ is IsXExtensionKeyboard, the device is available for use as
+ and extension keyboard.
+ Older versions of XI report all extension devices as
+ IsXExtensionDevice.
+
+ name
+ The name field contains a pointer to a null-terminated
+ string that corresponds to one of the defined device
+ types.
+
+ InputInfo
+ InputInfo is one of: KeyInfo, ButtonInfo or
+ ValuatorInfo. The first two fields are common to all
+ three:
+
+ class
+ The class field is a cardinal value in the range
+ 0-255. It uniquely identifies the class of input
+ for which information is returned.
+
+ length
+ The length field is a cardinal value 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 remaining information returned for input class
+ KEYCLASS is as follows:
+
+ min_keycode
+ 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
+ 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
+ num_keys is a cardinal value that specifies the
+ number of keys that the device has.
+
+ The remaining information returned for input class
+ BUTTONCLASS is as follows:
+
+ num_buttons
+ num_buttons is a cardinal value that specifies the
+ number of buttons that the device has.
+
+ The remaining information returned for input class
+ VALUATORCLASS is as follows:
+
+ mode
+ 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
+ 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.
+
+ axes
+ The axes field contains a pointer to an AXISINFO
+ struture.
+
+ The information returned for each axis reported by the
+ device is:
+
+ resolution
+ The resolution is a cardinal value in
+ counts/meter.
+
+ min_val
+ The min_val field is a cardinal value in that
+ contains the minimum value the device reports for
+ this axis. For devices whose mode is Relative, the
+ min_val field will contain 0.
+
+ max_val
+ The max_val field is a cardinal value in that
+ contains the maximum value the device reports for
+ this axis. For devices whose mode is Relative, the
+ max_val field will contain 0.
+
+2.3 Enabling Devices
+
+ Client programs that wish to access an extension device must
+ request that the server open that device. This is done via the
+ OpenDevice request.
+
+ OpenDevice
+ id: CARD8
+ =>
+ DEVICE:
+ [device_id: XID
+ num_classes: INT32
+ classes: LISTofINPUTCLASSINFO]
+ INPUTCLASSINFO:
+ [input_class: CARD8
+ event_type_base: CARD8]
+
+ Errors: Device
+
+ This request returns the event classes to be used by the client
+ to indicate which events the client program wishes to receive.
+ Each input class may report several event classes. For example,
+ input class Keys reports DeviceKeyPress and DeviceKeyRelease
+ event classes. Input classes are unique numbers registered with
+ the X Consortium. Input class Other exists to report event
+ classes that are not specific to any one input class, such as
+ DeviceMappingNotify, ChangeDeviceNotify, and DeviceStateNotify.
+
+ The information returned for each device is as follows:
+
+ device_id
+ The device_id is a number that uniquely identifies the
+ device.
+
+ num_classes
+ The num_classes field contains the number of input
+ classes supported by this device.
+
+ For each class of input supported by the device, the
+ InputClassInfo structure contains the following information:
+
+ input_class
+ The input_class is a small cardinal number that
+ identifies the class of input.
+
+ event_type_base
+ The event_type_base is a small cardinal number that
+ specifies the event type of one of the events reported
+ by this input class. This information is not directly
+ used by client programs. Instead, the Device is used by
+ macros that return extension event types and event
+ classes. This is described in the section of this
+ document entitled "Selecting Extension Device Events".
+
+ The information in the InputClassInfo reflects the state of
+ this device at the time the request was processed.
+
+ Before it exits, the client program should explicitly request
+ that the server close the device. This is done via the
+ CloseDevice request.
+
+ 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 CloseDevice 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, the queued events
+ are released when the client terminates.
+
+ 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.
+
+ CloseDevice:
+ device: DEVICE
+
+ Errors: Device
+
+2.4 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 the SetDeviceMode request. The valid
+ values are Absolute or Relative.
+
+ This request will fail and return DeviceBusy if another client
+ already has the device open with a different mode. It will fail
+ and return AlreadyGrabbed if another client has the device
+ grabbed. The request will fail with a BadMatch error if the
+ requested mode is not supported by the device.
+
+ SetDeviceMode
+ device:DEVICE
+ mode: {Absolute, Relative}
+ =>
+ status: {Success, DeviceBusy, AlreadyGrabbed}
+
+ Errors: Device, Match, Mode
+
+2.5 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 the
+ SetDeviceValuators request.
+
+ SetDeviceValuators
+ device: DEVICE
+ first_valuator: CARD8
+ num_valuators: CARD8
+ valuators: LISTOFINT32
+ =>
+ status: {Success, AlreadyGrabbed}
+
+ Errors: Length, Device, Match, Value
+
+ This request 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. If the number of
+ valuators supported by the device is less than the expression
+ first_valuator + num_valuators, a Value error will result.
+
+ If the request succeeds, Success is returned. If the specifed
+ device is grabbed by some other client, the request will fail
+ and a status of AlreadyGrabbed will be returned.
+
+2.6 Getting Input Device Controls
+
+ GetDeviceControl
+ device: DEVICE
+ control: XID
+ =>
+ controlState: {DeviceState}
+
+ where
+
+ DeviceState: DeviceResolutionState
+
+ Errors: Length, Device, Match, Value
+
+ This request returns the current state of the specified device
+ control. The device control must be supported by the target
+ server and device or an error will result.
+
+ If the request is successful, a pointer to a generic
+ DeviceState structure will be returned. The information
+ returned varies according to the specified control and is
+ mapped by a structure appropriate for that control.
+
+ GetDeviceControl will fail with a BadValue error if the server
+ does not support the specified control. It will fail with a
+ BadMatch error if the device does not support the specified
+ control.
+
+ Supported device controls and the information returned for them
+ include:
+
+ DEVICE_RESOLUTION:
+ [control: CARD16
+ length: CARD16
+ num_valuators: CARD8
+ resolutions: LISTofCARD32
+ min_resolutions: LISTofCARD32
+ max_resolutions: LISTofCARD32]
+
+ This device control returns a list of valuators and the range
+ of valid resolutions allowed for each. Valuators are numbered
+ beginning with 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, XGetDeviceControl will fail
+ with a BadMatch error if the specified device has no valuators.
+
+ ChangeDeviceControl:
+ device: DEVICE
+ XID: controlId
+ control: DeviceControl
+
+ where
+
+ DeviceControl: DeviceResolutionControl
+ =>
+ status: {Success, DeviceBusy, AlreadyGrabbed}
+
+ Errors: Length, Device, Match, Value
+
+ ChangeDeviceControl changes the specifed device control
+ according to the values specified in the DeviceControl
+ structure. The device control must be supported by the target
+ server and device or an error will result.
+
+ The information passed with this request varies according to
+ the specified control and is mapped by a structure appropriate
+ for that control.
+
+ ChangeDeviceControl will fail with a BadValue error if the
+ server does not support the specified control. It will fail
+ with a BadMatch error if the server supports the specified
+ control, but the requested device does not. The request will
+ fail and return a status of DeviceBusy if another client
+ already has the device open with a device control state that
+ conflicts with the one specified in the request. It will fail
+ with a status of AlreadyGrabbed if some other client has
+ grabbed the specified device. If the request succeeds, Success
+ is returned. If it fails, the device control is left unchanged.
+
+ Supported device controls and the information specified for
+ them include:
+
+ DEVICE_RESOLUTION:
+ [control: CARD16
+ length: CARD16
+ first_valuator: CARD8
+ num_valuators: CARD8
+ resolutions: LISTofCARD32]
+
+ 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.
+ num_valuators specifies the number of valuators in the
+ resolutions list.
+
+ When this control is specified, XChangeDeviceControl will fail
+ 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) the request
+ will fail with a BadValue error. If the number of valuators
+ supported by the device is less than the expression
+ first_valuator + num_valuators, a BadValue error will result.
+
+ If the request fails for any reason, none of the valuator
+ resolutions will be changed.
+
+ ChangeDeviceControl causes the server to send a DevicePresence
+ event to interested clients.
+
+2.7 Selecting Extension Device Events
+
+ Extension input events are selected using the
+ SelectExtensionEvent request.
+
+ SelectExtensionEvent
+ interest: LISTofEVENTCLASS
+ window: WINDOW
+
+ Errors: Window, Class, Access
+
+ This request specifies to the server the events within the
+ specified window which are of interest to the client. As with
+ the core XSelectInput function, multiple clients can select
+ input on the same window.
+
+ XSelectExtensionEvent requires a list of event classes. An
+ event class is a 32-bit number that combines an event type and
+ device id, and is used to indicate which event a client wishes
+ to receive and from which device it wishes to receive it.
+ Macros are provided to obtain event classes from the data
+ returned by the XOpenDevice request. The names of these macros
+ correspond to the desired events, i.e. the DeviceKeyPress is
+ used to obtain the event class for DeviceKeyPress events. The
+ syntax of the macro invocation is:
+ DeviceKeyPress (device, event_type, event_class);
+ device: DEVICE
+ event_type: INT
+ event_class: INT
+
+ The value returned in event_type is the value that will be
+ contained in the event type field of the XDeviceKeyPressEvent
+ when it is received by the client. The value returned in
+ event_class is the value that should be passed in making an
+ XSelectExtensionEvent request to receive DeviceKeyPress events.
+
+ 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 event
+ class as well as the DeviceButtonPress event 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 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.
+
+ A client may also specify the DeviceOwnerGrabButton class. If
+ it has specified both the DeviceButtonPressGrab and the
+ DeviceOwnerGrabButton classes, implicit passive grabs will
+ activate with owner_events set to True. If only the
+ DeviceButtonPressGrab class is specified, implicit passive
+ grabs will activate with owner_events set to False.
+
+ The client may select DeviceMotion events only when a button is
+ down. It does this by specifying the event classes
+ Button1Motion through Button5Motion, or ButtonMotion. An input
+ device will only support as many button motion classes as it
+ has buttons.
+
+2.8 Determining Selected Events
+
+ To determine which extension events are currently selected from
+ a given window, use GetSelectedExtensionEvents.
+
+ GetSelectedExtensionEvents
+ window: WINDOW
+ =>
+ this-client: LISTofEVENTCLASS
+ all-clients: LISTofEVENTCLASS
+
+ Errors: Window
+
+ This request returns two lists specifying the events selected
+ on the specified window. One list gives the extension events
+ selected by this client from the specified window. The other
+ list gives the extension events selected by all clients from
+ the specified window. This information is equivalent to that
+ returned by your-event-mask and all-event-masks in a
+ GetWindowAttributes request.
+
+2.9 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 extension event propagation through
+ the use of the following two requests.
+
+ XChangeDeviceDontPropagateList adds an event to or deletes an
+ event from the do_not_propagate list of extension events for
+ the specified window. This list is maintained for the life of
+ the window, and is not altered if the client terminates.
+
+ ChangeDeviceDontPropagateList
+ window: WINDOW
+ eventclass: LISTofEVENTCLASS
+ mode: {AddToList, DeleteFromList}
+
+ Errors: Window, Class, Mode
+
+ This function modifies the list specifying the events that are
+ not propagated to the ancestors of the specified window. You
+ may use the modes AddToList or DeleteFromList.
+
+ GetDeviceDontPropagateList
+ window: WINDOW
+ Errors: Window
+ =>
+ dont-propagate-list: LISTofEVENTCLASS
+
+ This function returns a list specifying the events that are not
+ propagated to the ancestors of the specified window.
+
+2.10 Sending Extension Events
+
+ One client program may send an event to another via the
+ XSendExtensionEvent function.
+
+ 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.
+
+ XSendExtensionEvent returns zero if the conversion-to-wire
+ protocol failed, otherwise it returns nonzero.
+
+ SendExtensionEvent
+ device: DEVICE
+ destination: WINDOW
+ propagate: BOOL
+ eventclass: LISTofEVENTCLASS
+ event: XEVENT
+
+ Errors: Device, Value, Class, Window
+
+2.11 Getting Motion History
+
+ GetDeviceMotionEvents
+ device: DEVICE
+ start, stop: TIMESTAMP or CurrentTime
+ =>
+ nevents_return: CARD32
+ mode_return: {Absolute, Relative}
+ axis_count_return: CARD8
+ events: LISTofDEVICETIMECOORD
+
+ where
+
+ DEVICETIMECOORD:
+ [data: LISTofINT32
+ time: TIMESTAMP]
+
+ Errors: Device, Match
+
+ This request 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 data field of the DEVICETIMECOORD structure is a sequence
+ of data items. Each item is of type INT32, 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,
+ which 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 and minimum values for each
+ axis are reported by the ListInputDevices 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.
+
+2.12 Changing The Core Devices
+
+ These requests are provided to change which physical device is
+ used as the X pointer or X keyboard. These requests are
+ deprecated in servers supporting XI 1.4 and above, and will
+ always return a a BadDevice error.
+
+ Using these requests may change the characteristics of the core
+ devices. The new pointer device may have a different number of
+ buttons than the old one did, 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
+ indicies into that array. Changing the core devices could cause
+ such client programs to behave improperly or abnormally
+ terminate.
+
+ These requests change the X keyboard or X pointer device and
+ generate an ChangeDeviceNotify event and a MappingNotify event.
+ The ChangeDeviceNotify event is sent only to those clients that
+ have expressed an interest in receiving that event via the
+ XSelectExtensionEvent request. 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, or has not previously been opened via
+ OpenDevice. To change the X keyboard device, use the
+ ChangeKeyboardDevice request. The specified device must support
+ input class Keys (as reported in the ListInputDevices request)
+ or the request will fail with a BadMatch error. 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 CloseDevice
+ request to close the new core device will fail with a BadDevice
+ error.
+
+ The focus state of the new keyboard is the same as the focus
+ state of the old X keyboard. If the new keyboard was not
+ initialized with a FocusRec, one is added by the
+ ChangeKeyboardDevice request. The X keyboard is assumed to have
+ a KbdFeedbackClassRec. If the device was initialized without a
+ KbdFeedbackClassRec, one will be added by this request. The
+ KbdFeedbackClassRec will specify a null routine as the control
+ procedure and the bell procedure.
+
+ ChangeKeyboardDevice
+ device: DEVICE
+ Errors: Device, Match
+ =>
+ status: Success, AlreadyGrabbed, Frozen
+
+ To change the X pointer device, use the ChangePointerDevice
+ request. The specified device must support input class
+ Valuators (as reported in the ListInputDevices request) or the
+ request will fail with a BadMatch error. The valuators to be
+ used as the x- and y-axes of the pointer device must be
+ specified. Data from other valuators on the device will be
+ ignored.
+
+ The X pointer device does not contain a FocusRec. If the new
+ pointer was initialized with a FocusRec, it is freed by the
+ ChangePointerDevice request. The X pointer is assumed to have a
+ ButtonClassRec and a PtrFeedbackClassRec. If the device was
+ initialized without a ButtonClassRec or a PtrFeedbackClassRec,
+ one will be added by this request. The ButtonClassRec added
+ will have no buttons, and the PtrFeedbackClassRec will specify
+ a null routine as the control procedure.
+
+ 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.
+
+ 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
+ CloseDevice request to close the new core device will fail with
+ a BadDevice error.
+
+ ChangePointerDevice
+ device: DEVICE
+ xaxis: CARD8
+ yaxis: CARD8
+ =>
+ status: Success, AlreadyGrabbed, Frozen
+
+ Errors: Device, Match
+
+2.12 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.
+
+2.13 Extension Active Grabs
+
+ Active grabs of extension devices are supported via the
+ GrabDevice request in the same way that core devices are
+ grabbed using the core GrabKeyboard request, except that a
+ Device is passed as a function parameter. A list of events that
+ the client wishes to receive is also passed. The UngrabDevice
+ request allows a previous active grab for an extension device
+ to be released.
+
+ To grab an extension device, use the GrabDevice request. The
+ device must have previously been opened using the OpenDevice
+ request.
+
+ GrabDevice
+ device: DEVICE
+ grab-window: WINDOW
+ owner-events: BOOL
+ event-list: LISTofEVENTCLASS
+ this-device-mode: {Synchronous, Asynchronous}
+ other-device-mode: {Synchronous, Asynchronous}
+ time:TIMESTAMP or CurrentTime
+ =>
+ status: Success, AlreadyGrabbed, Frozen,
+ InvalidTime, NotViewable
+
+ Errors: Device, Window, Value
+
+ This request actively grabs control of the specified input
+ device. Further input events from this device are reported only
+ to the grabbing client. This request overrides any previous
+ active grab by this client for this device.
+
+ The event-list parameter is a pointer to a list of event
+ classes. These are used to indicate which events the client
+ wishes to receive while the device is grabbed. Only event
+ classes obtained from the grabbed device are valid.
+
+ If owner-events is False, input events generated from this
+ device are reported with respect to grab-window, and are only
+ reported if selected by being included in the 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 selected by being included in the event-list.
+ For either value of owner-events, unreported events are
+ discarded.
+
+ If this-device-mode is Asynchronous, device event processing
+ continues normally. If the device is currently frozen by this
+ client, then processing of device events is resumed. If
+ this-device-mode is Synchronous, the state of the grabbed
+ device (as seen by means of the protocol) appears to freeze,
+ and no further device events are generated by the server until
+ the grabbing client issues a releasing AllowDeviceEvents
+ request 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 other-device-mode is Asynchronous, event processing is
+ unaffected by activation of the grab. If other-device-mode is
+ Synchronous, the state of all input devices except the grabbed
+ one (as seen by means of the protocol) appears to freeze, and
+ no further events are generated by the server until the
+ grabbing client issues a releasing AllowDeviceEvents request or
+ until the device grab is released. Actual events are not lost
+ while the devices are frozen; they are simply queued for later
+ processing.
+
+ This request generates DeviceFocusIn and DeviceFocusOut events.
+
+ This request fails and returns:
+
+ AlreadyGrabbed
+ If the device is actively grabbed by some other client.
+
+ NotViewable
+ If grab-window is not viewable.
+
+ InvalidTime
+ If the specified time is earlier than the last-grab-time
+ for the specified device or later than the current X
+ server time. 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.
+
+ Frozen
+ If the device is frozen by an active grab of another
+ client.
+
+ 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.
+
+ To release a grab of an extension device, use UngrabDevice.
+
+ UngrabDevice
+ device: DEVICE
+ time: TIMESTAMP or CurrentTime
+
+ Errors: Device
+
+ This request releases the device if this client has it actively
+ grabbed (from either GrabDevice or GrabDeviceKey) and releases
+ any queued events. If any devices were frozen by the grab,
+ UngrabDevice thaws them. The request has no effect if the
+ specified time is earlier than the last-device-grab time or is
+ later than the current server time.
+
+ This request generates DeviceFocusIn and DeviceFocusOut events.
+
+ An UngrabDevice is performed automatically if the event window
+ for an active device grab becomes not viewable.
+
+2.14 Passively Grabbing A Key
+
+ Passive grabs of buttons and keys on extension devices are
+ supported via the GrabDeviceButton and GrabDeviceKey requests.
+ These passive grabs are released via the UngrabDeviceKey and
+ UngrabDeviceButton requests.
+
+ To passively grab a single key on an extension device, use
+ GrabDeviceKey. That device must have previously been opened
+ using the OpenDevice request.
+
+ GrabDeviceKey
+ device: DEVICE
+ keycode: KEYCODE or AnyKey
+ modifiers: SETofKEYMASK or AnyModifier
+ modifier-device: DEVICE or NULL
+ grab-window: WINDOW
+ owner-events: BOOL
+ event-list: LISTofEVENTCLASS
+ this-device-mode: {Synchronous, Asynchronous}
+ other-device-mode: {Synchronous, Asynchronous}
+
+ Errors: Device, Match, Access, Window, Value
+
+ This request is analogous to the core GrabKey request. It
+ 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 GrabDevice, 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
+ GrabDevice. The active grab is terminated automatically when
+ 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 ListInputDevices request. If
+ it is not within that range, GrabDeviceKey generates a Value
+ error.
+
+ NULL may be passed for the modifier_device. If the
+ modifier_device is NULL, the core X keyboard is used as the
+ modifier_device.
+
+ An Access error is generated if some other client has issued a
+ GrabDeviceKey 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 Access error and
+ no grabs are established if there is a conflicting grab for any
+ combination.
+
+ This request cannot be used to grab a key on the X keyboard
+ device. The core GrabKey request should be used for that
+ purpose.
+
+ To release a passive grab of a single key on an extension
+ device, use UngrabDeviceKey.
+
+ UngrabDeviceKey
+ device: DEVICE
+ keycode: KEYCODE or AnyKey
+ modifiers: SETofKEYMASK or AnyModifier
+ modifier-device: DEVICE or NULL
+ grab-window: WINDOW
+
+ Errors: Device, Match, Window, Value, Alloc
+
+ This request is analogous to the core UngrabKey request. It
+ releases the key combination on the specified window if it was
+ grabbed by this client. A modifier of AnyModifier is equivalent
+ to issuing the 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 keycodes.
+ This request has no effect on an active grab.
+
+ NULL may be passed for the modifier_device. If the
+ modifier_device is NULL, the core X keyboard is used as the
+ modifier_device.
+
+2.15 Passively Grabbing A Button
+
+ To establish a passive grab for a single button on an extension
+ device, use GrabDeviceButton.
+
+ GrabDeviceButton
+ device: DEVICE
+ button: BUTTON or AnyButton
+ modifiers: SETofKEYMASK or AnyModifier
+ modifier-device: DEVICE or NULL
+ grab-window: WINDOW
+ owner-events: BOOL
+ event-list: LISTofEVENTCLASS
+ this-device-mode: {Synchronous, Asynchr
+ onous}
+ other-device-mode: {Synchronous, Asynch
+ ronous}
+
+ Errors: Device, Match, Window, Access, Value
+
+ This request is analogous to the core GrabButton request. It
+ establishes an explicit passive grab for a button on an
+ extension input device. Since 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 OpenDevice
+ request.
+
+ The GrabDeviceButton request 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 the grab window contains the device,
+
+ •
+ 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 GrabDevice,
+ 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
+ GrabDevice. 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. It is not required that the specified button
+ be assigned to a physical button.
+
+ NULL may be passed for the modifier_device. If the
+ modifier_device is NULL, the core X keyboard is used as the
+ modifier_device.
+
+ An Access error is generated if some other client has issued a
+ GrabDeviceButton 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 Access
+ error and no grabs are established if there is a conflicting
+ grab for any combination. The request has no effect on an
+ active grab.
+
+ This request cannot be used to grab a button on the X pointer
+ device. The core GrabButton request should be used for that
+ purpose.
+
+ To release a passive grab of a button on an extension device,
+ use UngrabDeviceButton.
+
+ UngrabDeviceButton
+ device: DEVICE
+ button: BUTTON or AnyButton
+ modifiers: SETofKEYMASK or AnyModifier
+ modifier-device: DEVICE or NULL
+ grab-window: WINDOW
+
+ Errors: Device, Match, Window, Value, Alloc
+
+ This request is analogous to the core UngrabButton request. It
+ releases the passive button/key combination on the specified
+ window if it was grabbed by the client. A modifiers of
+ AnyModifier is equivalent to issuing the 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. This request has no effect on
+ an active grab. The device must have previously been opened
+ using the OpenDevice request otherwise a Device error will be
+ generated.
+
+ NULL may be passed for the modifier_device. If the
+ modifier_device is NULL, the core X keyboard is used as the
+ modifier_device.
+
+ This request cannot be used to ungrab a button on the X pointer
+ device. The core UngrabButton request should be used for that
+ purpose.
+
+2.16 Thawing A Device
+
+ To allow further events to be processed when a device has been
+ frozen, use AllowDeviceEvents.
+
+ AllowDeviceEvents
+ device: DEVICE
+ event-mode: {AsyncThisDevice, SyncThisD
+ evice, AsyncOtherDevices,
+ ReplayThisdevice, AsyncAll, or SyncAll}
+ time:TIMESTAMP or CurrentTime
+
+ Errors: Device, Value
+
+ The AllowDeviceEvents request releases some queued events if
+ the client has caused a device to freeze. The request has no
+ effect if the specified time is earlier than the last-grab time
+ of the most recent active grab for the client, 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:
+
+ * 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.
+
+ * If the specified device is frozen and actively grabbed
+ by the client, event processing for that device
+ continues normally until the next button or key 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.
+
+ * 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 (towards 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.
+
+ * 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.
+
+ * 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 (button event for the grabbed
+ device, key or motion event for the 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 only freeze each device once).
+
+ * 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.
+
+2.17 Controlling Device Focus
+
+ The current focus window for an extension input device can be
+ determined using the GetDeviceFocus request. Extension devices
+ are focused using the SetDeviceFocus request in the same way
+ that the keyboard is focused using the SetInputFocus request,
+ except that a device is specified as part of the request. 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 GetDeviceFocus.
+
+ GetDeviceFocus
+ device: DEVICE
+ =>
+ focus: WINDOW, PointerRoot, FollowKeyboard, or None
+ revert-to: Parent, PointerRoot, FollowKeyboard, or None
+ focus-time: TIMESTAMP
+
+ Errors: Device, Match
+
+ This request returns the current focus state, revert-to state,
+ and last-focus-time of an extension device.
+
+ To set the focus of an extension device, use SetDeviceFocus.
+
+ SetDeviceFocus
+ device: DEVICE
+ focus: WINDOW, PointerRoot, FollowKeyboard, or None
+ revert-to: Parent, PointerRoot, FollowKeyboard, or None
+ focus-time: TIMESTAMP
+
+ Errors: Device, Window, Value, Match
+
+ This request changes the focus for an extension input device
+ and the last-focus-change-time. The request 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, with
+ CurrentTime replaced by the current server time.
+
+ The action taken by the server when this request 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 a window ID is assigned to the focus argument, 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 you assign PointerRoot to the focus argument, 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 you assign FollowKeyboard to the focus argument, 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
+ of the request (else a Match error). If the focus window
+ later becomes not viewable, the X server evaluates the
+ revert-to argument to determine the new focus window.
+
+ * If you assign RevertToParent to the revert-to argument,
+ the focus reverts to the parent (or the closest viewable
+ ancestor), and the new revert-to value is taken to be
+ RevertToNone.
+
+ * If you assign RevertToPointerRoot,
+ RevertToFollowKeyboard, or RevertToNone to the revert-to
+ argument, 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.
+
+ This request causes the X server to generate DeviceFocusIn and
+ DeviceFocusOut events.
+
+2.18 Controlling Device Feedback
+
+ To get the settings of feedbacks on an extension device, use
+ GetFeedbackControl. This request provides functionality
+ equivalent to the core GetKeyboardControl and GetPointerControl
+ functions. It also provides a way to control displays
+ associated with an input device that are capable of displaying
+ an integer or string.
+
+ GetFeedbackControl
+ device: DEVICE
+ =>
+ num_feedbacks_return: CARD16
+ return_value: LISTofFEEDBACKSTATE
+
+ where
+
+ FEEDBACKSTATE: {KbdFeedbackState, PtrFeedbackState,
+ IntegerFeedbackState, StringFeedbackState,
+ BellFeedbackState, LedFeedbackState}
+
+ Feedbacks are reported by class. Those feedbacks that are
+ reported for the core keyboard device are in class KbdFeedback,
+ and are returned in the KbdFeedbackState structure. The members
+ of that structure are as follows:
+
+ CLASS Kbd:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ key_click_percent: CARD8
+ bell_percent: CARD8
+ bell_pitch: CARD16
+ bell_duration: CARD16
+ led_value: BITMASK
+ global_auto_repeat: {AutoRepeatModeOn, AutoRepeatModeOff}
+ auto_repeats: LISTofCARD8]
+
+ Those feedbacks that are equivalent to those reported for the
+ core pointer are in feedback class PtrFeedback and are reported
+ in the PtrFeedbackState structure. The members of that
+ structure are:
+
+ CLASS Ptr:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ accelNumerator: CARD16
+ accelDenominator: CARD16
+ threshold: CARD16]
+
+ Some input devices provide a means of displaying an integer.
+ Those devices will support feedback class IntegerFeedback,
+ which is reported in the IntegerFeedbackState structure. The
+ members of that structure are:
+
+ CLASS Integer:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ resolution: CARD32
+ min-val: INT32
+ max-val: INT32]
+
+ Some input devices provide a means of displaying a string.
+ Those devices will support feedback class StringFeedback, which
+ is reported in the StringFeedbackState structure. The members
+ of that structure are:
+
+ CLASS String:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ max_symbols: CARD16
+ num_keysyms_supported: CARD16
+ keysyms_supported: LISTofKEYSYM]
+
+ Some input devices contain a bell. Those devices will support
+ feedback class BellFeedback, which is reported in the
+ BellFeedbackState structure. The members of that structure are:
+
+ CLASS String:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ percent: CARD8
+ pitch: CARD16
+ duration: CARD16]
+
+ The percent sets the base volume for the bell between 0 (off)
+ and 100 (loud) inclusive, if possible. Setting to -1 restores
+ the default. Other negative values generate a Value error.
+
+ The pitch sets the pitch (specified in Hz) of the bell, if
+ possible. Setting to -1 restores the default. Other negative
+ values generate a Value error.
+
+ The duration sets the duration (specified in milliseconds) of
+ the bell, if possible. Setting to -1 restores the default.
+ Other negative values generate a Value error.
+
+ A bell generator connected with the console but not directly on
+ the device is treated as if it were part of the device. Some
+ input devices contain LEDs. Those devices will support feedback
+ class Led, which is reported in the LedFeedbackState structure.
+ The members of that structure are:
+
+ CLASS String:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ led_mask: BITMASK
+ led_value: BITMASK]
+
+ Each bit in led_mask indicates that the corresponding led is
+ supported by the feedback. At most 32 LEDs per feedback are
+ supported. No standard interpretation of LEDs is defined.
+
+ This function will fail with a BadMatch error if the device
+ specified in the request does not support feedbacks.
+
+ Errors: Device, Match
+
+ To change the settings of a feedback on an extension device,
+ use ChangeFeedbackControl.
+
+ ChangeFeedbackControl
+ device: DEVICE
+ feedbackid: CARD8
+ value-mask: BITMASK
+ value: FEEDBACKCONTROL
+ FEEDBACKCONTROL: {KBDFEEDBACKCONTROL,
+ PTRFEEDBACKCONTROL,
+ INTEGERFEEDBACKCONTROL,
+ STRINGFEEDBACKCONTROL,
+ BELLFEEDBACKCONTROL,
+ LEDFEEDBACKCONTROL}
+
+ Errors: Device, Match, Value
+
+ Feedback controls are grouped by class. Those feedbacks that
+ are equivalent to those supported by the core keyboard are
+ controlled by feedback class KbdFeedbackClass using the
+ KbdFeedbackControl structure. The members of that structure
+ are:
+
+ KBDFEEDBACKCTL
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ key_click_percent: INT8
+ bell_percent: INT8
+ bell_pitch: INT16
+ bell_duration: INT16
+ led_mask: INT32
+ led_value: INT32
+ key: KEYCODE
+ auto_repeat_mode: {AutoRepeatModeOn, AutoRepeatModeOff,
+ AutoRepeatModeDefault}]
+
+ The key_click_percent sets the volume for key clicks between 0
+ (off) and 100 (loud) inclusive, if possible. Setting to -1
+ restores the default. Other negative values generate a Value
+ error.
+
+ If both auto_repeat_mode and key are specified, then the
+ auto_repeat_mode of that key is changed, if possible. If only
+ auto_repeat_mode is specified, then the global auto-repeat mode
+ for the entire keyboard is changed, if possible, without
+ affecting the per-key settings. It is a Match error if a key is
+ specified without an auto_repeat_mode.
+
+ The order in which controls are verified and altered is
+ server-dependent. If an error is generated, a subset of the
+ controls may have been altered.
+
+ Those feedback controls equivalent to those of the core pointer
+ are controlled by feedback class PtrFeedbackClass using the
+ PtrFeedbackControl structure. The members of that structure are
+ as follows:
+
+ PTRFEEDBACKCTL:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ accelNumerator: INT16
+ accelDenominator: INT16
+ threshold: INT16]
+
+ The acceleration, expressed as a fraction, is a multiplier for
+ movement. For example, specifying 3/1 means the device moves
+ three times as fast as normal. The fraction may be rounded
+ arbitrarily by the X server. Acceleration only takes effect if
+ the device moves more than threshold pixels at once and only
+ applies to the amount beyond the value in the threshold
+ argument. Setting a value to -1 restores the default. The
+ values of the do-accel and do-threshold arguments must be
+ nonzero for the device values to be set. Otherwise, the
+ parameters will be unchanged. Negative values generate a Value
+ error, as does a zero value for the accel-denominator argument.
+
+ Some devices are capable of displaying an integer. This is done
+ using feedback class IntegerFeedbackClass using the
+ IntegerFeedbackControl structure. The members of that structure
+ are as follows:
+
+ INTEGERCTL:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ int_to_display: INT32]
+
+ Some devices are capable of displaying an string. This is done
+ using feedback class StringFeedbackClass using the
+ StringFeedbackCtl structure. The members of that structure are
+ as follows:
+
+ STRINGCTL:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ syms_to_display: LISTofKEYSYMS]
+
+ Some devices contain a bell. This is done using feedback class
+ BellFeedbackClass using the BellFeedbackControl structure. The
+ members of that structure are as follows:
+
+ BELLCTL:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ percent: INT8
+ pitch: INT16
+ duration: INT16]
+
+ Some devices contain leds. These can be turned on and off using
+ the LedFeedbackControl structure. The members of that structure
+ are as follows:
+
+ LEDCTL:
+ [class: CARD8
+ length: CARD16
+ feedback id: CARD8
+ led_mask: BITMASK
+ led_value: BITMASK]
+
+ Errors: Device, Match, Value
+
+2.20 Ringing a Bell on an Input Device
+
+ To ring a bell on an extension input device, use DeviceBell.
+
+ DeviceBell:
+ device: DEVICE
+ feedbackclass: CARD8
+ feedbackid: CARD8
+ percent: INT8
+
+ Errors: Device, Value
+
+ This request is analogous to the core Bell request. 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 Value
+ 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
+ ChangeFeedbackControl request.
+
+Controlling Device Encoding
+
+ To get the keyboard mapping of an extension device that has
+ keys, use GetDeviceKeyMapping.
+
+ GetDeviceKeyMapping
+ device: DEVICE
+ first-keycode: KEYCODE
+ count: CARD8
+ =>
+ keysyms-per-keycode: CARD8
+ keysyms: LISTofKEYSYM
+
+ Errors: Device, Match, Value
+
+ This request returns the symbols for the specified number of
+ keycodes for the specified extension device, starting with the
+ specified keycode. The first-keycode must be greater than or
+ equal to min-keycode as returned in the connection setup (else
+ a Value error), and
+
+ first-keycode + count - 1
+
+ must be less than or equal to max-keycode as returned in the
+ connection setup (else a Value error). The number of elements
+ in the keysyms list is
+
+ count * keysyms-per-keycode
+
+ and KEYSYM number N (counting from zero) for keycode K has an
+ index (counting from zero) of
+
+ (K - first-keycode) * keysyms-per-keycode + N
+
+ in keysyms. The keysyms-per-keycode 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.
+
+ If the specified device has not first been opened by this
+ client via OpenDevice, or if that device does not support input
+ class Keys, this request will fail with a Device error.
+
+ To change the keyboard mapping of an extension device that has
+ keys, use ChangeDeviceKeyMapping.
+
+ ChangeDeviceKeyMapping
+ device: DEVICE
+ first-keycode: KEYCODE
+ keysyms-per-keycode: CARD8
+ keysyms: LISTofKEYSYM
+ num_codes: CARD8
+
+ Errors: Device, Match, Value, Alloc
+
+ This request is analogous to the core ChangeKeyMapping request.
+ It defines the symbols for the specified number of keycodes for
+ the specified extension device. If the specified device has not
+ first been opened by this client via OpenDevice, or if that
+ device does not support input class Keys, this request will
+ fail with a Device error.
+
+ The number of elements in the keysyms list must be a multiple
+ of keysyms_per_keycode. Otherwise, ChangeDeviceKeyMapping
+ generates a Length 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
+ Value 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 Value
+ error:
+
+ first_keycode + (num_codes / keysyms_per_keycode) - 1
+
+ To obtain the keycodes that are used as modifiers on an
+ extension device that has keys, use GetDeviceModifierMapping.
+
+ GetDeviceModifierMapping
+ device: DEVICE
+ =>
+ keycodes-per-modifier: CARD8
+ keycodes: LISTofKEYCODE
+
+ Errors: Device, Match
+
+ This request is analogous to the core GetModifierMapping
+ request. This request returns the keycodes of the keys being
+ used as modifiers. The number of keycodes in the list is
+ 8*keycodes-per-modifier. The keycodes are divided into eight
+ sets, with each set containing keycodes-per-modifier elements.
+ The sets are assigned in order to the modifiers Shift, Lock,
+ Control, Mod1, Mod2, Mod3, Mod4, and Mod5. The
+ keycodes-per-modifier value is chosen arbitrarily by the
+ server; zeroes are used to fill in unused elements within each
+ set. If only zero values are given in a set, the use of the
+ corresponding modifier has been disabled. The order of keycodes
+ within each set is chosen arbitrarily by the server.
+
+ To set which keycodes that are to be used as modifiers for an
+ extension device, use SetDeviceModifierMapping.
+
+ SetDeviceModifierMapping
+ device: DEVICE
+ keycodes-per-modifier: CARD8
+ keycodes: LISTofKEYCODE
+ =>
+ status: {Success, Busy, Failed}
+
+ Errors: Device, Match, Value, Alloc
+
+ This request is analogous to the core SetModifierMapping
+ request. This request specifies the keycodes (if any) of the
+ keys to be used as modifiers. The number of keycodes in the
+ list must be 8*keycodes-per-modifier (else a Length error). The
+ keycodes are divided into eight sets, with the sets, with each
+ set containing keycodes-per-modifier elements. The sets are
+ assigned in order to the modifiers Shift, Lock, Control, Mod1,
+ Mod2, Mod3, Mod4, and Mod5. Only non-zero keycode values are
+ used within each set; zero values are ignored. All of the
+ non-zero keycodes must be in the range specified by min-keycode
+ and max-keycode in the ListInputDevices request (else a Value
+ error). The order of keycodes within a set does not matter. If
+ no non-zero values are specified in a set, the use of the
+ corresponding modifier is disabled, and the modifier bit will
+ always be zero. Otherwise, the modifier bit will be one
+ whenever at least one of the keys in the corresponding set is
+ in the down position.
+
+ A 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 keys per modifier are
+ not supported). The status reply is Failed if some such
+ restriction is violated, and none of the modifiers are changed.
+
+ If the new non-zero keycodes specified for a modifier differ
+ from those currently defined, and any (current or new) keys for
+ that modifier are logically in the down state, then the status
+ reply is Busy, and none of the modifiers are changed.
+
+ This request generates a DeviceMappingNotify event on a Success
+ status. The DeviceMappingNotify event will be sent only to
+ those clients that have expressed an interest in receiving that
+ event via the XSelectExtensionEvent request.
+
+ 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.
+
+2.20 Controlling Button Mapping
+
+ These requests are analogous to the core GetPointerMapping and
+ ChangePointerMapping requests. They allow a client to determine
+ the current mapping of buttons on an extension device, and to
+ change that mapping.
+
+ To get the current button mapping for an extension device, use
+ GetDeviceButtonMapping.
+
+ GetDeviceButtonMapping
+ device: DEVICE
+ nmap: CARD8
+ =>
+ map_return: LISTofCARD8
+
+ Errors: Device, Match
+
+ The GetDeviceButtonMapping function returns the current mapping
+ of the buttons on the specified device. Elements of the list
+ are indexed starting from one. The length of the list indicates
+ the number of physical buttons. The nominal mapping is the
+ identity mapping map[i]=i.
+
+ nmap indicates the number of elements in the map_return array.
+ Only the first nmap entries will be copied by the library into
+ the map_return array.
+
+ To set the button mapping for an extension device, use
+ SetDeviceButtonMapping.
+
+ SetDeviceButtonMapping
+ device: DEVICE
+ map: LISTofCARD8
+ nmap: CARD8
+ =>
+ status: CARD8
+
+ Errors: Device, Match, Value
+
+ The SetDeviceButtonMapping function sets the mapping of the
+ specified device and causes the X server to generate a
+ DeviceMappingNotify event on a status of MappingSuccess.
+ Elements of the list are indexed starting from one. The length
+ of the list, specified in nmap, must be the same as
+ GetDeviceButtonMapping would return. Otherwise,
+ SetDeviceButtonMapping generates a Value error. A zero element
+ disables a button, and elements are not restricted in value by
+ the number of physical buttons. If any of the buttons to be
+ altered are in the down state, the status reply is MappingBusy
+ and the mapping is not changed.
+
+ In servers supporting XI 1.x, no two elements can have the same
+ nonzero value. Otherwise, this function generates a Value
+ error.
+
+2.21 Obtaining The State Of A Device
+
+ To obtain vectors that describe the state of the keys, buttons
+ and valuators of an extension device, use QueryDeviceState.
+
+ QueryDeviceState
+ device: DEVICE
+ =>
+ device-id: CARD8
+ data: LISTofINPUTCLASS
+
+ where
+
+ INPUTCLASS: {VALUATOR, BUTTON, KEY}
+ CLASS VALUATOR:
+ [class: CARD8
+ num_valuators: CARD8
+ mode: CARD8
+ #x01 device mode (0 = Relative, 1 = Absolute)
+ #x02 proximity state (0 = InProximity, 1 = OutOfProximity)
+ valuators: LISTofINT32]
+ CLASS BUTTON:
+ [class: CARD8
+ num_buttons: CARD8
+ buttons: LISTofCARD8]
+ CLASS KEY:
+ [class: CARD8
+ num_keys: CARD8
+ keys: LISTofCARD8]
+
+ Errors: Device
+
+ The QueryDeviceState request returns the current logical state
+ of the buttons, keys, and valuators on the specified input
+ device. The buttons and keys arrays, byte N (from 0) contains
+ the bits for key or button 8N to 8N+7 with the least
+ significant bit in the byte representing key or button 8N.
+
+ If the device has valuators, a bit in the mode field indicates
+ whether the device is reporting Absolute or Relative data. If
+ it is reporting Absolute data, the valuators array will contain
+ the current value of the valuators. If it is reporting Relative
+ data, the valuators array will contain undefined data.
+
+ If the device reports proximity information, a bit in the mode
+ field indicates whether the device is InProximity or
+ OutOfProximity.
+
+2.22 Listing Device Properties
+
+ Introduced with XI 1.5
+
+ ListDeviceProperties
+ deviceid: CARD8
+ =>
+ nAtoms: CARD16
+ Atoms: LISTofATOM
+
+ Errors: Device
+
+ Each device can store an arbitrary number of properties. These
+ properties can be allocated by either the client or the driver.
+ The client can change device properties and the server
+ guarantees that the device driver is notified about a change of
+ the device's properties.
+
+ ListDeviceProperties returns all properties of a device. The
+ client is expected to retrieve details about the properties it
+ is interested in separately.
+
+2.23 Getting a Device Property
+
+ Introduced with XI 1.5
+
+ GetDeviceProperty:
+ property: ATOM
+ type: ATOM
+ longOffset: CARD32
+ longLength: CARD32
+ deviceid: CARD8
+ delete: BOOL
+ =>
+ propertyType: ATOM
+ bytesAfter: CARD32
+ nItems: CARD32
+ format: CARD8
+ deviceid: CARD8
+ data: [LISTofCARD8]
+
+ Errors: Atom, Device, Value, Access
+
+ Retrieve the value for a property. If the property does not
+ exist, propertyType is None and all other fields are undefined.
+
+ If type is not AnyPropertyType and does not match the
+ property's actual type, the propertyType, bytesAfter, and
+ format are returned but not the actual data.
+
+ longOffset and longLength specify the offset and length
+ respectively in 32-bit multiples of the data to retrieve.
+
+ If delete is True, the property is deleted after querying its
+ data. If the property cannot be deleted, a BadAccess error is
+ returned.
+
+ propertyType returns the atom identifier that defines the
+ actual type of the property.
+
+ If bytesAfter is non-zero, it specifies the number of data
+ 4-byte units after the retrieved chunk of data.
+
+ 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.
+
+ nItem specifies the number of 8-bit, 16-bit, or 32-bit items
+ returned after the request.
+
+2.24 Changing a Device Property
+
+ Introduced with XI 1.5
+
+ ChangeDeviceProperty:
+ property: ATOM
+ type: ATOM
+ deviceid: CARD8
+ format: CARD8
+ mode: CARD8
+ nUnits: CARD32
+
+ Errors: Atom, Device, Value, Match, Access
+
+ Changes the value of a specified property.
+
+ The type specifies the atom identifier that defines the type of
+ the property. If mode is not PropModeReplace, the type must
+ match the current type of the property or a BadMatch error is
+ returned.
+
+ 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 mode is PropModeReplace, a preexising value for this
+ property is replaced with the new value. If mode is
+ PropModePrepend or PropModeAppend, the value is prepended or
+ appended, respectively, to the current value of the property.
+
+ nUnits specifies the number of 8-bit, 16-bit, or 32-bit items
+ supplied after the reply.
+
+ Changing a device property results in a
+ DevicePropertyNotifyEvent being sent to all clients.
+
+2.25 Deleting a Device Property
+
+ Introduced with XI 1.5
+
+ DeleteDeviceProperty:
+ property: ATOM
+ deviceid: CARD8
+
+ Errors: Atom, Device, Match, Access.
+
+ Deletes the specified property. If the property cannot be
+ deleted by the client, a BadAccess error is returned.
+
+3. 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.
+
+3.1 Button, Key, and Motion Events
+
+ DeviceKeyPress
+ DeviceKeyRelease
+ DeviceButtonPress,
+ DeviceButtonRelease
+ DeviceMotionNotify
+ device: CARD8
+ root, event: WINDOW
+ child: Window or None
+ same-screen: BOOL
+ root-x, root-y, event-x, event-y: INT16
+ detail: <see below>
+ state: SETofKEYBUTMASK
+ time: TIMESTAMP
+
+ These events are generated when a key, button, or valuator
+ logically changes state. The generation of these logical
+ changes may lag the physical changes, if device event
+ processing is frozen. Note that DeviceKeyPress and
+ DeviceKeyRelease are generated for all keys, even those mapped
+ to modifier bits. The “source” of the event is the window the
+ pointer is in. The window with respect to which the event is
+ normally reported is found by looking up the hierarchy
+ (starting with the source window) for the first window on which
+ any client has selected interest in the event. The actual
+ window used for reporting can be modified by active grabs and
+ by the focus window.The window the event is reported with
+ respect to is called the “event” window.
+
+ The root is the root window of the “source” window, and root-x
+ and root-y are the pointer coordinates relative to root's
+ origin at the time of the event. Event is the “event” window.
+ If the event window is on the same screen as root, then event-x
+ and event-y are the pointer coordinates relative to the event
+ window's origin. Otherwise, event-x and event-y are zero. If
+ the source window is an inferior of the event window, then
+ child is set to the child of the event window that is an
+ ancestor of (or is) the source window. Otherwise, it is set to
+ None.
+
+ The state component gives the logical state of the buttons on
+ the X pointer and modifier keys on the core X keyboard just
+ before the event.
+
+ The detail component type varies with the event type:
+ Event Component
+ DeviceKeyPress KEYCODE
+ DeviceKeyRelease KEYCODE
+ DeviceButtonPress BUTTON
+ DeviceButtonRelease BUTTON
+ DeviceMotionNotify { Normal , Hint }
+
+ The granularity of motion events is not guaranteed, but a
+ client selecting for motion events is guaranteed to get at
+ least one event when a valuator changes. If DeviceMotionHint is
+ selected, the server is free to send only one
+ DeviceMotionNotify event (with detail Hint) to the client for
+ the event window, until either a key or button changes state,
+ the pointer leaves the event window, or the client issues a
+ QueryDeviceState or GetDeviceMotionEvents request.
+
+3.2 DeviceValuator Event
+
+ DeviceValuator
+ device: CARD8
+ device_state: SETofKEYBUTMASK
+ num_valuators: CARD8
+ first_valuator: CARD8
+ valuators: LISTofINT32
+
+ DeviceValuator events are generated to contain valuator
+ information for which there is insufficient space in DeviceKey,
+ DeviceButton, DeviceMotion, and Proximity wire events. For
+ events of these types, a second event of type DeviceValuator
+ follows immediately. The library combines these events into a
+ single event that a client can receive via XNextEvent.
+ DeviceValuator events are not selected for by clients, they
+ only exist to contain information that will not fit into some
+ event selected by clients.
+
+ The device_state component gives the state of the buttons and
+ modifiers on the device generating the event.
+
+ Extension motion devices may report motion data for a variable
+ number of axes. The valuators array contains the values of all
+ axes reported by the device. If more than 6 axes are reported,
+ more than one DeviceValuator event will be sent by the server,
+ and more than one DeviceKey, DeviceButton, DeviceMotion, or
+ Proximity event will be reported by the library. Clients should
+ examine the corresponding fields of the event reported by the
+ library to determine the total number of axes reported, and the
+ first axis reported in the current event. Axes are numbered
+ beginning with zero.
+
+ For Button, Key and Motion events on a device reporting
+ absolute motion data the current value of the device's
+ valuators is reported. For devices that report relative data,
+ Button and Key events may be followed by a DeviceValuator event
+ that contains 0s in the num_valuators field. In this case, only
+ the device_state component will have meaning.
+
+3.3 Device Focus Events
+
+ DeviceFocusIn
+ DeviceFocusOut
+ device: CARD8
+ time: TIMESTAMP
+ event: WINDOW
+ mode: { Normal, WhileGrabbed, Grab, Ungrab}
+ detail: { Ancestor, Virtual, Inferior, Nonlinear,
+ NonlinearVirtual, Pointer, PointerRoot, None}
+
+ These events are generated when the input focus changes and are
+ reported to clients selecting DeviceFocusChange for the
+ specified device and window. Events generated by SetDeviceFocus
+ when the device is not grabbed have mode Normal. Events
+ generated by SetDeviceFocus when the device is grabbed have
+ mode WhileGrabbed. Events generated when a device grab actives
+ have mode Grab, and events generated when a device grab
+ deactivates have mode Ungrab.
+
+ All DeviceFocusOut events caused by a window unmap are
+ generated after any UnmapNotify event, but the ordering of
+ DeviceFocusOut with respect to generated EnterNotify,
+ LeaveNotify, VisibilityNotify and Expose events is not
+ constrained.
+
+ DeviceFocusIn and DeviceFocusOut events are generated for focus
+ changes of extension devices in the same manner as focus events
+ for the core devices are generated.
+
+3.4 Device State Notify Event
+
+ DeviceStateNotify
+ time: TIMESTAMP
+ device: CARD8
+ num_keys: CARD8
+ num_buttons: CARD8
+ num_valuators: CARD8
+ classes_reported: CARD8 {SetOfDeviceMode | SetOfInputClass}
+ SetOfDeviceMode:
+ #x80 ProximityState 0 = InProxmity, 1 = OutOfProximity
+ #x40 Device Mode (0 = Relative, 1 = Absolute)
+ SetOfInputClass: #x04 reporting valuators
+ #x02 reporting buttons
+ #x01 reporting keys
+ buttons: LISTofCARD8
+ keys: LISTofCARD8
+ valuators: LISTofCARD32
+
+ This event reports the state of the device just as in the
+ QueryDeviceState request. This event is reported to clients
+ selecting DeviceStateNotify for the device and window and is
+ generated immediately after every EnterNotify and
+ DeviceFocusIn. If the device has no more than 32 buttons, no
+ more than 32 keys, and no more than 3 valuators, This event can
+ report the state of the device. If the device has more than 32
+ buttons, the event will be immediately followed by a
+ DeviceButtonStateNotify event. If the device has more than 32
+ keys, the event will be followed by a DeviceKeyStateNotify
+ event. If the device has more than 3 valuators, the event will
+ be followed by one or more DeviceValuator events.
+
+3.5 Device KeyState and ButtonState Notify Events
+
+ DeviceKeyStateNotify
+ device: CARD8
+ keys: LISTofCARD8
+ DeviceButtonStateNotify
+ device: CARD8
+ buttons: LISTofCARD8
+
+ These events contain information about the state of keys and
+ buttons on a device that will not fit into the
+ DeviceStateNotify wire event. These events are not selected by
+ clients, rather they may immediately follow a DeviceStateNotify
+ wire event and be combined with it into a single
+ DeviceStateNotify client event that a client may receive via
+ XNextEvent.
+
+3.6 DeviceMappingNotify Event
+
+ DeviceMappingNotify
+ time: TIMESTAMP
+ device: CARD8
+ request: CARD8
+ first_keycode: CARD8
+ count: CARD8
+
+ This event reports a change in the mapping of keys, modifiers,
+ or buttons on an extension device. This event is reported to
+ clients selecting DeviceMappingNotify for the device and window
+ and is generated after every client SetDeviceButtonMapping,
+ ChangeDeviceKeyMapping, or ChangeDeviceModifierMapping request.
+
+3.7 ChangeDeviceNotify Event
+
+ ChangeDeviceNotify
+ device: CARD8
+ time: TIMESTAMP
+ request: CARD8
+
+ This event reports a change in the physical device being used
+ as the core X keyboard or X pointer device. ChangeDeviceNotify
+ events are reported to clients selecting ChangeDeviceNotify for
+ the device and window and is generated after every client
+ ChangeKeyboardDevice or ChangePointerDevice request.
+
+3.7 Proximity Events
+
+ ProximityIn
+ ProximityOut
+ device: CARD8
+ root, event: WINDOW
+ child: Window or None
+ same-screen: BOOL
+ root-x, root-y, event-x, event-y: INT16
+ state: SETofKEYBUTMASK
+ time: TIMESTAMP
+ device-state: SETofKEYBUTMASK
+ axis-count: CARD8
+ first-axis: CARD8
+ axis-data: LISTofINT32
+
+ These events are generated by some devices (such as graphics
+ tablets or touchscreens) to indicate that a stylus has moved
+ into or out of contact with a positional sensing surface.
+
+ The “source” of the event is the window the pointer is in. The
+ window with respect to which the event is normally reported is
+ found by looking up the hierarchy (starting with the source
+ window) for the first window on which any client has selected
+ interest in the event. The actual window used for reporting can
+ be modified by active grabs and by the focus window.The window
+ the event is reported with respect to is called the “event”
+ window.
+
+ The root is the root window of the “source” window, and root-x
+ and root-y are the pointer coordinates relative to root's
+ origin at the time of the event. Event is the “event” window.
+ If the event window is on the same screen as root, then event-x
+ and event-y are the pointer coordinates relative to the event
+ window's origin. Otherwise, event-x and event-y are zero. If
+ the source window is an inferior of the event window, then
+ child is set to the child of the event window that is an
+ ancestor of (or is) the source window. Otherwise, it is set to
+ None. The state component gives the logical state of the
+ buttons on the core X pointer and modifier keys on the core X
+ keyboard just before the event. The device-state component
+ gives the state of the buttons and modifiers on the device
+ generating the event.
+
+3.8 DevicePresenceEvents
+
+ Introduced with XI 1.4.
+
+ DevicePresence
+ time: TIMESTAMP
+ devchange: BYTE
+ #x00: DeviceAdded
+ #x01: DeviceRemoved
+ #x02: DeviceEnabled
+ #x03: DeviceDisabled
+ #x04: DeviceUnrecoverable
+ #x05: DeviceControlChanged
+ deviceid: BYTE
+ control: CARD16
+
+ DevicePresence events are sent when the server adds or removes,
+ or enables or disables an input device. The client is expected
+ to query the server for the list of input devices using the
+ ListInputDevices request to obtain the updated list of input
+ devices. DevicePresence events are also sent when a control on
+ the device has been changed.
+
+ The devchange field specifies the type of operation. In case of
+ DeviceAdded, a new device has been added to the server, but
+ this device does not yet send events. If devchange is set to
+ DeviceEnabled, the device is enabled and will generate events.
+ If the field is DeviceDisabled or DeviceRemoved, the given
+ device is disabled and stops sending events or was removed from
+ the server, respectively. If the field is DeviceUnrecoverable,
+ an IO-error has occured on the device and the device is
+ forcibly disabled and removed by the server. If devchange is
+ DeviceControlChanged, control specifies the type of control
+ that has been changed.
+
+3.9 DevicePropertyNotifyEvent
+
+ Introduced with XI 1.5.
+
+ DevicePropertyNotifyEvent
+ deviceid: CARD8
+ state: CARD8
+ time: TIMESTAMP
+ atom: ATOM
+
+ A DevicePropertyNotifyEvent is sent to all clients when a
+ property on the device is created, deleted, or changes value.
+
+ The deviceid specifies the device which's property has been
+ modified.
+
+ The atom specifies the named identifier of the property that
+ has been altered.
+
+ If state is PropertyNewValue, the given property has a new
+ value or has been newly created. If state is PropertyDeleted,
+ the given property has been deleted.
diff --git a/inputproto/autogen.sh b/inputproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/inputproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/inputproto/configure.ac b/inputproto/configure.ac
new file mode 100644
index 0000000..7466dc3
--- /dev/null
+++ b/inputproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([InputProto], [2.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ inputproto.pc])
diff --git a/inputproto/inputproto.pc.in b/inputproto/inputproto.pc.in
new file mode 100644
index 0000000..c499cda
--- /dev/null
+++ b/inputproto/inputproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: InputProto
+Description: Input extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/kbproto/.gitignore b/kbproto/.gitignore
new file mode 100644
index 0000000..29b82f2
--- /dev/null
+++ b/kbproto/.gitignore
@@ -0,0 +1,78 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for kbproto
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/kbproto/COPYING b/kbproto/COPYING
new file mode 100644
index 0000000..6f12c2f
--- /dev/null
+++ b/kbproto/COPYING
@@ -0,0 +1,22 @@
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
diff --git a/kbproto/Makefile.am b/kbproto/Makefile.am
new file mode 100644
index 0000000..bbe8a1e
--- /dev/null
+++ b/kbproto/Makefile.am
@@ -0,0 +1,23 @@
+kbdir = $(includedir)/X11/extensions
+kb_HEADERS = \
+ XKBgeom.h \
+ XKB.h \
+ XKBproto.h \
+ XKBsrv.h \
+ XKBstr.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = kbproto.pc
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/kbproto/README b/kbproto/README
new file mode 100644
index 0000000..49fa4f9
--- /dev/null
+++ b/kbproto/README
@@ -0,0 +1,30 @@
+ X Keyboard Extension
+
+This extension defines a protcol to provide a number of new capabilities
+and controls for text keyboards.
+
+Extension name: XKEYBOARD
+
+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/proto/kbproto
+
+ http://cgit.freedesktop.org/xorg/proto/kbproto
+
+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/kbproto/XKB.h b/kbproto/XKB.h
new file mode 100644
index 0000000..a915317
--- /dev/null
+++ b/kbproto/XKB.h
@@ -0,0 +1,788 @@
+/* $Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKB.h,v 1.5tsi Exp $ */
+
+#ifndef _XKB_H_
+#define _XKB_H_
+
+ /*
+ * XKB request codes, used in:
+ * - xkbReqType field of all requests
+ * - requestMinor field of some events
+ */
+#define X_kbUseExtension 0
+#define X_kbSelectEvents 1
+#define X_kbBell 3
+#define X_kbGetState 4
+#define X_kbLatchLockState 5
+#define X_kbGetControls 6
+#define X_kbSetControls 7
+#define X_kbGetMap 8
+#define X_kbSetMap 9
+#define X_kbGetCompatMap 10
+#define X_kbSetCompatMap 11
+#define X_kbGetIndicatorState 12
+#define X_kbGetIndicatorMap 13
+#define X_kbSetIndicatorMap 14
+#define X_kbGetNamedIndicator 15
+#define X_kbSetNamedIndicator 16
+#define X_kbGetNames 17
+#define X_kbSetNames 18
+#define X_kbGetGeometry 19
+#define X_kbSetGeometry 20
+#define X_kbPerClientFlags 21
+#define X_kbListComponents 22
+#define X_kbGetKbdByName 23
+#define X_kbGetDeviceInfo 24
+#define X_kbSetDeviceInfo 25
+#define X_kbSetDebuggingFlags 101
+
+ /*
+ * In the X sense, XKB reports only one event.
+ * The type field of all XKB events is XkbEventCode
+ */
+#define XkbEventCode 0
+#define XkbNumberEvents (XkbEventCode+1)
+
+ /*
+ * XKB has a minor event code so it can use one X event code for
+ * multiple purposes.
+ * - reported in the xkbType field of all XKB events.
+ * - XkbSelectEventDetails: Indicates the event for which event details
+ * are being changed
+ */
+#define XkbNewKeyboardNotify 0
+#define XkbMapNotify 1
+#define XkbStateNotify 2
+#define XkbControlsNotify 3
+#define XkbIndicatorStateNotify 4
+#define XkbIndicatorMapNotify 5
+#define XkbNamesNotify 6
+#define XkbCompatMapNotify 7
+#define XkbBellNotify 8
+#define XkbActionMessage 9
+#define XkbAccessXNotify 10
+#define XkbExtensionDeviceNotify 11
+
+ /*
+ * Event Mask:
+ * - XkbSelectEvents: Specifies event interest.
+ */
+#define XkbNewKeyboardNotifyMask (1L << 0)
+#define XkbMapNotifyMask (1L << 1)
+#define XkbStateNotifyMask (1L << 2)
+#define XkbControlsNotifyMask (1L << 3)
+#define XkbIndicatorStateNotifyMask (1L << 4)
+#define XkbIndicatorMapNotifyMask (1L << 5)
+#define XkbNamesNotifyMask (1L << 6)
+#define XkbCompatMapNotifyMask (1L << 7)
+#define XkbBellNotifyMask (1L << 8)
+#define XkbActionMessageMask (1L << 9)
+#define XkbAccessXNotifyMask (1L << 10)
+#define XkbExtensionDeviceNotifyMask (1L << 11)
+#define XkbAllEventsMask (0xFFF)
+
+ /*
+ * NewKeyboardNotify event details:
+ */
+#define XkbNKN_KeycodesMask (1L << 0)
+#define XkbNKN_GeometryMask (1L << 1)
+#define XkbNKN_DeviceIDMask (1L << 2)
+#define XkbAllNewKeyboardEventsMask (0x7)
+
+ /*
+ * AccessXNotify event types:
+ * - The 'what' field of AccessXNotify events reports the
+ * reason that the event was generated.
+ */
+#define XkbAXN_SKPress 0
+#define XkbAXN_SKAccept 1
+#define XkbAXN_SKReject 2
+#define XkbAXN_SKRelease 3
+#define XkbAXN_BKAccept 4
+#define XkbAXN_BKReject 5
+#define XkbAXN_AXKWarning 6
+
+ /*
+ * AccessXNotify details:
+ * - Used as an event detail mask to limit the conditions under which
+ * AccessXNotify events are reported
+ */
+#define XkbAXN_SKPressMask (1L << 0)
+#define XkbAXN_SKAcceptMask (1L << 1)
+#define XkbAXN_SKRejectMask (1L << 2)
+#define XkbAXN_SKReleaseMask (1L << 3)
+#define XkbAXN_BKAcceptMask (1L << 4)
+#define XkbAXN_BKRejectMask (1L << 5)
+#define XkbAXN_AXKWarningMask (1L << 6)
+#define XkbAllAccessXEventsMask (0xf)
+
+ /*
+ * Miscellaneous event details:
+ * - event detail masks for assorted events that don't reall
+ * have any details.
+ */
+#define XkbAllStateEventsMask XkbAllStateComponentsMask
+#define XkbAllMapEventsMask XkbAllMapComponentsMask
+#define XkbAllControlEventsMask XkbAllControlsMask
+#define XkbAllIndicatorEventsMask XkbAllIndicatorsMask
+#define XkbAllNameEventsMask XkbAllNamesMask
+#define XkbAllCompatMapEventsMask XkbAllCompatMask
+#define XkbAllBellEventsMask (1L << 0)
+#define XkbAllActionMessagesMask (1L << 0)
+
+ /*
+ * XKB reports one error: BadKeyboard
+ * A further reason for the error is encoded into to most significant
+ * byte of the resourceID for the error:
+ * XkbErr_BadDevice - the device in question was not found
+ * XkbErr_BadClass - the device was found but it doesn't belong to
+ * the appropriate class.
+ * XkbErr_BadId - the device was found and belongs to the right
+ * class, but not feedback with a matching id was
+ * found.
+ * The low byte of the resourceID for this error contains the device
+ * id, class specifier or feedback id that failed.
+ */
+#define XkbKeyboard 0
+#define XkbNumberErrors 1
+
+#define XkbErr_BadDevice 0xff
+#define XkbErr_BadClass 0xfe
+#define XkbErr_BadId 0xfd
+
+ /*
+ * Keyboard Components Mask:
+ * - Specifies the components that follow a GetKeyboardByNameReply
+ */
+#define XkbClientMapMask (1L << 0)
+#define XkbServerMapMask (1L << 1)
+#define XkbCompatMapMask (1L << 2)
+#define XkbIndicatorMapMask (1L << 3)
+#define XkbNamesMask (1L << 4)
+#define XkbGeometryMask (1L << 5)
+#define XkbControlsMask (1L << 6)
+#define XkbAllComponentsMask (0x7f)
+
+ /*
+ * State detail mask:
+ * - The 'changed' field of StateNotify events reports which of
+ * the keyboard state components have changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which StateNotify events are reported.
+ */
+#define XkbModifierStateMask (1L << 0)
+#define XkbModifierBaseMask (1L << 1)
+#define XkbModifierLatchMask (1L << 2)
+#define XkbModifierLockMask (1L << 3)
+#define XkbGroupStateMask (1L << 4)
+#define XkbGroupBaseMask (1L << 5)
+#define XkbGroupLatchMask (1L << 6)
+#define XkbGroupLockMask (1L << 7)
+#define XkbCompatStateMask (1L << 8)
+#define XkbGrabModsMask (1L << 9)
+#define XkbCompatGrabModsMask (1L << 10)
+#define XkbLookupModsMask (1L << 11)
+#define XkbCompatLookupModsMask (1L << 12)
+#define XkbPointerButtonMask (1L << 13)
+#define XkbAllStateComponentsMask (0x3fff)
+
+ /*
+ * Controls detail masks:
+ * The controls specified in XkbAllControlsMask:
+ * - The 'changed' field of ControlsNotify events reports which of
+ * the keyboard controls have changed.
+ * - The 'changeControls' field of the SetControls request specifies
+ * the controls for which values are to be changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which ControlsNotify events are reported.
+ *
+ * The controls specified in the XkbAllBooleanCtrlsMask:
+ * - The 'enabledControls' field of ControlsNotify events reports the
+ * current status of the boolean controls.
+ * - The 'enabledControlsChanges' field of ControlsNotify events reports
+ * any boolean controls that have been turned on or off.
+ * - The 'affectEnabledControls' and 'enabledControls' fields of the
+ * kbSetControls request change the set of enabled controls.
+ * - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
+ * an XkbControlsRec specify the controls to be changed if the keyboard
+ * times out and the values to which they should be changed.
+ * - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags
+ * request specifies the specify the controls to be reset when the
+ * client exits and the values to which they should be reset.
+ * - The 'ctrls' field of an indicator map specifies the controls
+ * that drive the indicator.
+ * - Specifies the boolean controls affected by the SetControls and
+ * LockControls key actions.
+ */
+#define XkbRepeatKeysMask (1L << 0)
+#define XkbSlowKeysMask (1L << 1)
+#define XkbBounceKeysMask (1L << 2)
+#define XkbStickyKeysMask (1L << 3)
+#define XkbMouseKeysMask (1L << 4)
+#define XkbMouseKeysAccelMask (1L << 5)
+#define XkbAccessXKeysMask (1L << 6)
+#define XkbAccessXTimeoutMask (1L << 7)
+#define XkbAccessXFeedbackMask (1L << 8)
+#define XkbAudibleBellMask (1L << 9)
+#define XkbOverlay1Mask (1L << 10)
+#define XkbOverlay2Mask (1L << 11)
+#define XkbIgnoreGroupLockMask (1L << 12)
+#define XkbGroupsWrapMask (1L << 27)
+#define XkbInternalModsMask (1L << 28)
+#define XkbIgnoreLockModsMask (1L << 29)
+#define XkbPerKeyRepeatMask (1L << 30)
+#define XkbControlsEnabledMask (1L << 31)
+
+#define XkbAccessXOptionsMask (XkbStickyKeysMask|XkbAccessXFeedbackMask)
+
+#define XkbAllBooleanCtrlsMask (0x00001FFF)
+#define XkbAllControlsMask (0xF8001FFF)
+#define XkbAllControlEventsMask XkbAllControlsMask
+
+ /*
+ * AccessX Options Mask
+ * - The 'accessXOptions' field of an XkbControlsRec specifies the
+ * AccessX options that are currently in effect.
+ * - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
+ * fields of an XkbControlsRec specify the Access X options to be
+ * changed if the keyboard times out and the values to which they
+ * should be changed.
+ */
+#define XkbAX_SKPressFBMask (1L << 0)
+#define XkbAX_SKAcceptFBMask (1L << 1)
+#define XkbAX_FeatureFBMask (1L << 2)
+#define XkbAX_SlowWarnFBMask (1L << 3)
+#define XkbAX_IndicatorFBMask (1L << 4)
+#define XkbAX_StickyKeysFBMask (1L << 5)
+#define XkbAX_TwoKeysMask (1L << 6)
+#define XkbAX_LatchToLockMask (1L << 7)
+#define XkbAX_SKReleaseFBMask (1L << 8)
+#define XkbAX_SKRejectFBMask (1L << 9)
+#define XkbAX_BKRejectFBMask (1L << 10)
+#define XkbAX_DumbBellFBMask (1L << 11)
+#define XkbAX_FBOptionsMask (0xF3F)
+#define XkbAX_SKOptionsMask (0x0C0)
+#define XkbAX_AllOptionsMask (0xFFF)
+
+ /*
+ * XkbUseCoreKbd is used to specify the core keyboard without having
+ * to look up its X input extension identifier.
+ * XkbUseCorePtr is used to specify the core pointer without having
+ * to look up its X input extension identifier.
+ * XkbDfltXIClass is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * device class.
+ * XkbDfltXIId is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * feedback identifier.
+ * XkbAllXIClasses is used to get information about all device indicators,
+ * whether they're part of the indicator feedback class
+ * or the keyboard feedback class.
+ * XkbAllXIIds is used to get information about all device indicator
+ * feedbacks without having to list them.
+ * XkbXINone is used to indicate that no class or id has been specified.
+ * XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs
+ * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
+ * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
+ * XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class
+ * XkbExplicitXIId(c) True if 'i' explicitly specifies a device id
+ * XkbSingleXIClass(c) True if 'c' specifies exactly one device class,
+ * including the default.
+ * XkbSingleXIId(i) True if 'i' specifies exactly one device
+ * identifier, including the default.
+ */
+#define XkbUseCoreKbd 0x0100
+#define XkbUseCorePtr 0x0200
+#define XkbDfltXIClass 0x0300
+#define XkbDfltXIId 0x0400
+#define XkbAllXIClasses 0x0500
+#define XkbAllXIIds 0x0600
+#define XkbXINone 0xff00
+
+#define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==LedFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==BellFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIClass(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIId(c) (((c)&(~0xff))==0)
+#define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))
+#define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))
+
+#define XkbNoModifier 0xff
+#define XkbNoShiftLevel 0xff
+#define XkbNoShape 0xff
+#define XkbNoIndicator 0xff
+
+#define XkbNoModifierMask 0
+#define XkbAllModifiersMask 0xff
+#define XkbAllVirtualModsMask 0xffff
+
+#define XkbNumKbdGroups 4
+#define XkbMaxKbdGroup (XkbNumKbdGroups-1)
+
+#define XkbMaxMouseKeysBtn 4
+
+ /*
+ * Group Index and Mask:
+ * - Indices into the kt_index array of a key type.
+ * - Mask specifies types to be changed for XkbChangeTypesOfKey
+ */
+#define XkbGroup1Index 0
+#define XkbGroup2Index 1
+#define XkbGroup3Index 2
+#define XkbGroup4Index 3
+#define XkbAnyGroup 254
+#define XkbAllGroups 255
+
+#define XkbGroup1Mask (1<<0)
+#define XkbGroup2Mask (1<<1)
+#define XkbGroup3Mask (1<<2)
+#define XkbGroup4Mask (1<<3)
+#define XkbAnyGroupMask (1<<7)
+#define XkbAllGroupsMask (0xf)
+
+ /*
+ * BuildCoreState: Given a keyboard group and a modifier state,
+ * construct the value to be reported an event.
+ * GroupForCoreState: Given the state reported in an event,
+ * determine the keyboard group.
+ * IsLegalGroup: Returns TRUE if 'g' is a valid group index.
+ */
+#define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))
+#define XkbGroupForCoreState(s) (((s)>>13)&0x3)
+#define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups))
+
+ /*
+ * GroupsWrap values:
+ * - The 'groupsWrap' field of an XkbControlsRec specifies the
+ * treatment of out of range groups.
+ * - Bits 6 and 7 of the group info field of a key symbol map
+ * specify the interpretation of out of range groups for the
+ * corresponding key.
+ */
+#define XkbWrapIntoRange (0x00)
+#define XkbClampIntoRange (0x40)
+#define XkbRedirectIntoRange (0x80)
+
+ /*
+ * Action flags: Reported in the 'flags' field of most key actions.
+ * Interpretation depends on the type of the action; not all actions
+ * accept all flags.
+ *
+ * Option Used for Actions
+ * ------ ----------------
+ * ClearLocks SetMods, LatchMods, SetGroup, LatchGroup
+ * LatchToLock SetMods, LatchMods, SetGroup, LatchGroup
+ * LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * UseModMapMods SetMods, LatchMods, LockMods, ISOLock
+ * GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock
+ * UseDfltButton PtrBtn, LockPtrBtn
+ * NoAcceleration MovePtr
+ * MoveAbsoluteX MovePtr
+ * MoveAbsoluteY MovePtr
+ * ISODfltIsGroup ISOLock
+ * ISONoAffectMods ISOLock
+ * ISONoAffectGroup ISOLock
+ * ISONoAffectPtr ISOLock
+ * ISONoAffectCtrls ISOLock
+ * MessageOnPress ActionMessage
+ * MessageOnRelease ActionMessage
+ * MessageGenKeyEvent ActionMessage
+ * AffectDfltBtn SetPtrDflt
+ * DfltBtnAbsolute SetPtrDflt
+ * SwitchApplication SwitchScreen
+ * SwitchAbsolute SwitchScreen
+ */
+
+#define XkbSA_ClearLocks (1L << 0)
+#define XkbSA_LatchToLock (1L << 1)
+
+#define XkbSA_LockNoLock (1L << 0)
+#define XkbSA_LockNoUnlock (1L << 1)
+
+#define XkbSA_UseModMapMods (1L << 2)
+
+#define XkbSA_GroupAbsolute (1L << 2)
+#define XkbSA_UseDfltButton 0
+
+#define XkbSA_NoAcceleration (1L << 0)
+#define XkbSA_MoveAbsoluteX (1L << 1)
+#define XkbSA_MoveAbsoluteY (1L << 2)
+
+#define XkbSA_ISODfltIsGroup (1L << 7)
+#define XkbSA_ISONoAffectMods (1L << 6)
+#define XkbSA_ISONoAffectGroup (1L << 5)
+#define XkbSA_ISONoAffectPtr (1L << 4)
+#define XkbSA_ISONoAffectCtrls (1L << 3)
+#define XkbSA_ISOAffectMask (0x78)
+
+#define XkbSA_MessageOnPress (1L << 0)
+#define XkbSA_MessageOnRelease (1L << 1)
+#define XkbSA_MessageGenKeyEvent (1L << 2)
+
+#define XkbSA_AffectDfltBtn 1
+#define XkbSA_DfltBtnAbsolute (1L << 2)
+
+#define XkbSA_SwitchApplication (1L << 0)
+#define XkbSA_SwitchAbsolute (1L << 2)
+
+ /*
+ * The following values apply to the SA_DeviceValuator
+ * action only. Valuator operations specify the action
+ * to be taken. Values specified in the action are
+ * multiplied by 2^scale before they are applied.
+ */
+#define XkbSA_IgnoreVal (0x00)
+#define XkbSA_SetValMin (0x10)
+#define XkbSA_SetValCenter (0x20)
+#define XkbSA_SetValMax (0x30)
+#define XkbSA_SetValRelative (0x40)
+#define XkbSA_SetValAbsolute (0x50)
+#define XkbSA_ValOpMask (0x70)
+#define XkbSA_ValScaleMask (0x07)
+#define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask)
+#define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask)
+
+ /*
+ * Action types: specifies the type of a key action. Reported in the
+ * type field of all key actions.
+ */
+#define XkbSA_NoAction 0x00
+#define XkbSA_SetMods 0x01
+#define XkbSA_LatchMods 0x02
+#define XkbSA_LockMods 0x03
+#define XkbSA_SetGroup 0x04
+#define XkbSA_LatchGroup 0x05
+#define XkbSA_LockGroup 0x06
+#define XkbSA_MovePtr 0x07
+#define XkbSA_PtrBtn 0x08
+#define XkbSA_LockPtrBtn 0x09
+#define XkbSA_SetPtrDflt 0x0a
+#define XkbSA_ISOLock 0x0b
+#define XkbSA_Terminate 0x0c
+#define XkbSA_SwitchScreen 0x0d
+#define XkbSA_SetControls 0x0e
+#define XkbSA_LockControls 0x0f
+#define XkbSA_ActionMessage 0x10
+#define XkbSA_RedirectKey 0x11
+#define XkbSA_DeviceBtn 0x12
+#define XkbSA_LockDeviceBtn 0x13
+#define XkbSA_DeviceValuator 0x14
+#define XkbSA_LastAction XkbSA_DeviceValuator
+#define XkbSA_NumActions (XkbSA_LastAction+1)
+
+#define XkbSA_XFree86Private 0x86
+
+ /*
+ * Specifies the key actions that clear latched groups or modifiers.
+ */
+#define XkbSA_BreakLatch \
+ ((1<<XkbSA_NoAction)|(1<<XkbSA_PtrBtn)|(1<<XkbSA_LockPtrBtn)|\
+ (1<<XkbSA_Terminate)|(1<<XkbSA_SwitchScreen)|(1<<XkbSA_SetControls)|\
+ (1<<XkbSA_LockControls)|(1<<XkbSA_ActionMessage)|\
+ (1<<XkbSA_RedirectKey)|(1<<XkbSA_DeviceBtn)|(1<<XkbSA_LockDeviceBtn))
+
+ /*
+ * Macros to classify key actions
+ */
+#define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods))
+#define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup))
+#define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt))
+
+
+ /*
+ * Key Behavior Qualifier:
+ * KB_Permanent indicates that the behavior describes an unalterable
+ * characteristic of the keyboard, not an XKB software-simulation of
+ * the listed behavior.
+ * Key Behavior Types:
+ * Specifies the behavior of the underlying key.
+ */
+#define XkbKB_Permanent 0x80
+#define XkbKB_OpMask 0x7f
+
+#define XkbKB_Default 0x00
+#define XkbKB_Lock 0x01
+#define XkbKB_RadioGroup 0x02
+#define XkbKB_Overlay1 0x03
+#define XkbKB_Overlay2 0x04
+
+#define XkbKB_RGAllowNone 0x80
+
+ /*
+ * Various macros which describe the range of legal keycodes.
+ */
+#define XkbMinLegalKeyCode 8
+#define XkbMaxLegalKeyCode 255
+#define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1)
+#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
+/* Seems kinda silly to check that an unsigned char is <= 255... */
+#define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode)
+
+ /*
+ * Assorted constants and limits.
+ */
+#define XkbNumModifiers 8
+#define XkbNumVirtualMods 16
+#define XkbNumIndicators 32
+#define XkbAllIndicatorsMask (0xffffffff)
+#define XkbMaxRadioGroups 32
+#define XkbAllRadioGroupsMask (0xffffffff)
+#define XkbMaxShiftLevel 63
+#define XkbMaxSymsPerKey (XkbMaxShiftLevel*XkbNumKbdGroups)
+#define XkbRGMaxMembers 12
+#define XkbActionMessageLength 6
+#define XkbKeyNameLength 4
+#define XkbMaxRedirectCount 8
+
+#define XkbGeomPtsPerMM 10
+#define XkbGeomMaxColors 32
+#define XkbGeomMaxLabelColors 3
+#define XkbGeomMaxPriority 255
+
+ /*
+ * Key Type index and mask for the four standard key types.
+ */
+#define XkbOneLevelIndex 0
+#define XkbTwoLevelIndex 1
+#define XkbAlphabeticIndex 2
+#define XkbKeypadIndex 3
+#define XkbLastRequiredType XkbKeypadIndex
+#define XkbNumRequiredTypes (XkbLastRequiredType+1)
+#define XkbMaxKeyTypes 255
+
+#define XkbOneLevelMask (1<<0)
+#define XkbTwoLevelMask (1<<1)
+#define XkbAlphabeticMask (1<<2)
+#define XkbKeypadMask (1<<3)
+#define XkbAllRequiredTypes (0xf)
+
+#define XkbShiftLevel(n) ((n)-1)
+#define XkbShiftLevelMask(n) (1<<((n)-1))
+
+ /*
+ * Extension name and version information
+ */
+#define XkbName "XKEYBOARD"
+#define XkbMajorVersion 1
+#define XkbMinorVersion 0
+
+ /*
+ * Explicit map components:
+ * - Used in the 'explicit' field of an XkbServerMap. Specifies
+ * the keyboard components that should _not_ be updated automatically
+ * in response to core protocol keyboard mapping requests.
+ */
+#define XkbExplicitKeyTypesMask (0x0f)
+#define XkbExplicitKeyType1Mask (1<<0)
+#define XkbExplicitKeyType2Mask (1<<1)
+#define XkbExplicitKeyType3Mask (1<<2)
+#define XkbExplicitKeyType4Mask (1<<3)
+#define XkbExplicitInterpretMask (1<<4)
+#define XkbExplicitAutoRepeatMask (1<<5)
+#define XkbExplicitBehaviorMask (1<<6)
+#define XkbExplicitVModMapMask (1<<7)
+#define XkbAllExplicitMask (0xff)
+
+ /*
+ * Map components masks:
+ * Those in AllMapComponentsMask:
+ * - Specifies the individual fields to be loaded or changed for the
+ * GetMap and SetMap requests.
+ * Those in ClientInfoMask:
+ * - Specifies the components to be allocated by XkbAllocClientMap.
+ * Those in ServerInfoMask:
+ * - Specifies the components to be allocated by XkbAllocServerMap.
+ */
+#define XkbKeyTypesMask (1<<0)
+#define XkbKeySymsMask (1<<1)
+#define XkbModifierMapMask (1<<2)
+#define XkbExplicitComponentsMask (1<<3)
+#define XkbKeyActionsMask (1<<4)
+#define XkbKeyBehaviorsMask (1<<5)
+#define XkbVirtualModsMask (1<<6)
+#define XkbVirtualModMapMask (1<<7)
+
+#define XkbAllClientInfoMask (XkbKeyTypesMask|XkbKeySymsMask|XkbModifierMapMask)
+#define XkbAllServerInfoMask (XkbExplicitComponentsMask|XkbKeyActionsMask|XkbKeyBehaviorsMask|XkbVirtualModsMask|XkbVirtualModMapMask)
+#define XkbAllMapComponentsMask (XkbAllClientInfoMask|XkbAllServerInfoMask)
+
+ /*
+ * Symbol interpretations flags:
+ * - Used in the flags field of a symbol interpretation
+ */
+#define XkbSI_AutoRepeat (1<<0)
+#define XkbSI_LockingKey (1<<1)
+
+ /*
+ * Symbol interpretations match specification:
+ * - Used in the match field of a symbol interpretation to specify
+ * the conditions under which an interpretation is used.
+ */
+#define XkbSI_LevelOneOnly (0x80)
+#define XkbSI_OpMask (0x7f)
+#define XkbSI_NoneOf (0)
+#define XkbSI_AnyOfOrNone (1)
+#define XkbSI_AnyOf (2)
+#define XkbSI_AllOf (3)
+#define XkbSI_Exactly (4)
+
+ /*
+ * Indicator map flags:
+ * - Used in the flags field of an indicator map to indicate the
+ * conditions under which and indicator can be changed and the
+ * effects of changing the indicator.
+ */
+#define XkbIM_NoExplicit (1L << 7)
+#define XkbIM_NoAutomatic (1L << 6)
+#define XkbIM_LEDDrivesKB (1L << 5)
+
+ /*
+ * Indicator map component specifications:
+ * - Used by the 'which_groups' and 'which_mods' fields of an indicator
+ * map to specify which keyboard components should be used to drive
+ * the indicator.
+ */
+#define XkbIM_UseBase (1L << 0)
+#define XkbIM_UseLatched (1L << 1)
+#define XkbIM_UseLocked (1L << 2)
+#define XkbIM_UseEffective (1L << 3)
+#define XkbIM_UseCompat (1L << 4)
+
+#define XkbIM_UseNone 0
+#define XkbIM_UseAnyGroup (XkbIM_UseBase|XkbIM_UseLatched|XkbIM_UseLocked\
+ |XkbIM_UseEffective)
+#define XkbIM_UseAnyMods (XkbIM_UseAnyGroup|XkbIM_UseCompat)
+
+ /*
+ * Compatibility Map Compontents:
+ * - Specifies the components to be allocated in XkbAllocCompatMap.
+ */
+#define XkbSymInterpMask (1<<0)
+#define XkbGroupCompatMask (1<<1)
+#define XkbAllCompatMask (0x3)
+
+ /*
+ * Names component mask:
+ * - Specifies the names to be loaded or changed for the GetNames and
+ * SetNames requests.
+ * - Specifies the names that have changed in a NamesNotify event.
+ * - Specifies the names components to be allocated by XkbAllocNames.
+ */
+#define XkbKeycodesNameMask (1<<0)
+#define XkbGeometryNameMask (1<<1)
+#define XkbSymbolsNameMask (1<<2)
+#define XkbPhysSymbolsNameMask (1<<3)
+#define XkbTypesNameMask (1<<4)
+#define XkbCompatNameMask (1<<5)
+#define XkbKeyTypeNamesMask (1<<6)
+#define XkbKTLevelNamesMask (1<<7)
+#define XkbIndicatorNamesMask (1<<8)
+#define XkbKeyNamesMask (1<<9)
+#define XkbKeyAliasesMask (1<<10)
+#define XkbVirtualModNamesMask (1<<11)
+#define XkbGroupNamesMask (1<<12)
+#define XkbRGNamesMask (1<<13)
+#define XkbComponentNamesMask (0x3f)
+#define XkbAllNamesMask (0x3fff)
+
+ /*
+ * GetByName components:
+ * - Specifies desired or necessary components to GetKbdByName request.
+ * - Reports the components that were found in a GetKbdByNameReply
+ */
+#define XkbGBN_TypesMask (1L << 0)
+#define XkbGBN_CompatMapMask (1L << 1)
+#define XkbGBN_ClientSymbolsMask (1L << 2)
+#define XkbGBN_ServerSymbolsMask (1L << 3)
+#define XkbGBN_SymbolsMask (XkbGBN_ClientSymbolsMask|XkbGBN_ServerSymbolsMask)
+#define XkbGBN_IndicatorMapMask (1L << 4)
+#define XkbGBN_KeyNamesMask (1L << 5)
+#define XkbGBN_GeometryMask (1L << 6)
+#define XkbGBN_OtherNamesMask (1L << 7)
+#define XkbGBN_AllComponentsMask (0xff)
+
+ /*
+ * ListComponents flags
+ */
+#define XkbLC_Hidden (1L << 0)
+#define XkbLC_Default (1L << 1)
+#define XkbLC_Partial (1L << 2)
+
+#define XkbLC_AlphanumericKeys (1L << 8)
+#define XkbLC_ModifierKeys (1L << 9)
+#define XkbLC_KeypadKeys (1L << 10)
+#define XkbLC_FunctionKeys (1L << 11)
+#define XkbLC_AlternateGroup (1L << 12)
+
+ /*
+ * X Input Extension Interactions
+ * - Specifies the possible interactions between XKB and the X input
+ * extension
+ * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
+ * XKB information about an extension device.
+ * - Reports the list of supported optional features in the reply to
+ * XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
+ * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
+ * events to indicate an attempt to use an unsupported feature.
+ */
+#define XkbXI_KeyboardsMask (1L << 0)
+#define XkbXI_ButtonActionsMask (1L << 1)
+#define XkbXI_IndicatorNamesMask (1L << 2)
+#define XkbXI_IndicatorMapsMask (1L << 3)
+#define XkbXI_IndicatorStateMask (1L << 4)
+#define XkbXI_UnsupportedFeatureMask (1L << 15)
+#define XkbXI_AllFeaturesMask (0x001f)
+#define XkbXI_AllDeviceFeaturesMask (0x001e)
+
+#define XkbXI_IndicatorsMask (0x001c)
+#define XkbAllExtensionDeviceEventsMask (0x801f)
+
+ /*
+ * Per-Client Flags:
+ * - Specifies flags to be changed by the PerClientFlags request.
+ */
+#define XkbPCF_DetectableAutoRepeatMask (1L << 0)
+#define XkbPCF_GrabsUseXKBStateMask (1L << 1)
+#define XkbPCF_AutoResetControlsMask (1L << 2)
+#define XkbPCF_LookupStateWhenGrabbed (1L << 3)
+#define XkbPCF_SendEventUsesXKBState (1L << 4)
+#define XkbPCF_AllFlagsMask (0x1F)
+
+ /*
+ * Debugging flags and controls
+ */
+#define XkbDF_DisableLocks (1<<0)
+
+#endif /* _XKB_H_ */
diff --git a/kbproto/XKBgeom.h b/kbproto/XKBgeom.h
new file mode 100644
index 0000000..89f902f
--- /dev/null
+++ b/kbproto/XKBgeom.h
@@ -0,0 +1,659 @@
+/* $Xorg: XKBgeom.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $ */
+
+#ifndef _XKBGEOM_H_
+#define _XKBGEOM_H_
+
+#include <X11/extensions/XKBstr.h>
+
+#ifdef XKB_IN_SERVER
+#define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias
+#define XkbAddGeomColor SrvXkbAddGeomColor
+#define XkbAddGeomDoodad SrvXkbAddGeomDoodad
+#define XkbAddGeomKey SrvXkbAddGeomKey
+#define XkbAddGeomOutline SrvXkbAddGeomOutline
+#define XkbAddGeomOverlay SrvXkbAddGeomOverlay
+#define XkbAddGeomOverlayRow SrvXkbAddGeomOverlayRow
+#define XkbAddGeomOverlayKey SrvXkbAddGeomOverlayKey
+#define XkbAddGeomProperty SrvXkbAddGeomProperty
+#define XkbAddGeomRow SrvXkbAddGeomRow
+#define XkbAddGeomSection SrvXkbAddGeomSection
+#define XkbAddGeomShape SrvXkbAddGeomShape
+#define XkbAllocGeomKeyAliases SrvXkbAllocGeomKeyAliases
+#define XkbAllocGeomColors SrvXkbAllocGeomColors
+#define XkbAllocGeomDoodads SrvXkbAllocGeomDoodads
+#define XkbAllocGeomKeys SrvXkbAllocGeomKeys
+#define XkbAllocGeomOutlines SrvXkbAllocGeomOutlines
+#define XkbAllocGeomPoints SrvXkbAllocGeomPoints
+#define XkbAllocGeomProps SrvXkbAllocGeomProps
+#define XkbAllocGeomRows SrvXkbAllocGeomRows
+#define XkbAllocGeomSectionDoodads SrvXkbAllocGeomSectionDoodads
+#define XkbAllocGeomSections SrvXkbAllocGeomSections
+#define XkbAllocGeomOverlays SrvXkbAllocGeomOverlays
+#define XkbAllocGeomOverlayRows SrvXkbAllocGeomOverlayRows
+#define XkbAllocGeomOverlayKeys SrvXkbAllocGeomOverlayKeys
+#define XkbAllocGeomShapes SrvXkbAllocGeomShapes
+#define XkbAllocGeometry SrvXkbAllocGeometry
+#define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases
+#define XkbFreeGeomColors SrvXkbFreeGeomColors
+#define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads
+#define XkbFreeGeomProperties SrvXkbFreeGeomProperties
+#define XkbFreeGeomOverlayKeys SrvXkbFreeGeomOverlayKeys
+#define XkbFreeGeomOverlayRows SrvXkbFreeGeomOverlayRows
+#define XkbFreeGeomOverlays SrvXkbFreeGeomOverlays
+#define XkbFreeGeomKeys SrvXkbFreeGeomKeys
+#define XkbFreeGeomRows SrvXkbFreeGeomRows
+#define XkbFreeGeomSections SrvXkbFreeGeomSections
+#define XkbFreeGeomPoints SrvXkbFreeGeomPoints
+#define XkbFreeGeomOutlines SrvXkbFreeGeomOutlines
+#define XkbFreeGeomShapes SrvXkbFreeGeomShapes
+#define XkbFreeGeometry SrvXkbFreeGeometry
+#endif
+
+typedef struct _XkbProperty {
+ char *name;
+ char *value;
+} XkbPropertyRec,*XkbPropertyPtr;
+
+typedef struct _XkbColor {
+ unsigned int pixel;
+ char * spec;
+} XkbColorRec,*XkbColorPtr;
+
+typedef struct _XkbPoint {
+ short x;
+ short y;
+} XkbPointRec, *XkbPointPtr;
+
+typedef struct _XkbBounds {
+ short x1,y1;
+ short x2,y2;
+} XkbBoundsRec, *XkbBoundsPtr;
+#define XkbBoundsWidth(b) (((b)->x2)-((b)->x1))
+#define XkbBoundsHeight(b) (((b)->y2)-((b)->y1))
+
+typedef struct _XkbOutline {
+ unsigned short num_points;
+ unsigned short sz_points;
+ unsigned short corner_radius;
+ XkbPointPtr points;
+} XkbOutlineRec, *XkbOutlinePtr;
+
+typedef struct _XkbShape {
+ Atom name;
+ unsigned short num_outlines;
+ unsigned short sz_outlines;
+ XkbOutlinePtr outlines;
+ XkbOutlinePtr approx;
+ XkbOutlinePtr primary;
+ XkbBoundsRec bounds;
+} XkbShapeRec, *XkbShapePtr;
+#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))
+
+typedef struct _XkbShapeDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short color_ndx;
+ unsigned short shape_ndx;
+} XkbShapeDoodadRec, *XkbShapeDoodadPtr;
+#define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbTextDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ short width;
+ short height;
+ unsigned short color_ndx;
+ char * text;
+ char * font;
+} XkbTextDoodadRec, *XkbTextDoodadPtr;
+#define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbIndicatorDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short shape_ndx;
+ unsigned short on_color_ndx;
+ unsigned short off_color_ndx;
+} XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr;
+#define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
+#define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
+#define XkbSetIndicatorDoodadOnColor(g,d,c) \
+ ((d)->on_color_ndx= (c)-&(g)->colors[0])
+#define XkbSetIndicatorDoodadOffColor(g,d,c) \
+ ((d)->off_color_ndx= (c)-&(g)->colors[0])
+#define XkbSetIndicatorDoodadShape(g,d,s) \
+ ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbLogoDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+ unsigned short color_ndx;
+ unsigned short shape_ndx;
+ char * logo_name;
+} XkbLogoDoodadRec, *XkbLogoDoodadPtr;
+#define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
+#define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
+#define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
+#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
+
+typedef struct _XkbAnyDoodad {
+ Atom name;
+ unsigned char type;
+ unsigned char priority;
+ short top;
+ short left;
+ short angle;
+} XkbAnyDoodadRec, *XkbAnyDoodadPtr;
+
+typedef union _XkbDoodad {
+ XkbAnyDoodadRec any;
+ XkbShapeDoodadRec shape;
+ XkbTextDoodadRec text;
+ XkbIndicatorDoodadRec indicator;
+ XkbLogoDoodadRec logo;
+} XkbDoodadRec, *XkbDoodadPtr;
+
+#define XkbUnknownDoodad 0
+#define XkbOutlineDoodad 1
+#define XkbSolidDoodad 2
+#define XkbTextDoodad 3
+#define XkbIndicatorDoodad 4
+#define XkbLogoDoodad 5
+
+typedef struct _XkbKey {
+ XkbKeyNameRec name;
+ short gap;
+ unsigned char shape_ndx;
+ unsigned char color_ndx;
+} XkbKeyRec, *XkbKeyPtr;
+#define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
+#define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
+#define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
+#define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
+
+typedef struct _XkbRow {
+ short top;
+ short left;
+ unsigned short num_keys;
+ unsigned short sz_keys;
+ int vertical;
+ XkbKeyPtr keys;
+ XkbBoundsRec bounds;
+} XkbRowRec, *XkbRowPtr;
+
+typedef struct _XkbSection {
+ Atom name;
+ unsigned char priority;
+ short top;
+ short left;
+ unsigned short width;
+ unsigned short height;
+ short angle;
+ unsigned short num_rows;
+ unsigned short num_doodads;
+ unsigned short num_overlays;
+ unsigned short sz_rows;
+ unsigned short sz_doodads;
+ unsigned short sz_overlays;
+ XkbRowPtr rows;
+ XkbDoodadPtr doodads;
+ XkbBoundsRec bounds;
+ struct _XkbOverlay *overlays;
+} XkbSectionRec, *XkbSectionPtr;
+
+typedef struct _XkbOverlayKey {
+ XkbKeyNameRec over;
+ XkbKeyNameRec under;
+} XkbOverlayKeyRec,*XkbOverlayKeyPtr;
+
+typedef struct _XkbOverlayRow {
+ unsigned short row_under;
+ unsigned short num_keys;
+ unsigned short sz_keys;
+ XkbOverlayKeyPtr keys;
+} XkbOverlayRowRec,*XkbOverlayRowPtr;
+
+typedef struct _XkbOverlay {
+ Atom name;
+ XkbSectionPtr section_under;
+ unsigned short num_rows;
+ unsigned short sz_rows;
+ XkbOverlayRowPtr rows;
+ XkbBoundsPtr bounds;
+} XkbOverlayRec,*XkbOverlayPtr;
+
+typedef struct _XkbGeometry {
+ Atom name;
+ unsigned short width_mm;
+ unsigned short height_mm;
+ char * label_font;
+ XkbColorPtr label_color;
+ XkbColorPtr base_color;
+ unsigned short sz_properties;
+ unsigned short sz_colors;
+ unsigned short sz_shapes;
+ unsigned short sz_sections;
+ unsigned short sz_doodads;
+ unsigned short sz_key_aliases;
+ unsigned short num_properties;
+ unsigned short num_colors;
+ unsigned short num_shapes;
+ unsigned short num_sections;
+ unsigned short num_doodads;
+ unsigned short num_key_aliases;
+ XkbPropertyPtr properties;
+ XkbColorPtr colors;
+ XkbShapePtr shapes;
+ XkbSectionPtr sections;
+ XkbDoodadPtr doodads;
+ XkbKeyAliasPtr key_aliases;
+} XkbGeometryRec;
+#define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
+
+#define XkbGeomPropertiesMask (1<<0)
+#define XkbGeomColorsMask (1<<1)
+#define XkbGeomShapesMask (1<<2)
+#define XkbGeomSectionsMask (1<<3)
+#define XkbGeomDoodadsMask (1<<4)
+#define XkbGeomKeyAliasesMask (1<<5)
+#define XkbGeomAllMask (0x3f)
+
+typedef struct _XkbGeometrySizes {
+ unsigned int which;
+ unsigned short num_properties;
+ unsigned short num_colors;
+ unsigned short num_shapes;
+ unsigned short num_sections;
+ unsigned short num_doodads;
+ unsigned short num_key_aliases;
+} XkbGeometrySizesRec,*XkbGeometrySizesPtr;
+
+_XFUNCPROTOBEGIN
+
+extern XkbPropertyPtr
+XkbAddGeomProperty(
+ XkbGeometryPtr /* geom */,
+ char * /* name */,
+ char * /* value */
+);
+
+extern XkbKeyAliasPtr
+XkbAddGeomKeyAlias(
+ XkbGeometryPtr /* geom */,
+ char * /* alias */,
+ char * /* real */
+);
+
+extern XkbColorPtr
+XkbAddGeomColor(
+ XkbGeometryPtr /* geom */,
+ char * /* spec */,
+ unsigned int /* pixel */
+);
+
+extern XkbOutlinePtr
+XkbAddGeomOutline(
+ XkbShapePtr /* shape */,
+ int /* sz_points */
+);
+
+extern XkbShapePtr
+XkbAddGeomShape(
+ XkbGeometryPtr /* geom */,
+ Atom /* name */,
+ int /* sz_outlines */
+);
+
+extern XkbKeyPtr
+XkbAddGeomKey(
+ XkbRowPtr /* row */
+);
+
+extern XkbRowPtr
+XkbAddGeomRow(
+ XkbSectionPtr /* section */,
+ int /* sz_keys */
+);
+
+extern XkbSectionPtr
+XkbAddGeomSection(
+ XkbGeometryPtr /* geom */,
+ Atom /* name */,
+ int /* sz_rows */,
+ int /* sz_doodads */,
+ int /* sz_overlays */
+);
+
+extern XkbOverlayPtr
+XkbAddGeomOverlay(
+ XkbSectionPtr /* section */,
+ Atom /* name */,
+ int /* sz_rows */
+);
+
+extern XkbOverlayRowPtr
+XkbAddGeomOverlayRow(
+ XkbOverlayPtr /* overlay */,
+ int /* row_under */,
+ int /* sz_keys */
+);
+
+extern XkbOverlayKeyPtr
+XkbAddGeomOverlayKey(
+ XkbOverlayPtr /* overlay */,
+ XkbOverlayRowPtr /* row */,
+ char * /* over */,
+ char * /* under */
+);
+
+extern XkbDoodadPtr
+XkbAddGeomDoodad(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */,
+ Atom /* name */
+);
+
+
+extern void
+XkbFreeGeomKeyAliases(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomColors(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomDoodads(
+ XkbDoodadPtr /* doodads */,
+ int /* nDoodads */,
+ Bool /* freeAll */
+);
+
+
+extern void
+XkbFreeGeomProperties(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlayKeys(
+ XkbOverlayRowPtr /* row */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlayRows(
+ XkbOverlayPtr /* overlay */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOverlays(
+ XkbSectionPtr /* section */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomKeys(
+ XkbRowPtr /* row */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomRows(
+ XkbSectionPtr /* section */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomSections(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+
+extern void
+XkbFreeGeomPoints(
+ XkbOutlinePtr /* outline */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomOutlines(
+ XkbShapePtr /* shape */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeomShapes(
+ XkbGeometryPtr /* geom */,
+ int /* first */,
+ int /* count */,
+ Bool /* freeAll */
+);
+
+extern void
+XkbFreeGeometry(
+ XkbGeometryPtr /* geom */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status
+XkbAllocGeomProps(
+ XkbGeometryPtr /* geom */,
+ int /* nProps */
+);
+
+extern Status
+XkbAllocGeomKeyAliases(
+ XkbGeometryPtr /* geom */,
+ int /* nAliases */
+);
+
+extern Status
+XkbAllocGeomColors(
+ XkbGeometryPtr /* geom */,
+ int /* nColors */
+);
+
+extern Status
+XkbAllocGeomShapes(
+ XkbGeometryPtr /* geom */,
+ int /* nShapes */
+);
+
+extern Status
+XkbAllocGeomSections(
+ XkbGeometryPtr /* geom */,
+ int /* nSections */
+);
+
+extern Status
+XkbAllocGeomOverlays(
+ XkbSectionPtr /* section */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomOverlayRows(
+ XkbOverlayPtr /* overlay */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomOverlayKeys(
+ XkbOverlayRowPtr /* row */,
+ int /* num_needed */
+);
+
+extern Status
+XkbAllocGeomDoodads(
+ XkbGeometryPtr /* geom */,
+ int /* nDoodads */
+);
+
+extern Status
+XkbAllocGeomSectionDoodads(
+ XkbSectionPtr /* section */,
+ int /* nDoodads */
+);
+
+extern Status
+XkbAllocGeomOutlines(
+ XkbShapePtr /* shape */,
+ int /* nOL */
+);
+
+extern Status
+XkbAllocGeomRows(
+ XkbSectionPtr /* section */,
+ int /* nRows */
+);
+
+extern Status
+XkbAllocGeomPoints(
+ XkbOutlinePtr /* ol */,
+ int /* nPts */
+);
+
+extern Status
+XkbAllocGeomKeys(
+ XkbRowPtr /* row */,
+ int /* nKeys */
+);
+
+extern Status
+XkbAllocGeometry(
+ XkbDescPtr /* xkb */,
+ XkbGeometrySizesPtr /* sizes */
+);
+
+extern Status
+XkbSetGeometry(
+ Display * /* dpy */,
+ unsigned /* deviceSpec */,
+ XkbGeometryPtr /* geom */
+);
+
+extern Bool
+XkbComputeShapeTop(
+ XkbShapePtr /* shape */,
+ XkbBoundsPtr /* bounds */
+);
+
+extern Bool
+XkbComputeShapeBounds(
+ XkbShapePtr /* shape */
+);
+
+extern Bool
+XkbComputeRowBounds(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */,
+ XkbRowPtr /* row */
+);
+
+extern Bool
+XkbComputeSectionBounds(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* section */
+);
+
+extern char *
+XkbFindOverlayForKey(
+ XkbGeometryPtr /* geom */,
+ XkbSectionPtr /* wanted */,
+ char * /* under */
+);
+
+extern Status
+XkbGetGeometry(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status
+XkbGetNamedGeometry(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ Atom /* name */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XKBSTR_H_ */
diff --git a/kbproto/XKBproto.h b/kbproto/XKBproto.h
new file mode 100644
index 0000000..97dd4d2
--- /dev/null
+++ b/kbproto/XKBproto.h
@@ -0,0 +1,1282 @@
+/* $Xorg: XKBproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
+
+********************************************************/
+
+#ifndef _XKBPROTO_H_
+#define _XKBPROTO_H_
+
+#include <X11/Xmd.h>
+#include <X11/extensions/XKB.h>
+
+#define Window CARD32
+#define Atom CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define XkbPaddedSize(n) ((((unsigned int)(n)+3) >> 2) << 2)
+
+typedef struct _xkbUseExtension {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBUseExtension */
+ CARD16 length B16;
+ CARD16 wantedMajor B16;
+ CARD16 wantedMinor B16;
+} xkbUseExtensionReq;
+#define sz_xkbUseExtensionReq 8
+
+typedef struct _xkbUseExtensionReply {
+ BYTE type; /* X_Reply */
+ BOOL supported;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 serverMajor B16;
+ CARD16 serverMinor B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbUseExtensionReply;
+#define sz_xkbUseExtensionReply 32
+
+typedef struct _xkbSelectEvents {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBSelectEvents */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 affectWhich B16;
+ CARD16 clear B16;
+ CARD16 selectAll B16;
+ CARD16 affectMap B16;
+ CARD16 map B16;
+} xkbSelectEventsReq;
+#define sz_xkbSelectEventsReq 16
+
+typedef struct _xkbBell {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBBell */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 bellClass B16;
+ CARD16 bellID B16;
+ INT8 percent;
+ BOOL forceSound;
+ BOOL eventOnly;
+ CARD8 pad1;
+ INT16 pitch B16;
+ INT16 duration B16;
+ CARD16 pad2 B16;
+ Atom name B32;
+ Window window B32;
+} xkbBellReq;
+#define sz_xkbBellReq 28
+
+typedef struct _xkbGetState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+} xkbGetStateReq;
+#define sz_xkbGetStateReq 8
+
+typedef struct _xkbGetStateReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 mods;
+ CARD8 baseMods;
+ CARD8 latchedMods;
+ CARD8 lockedMods;
+ CARD8 group;
+ CARD8 lockedGroup;
+ INT16 baseGroup B16;
+ INT16 latchedGroup B16;
+ CARD8 compatState;
+ CARD8 grabMods;
+ CARD8 compatGrabMods;
+ CARD8 lookupMods;
+ CARD8 compatLookupMods;
+ CARD8 pad1;
+ CARD16 ptrBtnState B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+} xkbGetStateReply;
+#define sz_xkbGetStateReply 32
+
+typedef struct _xkbLatchLockState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBLatchLockState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 affectModLocks;
+ CARD8 modLocks;
+ BOOL lockGroup;
+ CARD8 groupLock;
+ CARD8 affectModLatches;
+ CARD8 modLatches;
+ CARD8 pad;
+ BOOL latchGroup;
+ INT16 groupLatch B16;
+} xkbLatchLockStateReq;
+#define sz_xkbLatchLockStateReq 16
+
+typedef struct _xkbGetControls {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetControls */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+} xkbGetControlsReq;
+#define sz_xkbGetControlsReq 8
+
+typedef struct _xkbGetControlsReply {
+ BYTE type; /* X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 mkDfltBtn;
+ CARD8 numGroups;
+ CARD8 groupsWrap;
+ CARD8 internalMods;
+ CARD8 ignoreLockMods;
+ CARD8 internalRealMods;
+ CARD8 ignoreLockRealMods;
+ CARD8 pad1;
+ CARD16 internalVMods B16;
+ CARD16 ignoreLockVMods B16;
+ CARD16 repeatDelay B16;
+ CARD16 repeatInterval B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD16 mkDelay B16;
+ CARD16 mkInterval B16;
+ CARD16 mkTimeToMax B16;
+ CARD16 mkMaxSpeed B16;
+ INT16 mkCurve B16;
+ CARD16 axOptions B16;
+ CARD16 axTimeout B16;
+ CARD16 axtOptsMask B16;
+ CARD16 axtOptsValues B16;
+ CARD16 pad2 B16;
+ CARD32 axtCtrlsMask B32;
+ CARD32 axtCtrlsValues B32;
+ CARD32 enabledCtrls B32;
+ BYTE perKeyRepeat[XkbPerKeyBitArraySize];
+} xkbGetControlsReply;
+#define sz_xkbGetControlsReply 92
+
+typedef struct _xkbSetControls {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetControls */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 affectInternalMods;
+ CARD8 internalMods;
+ CARD8 affectIgnoreLockMods;
+ CARD8 ignoreLockMods;
+ CARD16 affectInternalVMods B16;
+ CARD16 internalVMods B16;
+ CARD16 affectIgnoreLockVMods B16;
+ CARD16 ignoreLockVMods B16;
+ CARD8 mkDfltBtn;
+ CARD8 groupsWrap;
+ CARD16 axOptions B16;
+ CARD16 pad1 B16;
+ CARD32 affectEnabledCtrls B32;
+ CARD32 enabledCtrls B32;
+ CARD32 changeCtrls B32;
+ CARD16 repeatDelay B16;
+ CARD16 repeatInterval B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD16 mkDelay B16;
+ CARD16 mkInterval B16;
+ CARD16 mkTimeToMax B16;
+ CARD16 mkMaxSpeed B16;
+ INT16 mkCurve B16;
+ CARD16 axTimeout B16;
+ CARD32 axtCtrlsMask B32;
+ CARD32 axtCtrlsValues B32;
+ CARD16 axtOptsMask B16;
+ CARD16 axtOptsValues B16;
+ BYTE perKeyRepeat[XkbPerKeyBitArraySize];
+} xkbSetControlsReq;
+#define sz_xkbSetControlsReq 100
+
+typedef struct _xkbKTMapEntryWireDesc {
+ BOOL active;
+ CARD8 mask;
+ CARD8 level;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD16 pad B16;
+} xkbKTMapEntryWireDesc;
+#define sz_xkbKTMapEntryWireDesc 8
+
+typedef struct _xkbKTSetMapEntryWireDesc {
+ CARD8 level;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+} xkbKTSetMapEntryWireDesc;
+#define sz_xkbKTSetMapEntryWireDesc 4
+
+typedef struct _xkbModsWireDesc {
+ CARD8 mask; /* GetMap only */
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+} xkbModsWireDesc;
+#define sz_xkbModsWireDesc 4
+
+typedef struct _xkbKeyTypeWireDesc {
+ CARD8 mask;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD8 numLevels;
+ CARD8 nMapEntries;
+ BOOL preserve;
+ CARD8 pad;
+} xkbKeyTypeWireDesc;
+#define sz_xkbKeyTypeWireDesc 8
+
+typedef struct _xkbSymMapWireDesc {
+ CARD8 ktIndex[XkbNumKbdGroups];
+ CARD8 groupInfo;
+ CARD8 width;
+ CARD16 nSyms B16;
+} xkbSymMapWireDesc;
+#define sz_xkbSymMapWireDesc 8
+
+typedef struct _xkbVModMapWireDesc {
+ KeyCode key;
+ CARD8 pad;
+ CARD16 vmods B16;
+} xkbVModMapWireDesc;
+#define sz_xkbVModMapWireDesc 4
+
+typedef struct _xkbBehaviorWireDesc {
+ CARD8 key;
+ CARD8 type;
+ CARD8 data;
+ CARD8 pad;
+} xkbBehaviorWireDesc;
+#define sz_xkbBehaviorWireDesc 4
+
+typedef struct _xkbActionWireDesc {
+ CARD8 type;
+ CARD8 data[7];
+} xkbActionWireDesc;
+#define sz_xkbActionWireDesc 8
+
+typedef struct _xkbGetMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 full B16;
+ CARD16 partial B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD16 virtualMods B16;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD16 pad1 B16;
+} xkbGetMapReq;
+#define sz_xkbGetMapReq 28
+
+typedef struct _xkbGetMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 pad1 B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD16 present B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 totalTypes;
+ KeyCode firstKeySym;
+ CARD16 totalSyms B16;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD16 totalActs B16;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD8 totalKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ CARD8 totalKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ CARD8 totalModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD8 totalVModMapKeys;
+ CARD8 pad2;
+ CARD16 virtualMods B16;
+} xkbGetMapReply;
+#define sz_xkbGetMapReply 40
+
+#define XkbSetMapResizeTypes (1L<<0)
+#define XkbSetMapRecomputeActions (1L<<1)
+#define XkbSetMapAllFlags (0x3)
+
+typedef struct _xkbSetMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 present B16;
+ CARD16 flags B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ CARD16 totalSyms B16;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ CARD16 totalActs B16;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ CARD8 totalKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ CARD8 totalKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ CARD8 totalModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD8 totalVModMapKeys;
+ CARD16 virtualMods B16;
+} xkbSetMapReq;
+#define sz_xkbSetMapReq 36
+
+typedef struct _xkbSymInterpretWireDesc {
+ CARD32 sym B32;
+ CARD8 mods;
+ CARD8 match;
+ CARD8 virtualMod;
+ CARD8 flags;
+ xkbActionWireDesc act;
+} xkbSymInterpretWireDesc;
+#define sz_xkbSymInterpretWireDesc 16
+
+typedef struct _xkbGetCompatMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetCompatMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 groups;
+ BOOL getAllSI;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+} xkbGetCompatMapReq;
+#define sz_xkbGetCompatMapReq 12
+
+typedef struct _xkbGetCompatMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 groups;
+ CARD8 pad1;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 nTotalSI B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetCompatMapReply;
+#define sz_xkbGetCompatMapReply 32
+
+typedef struct _xkbSetCompatMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetCompatMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 pad1;
+ BOOL recomputeActions;
+ BOOL truncateSI;
+ CARD8 groups;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 pad2 B16;
+} xkbSetCompatMapReq;
+#define sz_xkbSetCompatMapReq 16
+
+typedef struct _xkbGetIndicatorState {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetIndicatorState */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+} xkbGetIndicatorStateReq;
+#define sz_xkbGetIndicatorStateReq 8
+
+typedef struct _xkbGetIndicatorStateReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 state B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetIndicatorStateReply;
+#define sz_xkbGetIndicatorStateReply 32
+
+typedef struct _xkbGetIndicatorMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetIndicatorMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ CARD32 which B32;
+} xkbGetIndicatorMapReq;
+#define sz_xkbGetIndicatorMapReq 12
+
+typedef struct _xkbGetIndicatorMapReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 which B32;
+ CARD32 realIndicators B32;
+ CARD8 nIndicators;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbGetIndicatorMapReply;
+#define sz_xkbGetIndicatorMapReply 32
+
+typedef struct _xkbIndicatorMapWireDesc {
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 mods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+} xkbIndicatorMapWireDesc;
+#define sz_xkbIndicatorMapWireDesc 12
+
+typedef struct _xkbSetIndicatorMap {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetIndicatorMap */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+ CARD32 which B32;
+} xkbSetIndicatorMapReq;
+#define sz_xkbSetIndicatorMapReq 12
+
+typedef struct _xkbGetNamedIndicator {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBGetNamedIndicator */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD16 pad1 B16;
+ Atom indicator B32;
+} xkbGetNamedIndicatorReq;
+#define sz_xkbGetNamedIndicatorReq 16
+
+typedef struct _xkbGetNamedIndicatorReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom indicator B32;
+ BOOL found;
+ BOOL on;
+ BOOL realIndicator;
+ CARD8 ndx;
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 mods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+ BOOL supported;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbGetNamedIndicatorReply;
+#define sz_xkbGetNamedIndicatorReply 32
+
+typedef struct _xkbSetNamedIndicator {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* X_KBSetNamedIndicator */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD16 pad1 B16;
+ Atom indicator B32;
+ BOOL setState;
+ BOOL on;
+ BOOL setMap;
+ BOOL createMap;
+ CARD8 pad2;
+ CARD8 flags;
+ CARD8 whichGroups;
+ CARD8 groups;
+ CARD8 whichMods;
+ CARD8 realMods;
+ CARD16 virtualMods B16;
+ CARD32 ctrls B32;
+} xkbSetNamedIndicatorReq;
+#define sz_xkbSetNamedIndicatorReq 32
+
+typedef struct _xkbGetNames {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetNames */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ CARD32 which B32;
+} xkbGetNamesReq;
+#define sz_xkbGetNamesReq 12
+
+typedef struct _xkbGetNamesReply {
+ BYTE type;
+ BYTE deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 which B32;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 nTypes;
+ CARD8 groupNames;
+ CARD16 virtualMods B16;
+ KeyCode firstKey;
+ CARD8 nKeys;
+ CARD32 indicators B32;
+ CARD8 nRadioGroups;
+ CARD8 nKeyAliases;
+ CARD16 nKTLevels B16;
+ CARD32 pad3 B32;
+} xkbGetNamesReply;
+#define sz_xkbGetNamesReply 32
+
+typedef struct _xkbSetNames {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetNames */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 virtualMods B16;
+ CARD32 which B32;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 firstKTLevel;
+ CARD8 nKTLevels;
+ CARD32 indicators B32;
+ CARD8 groupNames;
+ CARD8 nRadioGroups;
+ KeyCode firstKey;
+ CARD8 nKeys;
+ CARD8 nKeyAliases;
+ CARD8 pad1;
+ CARD16 totalKTLevelNames B16;
+} xkbSetNamesReq;
+#define sz_xkbSetNamesReq 28
+
+typedef struct _xkbPointWireDesc {
+ INT16 x B16;
+ INT16 y B16;
+} xkbPointWireDesc;
+#define sz_xkbPointWireDesc 4
+
+typedef struct _xkbOutlineWireDesc {
+ CARD8 nPoints;
+ CARD8 cornerRadius;
+ CARD16 pad B16;
+} xkbOutlineWireDesc;
+#define sz_xkbOutlineWireDesc 4
+
+typedef struct _xkbShapeWireDesc {
+ Atom name B32;
+ CARD8 nOutlines;
+ CARD8 primaryNdx;
+ CARD8 approxNdx;
+ CARD8 pad;
+} xkbShapeWireDesc;
+#define sz_xkbShapeWireDesc 8
+
+typedef struct _xkbSectionWireDesc {
+ Atom name B32;
+ INT16 top B16;
+ INT16 left B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ INT16 angle B16;
+ CARD8 priority;
+ CARD8 nRows;
+ CARD8 nDoodads;
+ CARD8 nOverlays;
+ CARD16 pad B16;
+} xkbSectionWireDesc;
+#define sz_xkbSectionWireDesc 20
+
+typedef struct _xkbRowWireDesc {
+ INT16 top B16;
+ INT16 left B16;
+ CARD8 nKeys;
+ BOOL vertical;
+ CARD16 pad B16;
+} xkbRowWireDesc;
+#define sz_xkbRowWireDesc 8
+
+typedef struct _xkbKeyWireDesc {
+ CARD8 name[XkbKeyNameLength];
+ INT16 gap B16;
+ CARD8 shapeNdx;
+ CARD8 colorNdx;
+} xkbKeyWireDesc;
+#define sz_xkbKeyWireDesc 8
+
+typedef struct _xkbOverlayWireDesc {
+ Atom name B32;
+ CARD8 nRows;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbOverlayWireDesc;
+#define sz_xkbOverlayWireDesc 8
+
+typedef struct _xkbOverlayRowWireDesc {
+ CARD8 rowUnder;
+ CARD8 nKeys;
+ CARD16 pad1 B16;
+} xkbOverlayRowWireDesc;
+#define sz_xkbOverlayRowWireDesc 4
+
+typedef struct _xkbOverlayKeyWireDesc {
+ CARD8 over[XkbKeyNameLength];
+ CARD8 under[XkbKeyNameLength];
+} xkbOverlayKeyWireDesc;
+#define sz_xkbOverlayKeyWireDesc 8
+
+typedef struct _xkbShapeDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 colorNdx;
+ CARD8 shapeNdx;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+} xkbShapeDoodadWireDesc;
+#define sz_xkbShapeDoodadWireDesc 20
+
+typedef struct _xkbTextDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD8 colorNdx;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+} xkbTextDoodadWireDesc;
+#define sz_xkbTextDoodadWireDesc 20
+
+typedef struct _xkbIndicatorDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 shapeNdx;
+ CARD8 onColorNdx;
+ CARD8 offColorNdx;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+} xkbIndicatorDoodadWireDesc;
+#define sz_xkbIndicatorDoodadWireDesc 20
+
+typedef struct _xkbLogoDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD8 colorNdx;
+ CARD8 shapeNdx;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+} xkbLogoDoodadWireDesc;
+#define sz_xkbLogoDoodadWireDesc 20
+
+typedef struct _xkbAnyDoodadWireDesc {
+ Atom name B32;
+ CARD8 type;
+ CARD8 priority;
+ INT16 top B16;
+ INT16 left B16;
+ INT16 angle B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbAnyDoodadWireDesc;
+#define sz_xkbAnyDoodadWireDesc 20
+
+typedef union _xkbDoodadWireDesc {
+ xkbAnyDoodadWireDesc any;
+ xkbShapeDoodadWireDesc shape;
+ xkbTextDoodadWireDesc text;
+ xkbIndicatorDoodadWireDesc indicator;
+ xkbLogoDoodadWireDesc logo;
+} xkbDoodadWireDesc;
+#define sz_xkbDoodadWireDesc 20
+
+typedef struct _xkbGetGeometry {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetGeometry */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad B16;
+ Atom name B32;
+} xkbGetGeometryReq;
+#define sz_xkbGetGeometryReq 12
+
+typedef struct _xkbGetGeometryReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Atom name B32;
+ BOOL found;
+ CARD8 pad;
+ CARD16 widthMM B16;
+ CARD16 heightMM B16;
+ CARD16 nProperties B16;
+ CARD16 nColors B16;
+ CARD16 nShapes B16;
+ CARD16 nSections B16;
+ CARD16 nDoodads B16;
+ CARD16 nKeyAliases B16;
+ CARD8 baseColorNdx;
+ CARD8 labelColorNdx;
+} xkbGetGeometryReply;
+#define sz_xkbGetGeometryReply 32
+
+typedef struct _xkbSetGeometry {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetGeometry */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 nShapes;
+ CARD8 nSections;
+ Atom name B32;
+ CARD16 widthMM B16;
+ CARD16 heightMM B16;
+ CARD16 nProperties B16;
+ CARD16 nColors B16;
+ CARD16 nDoodads B16;
+ CARD16 nKeyAliases B16;
+ CARD8 baseColorNdx;
+ CARD8 labelColorNdx;
+ CARD16 pad B16;
+} xkbSetGeometryReq;
+#define sz_xkbSetGeometryReq 28
+
+typedef struct _xkbPerClientFlags {
+ CARD8 reqType;
+ CARD8 xkbReqType;/* always X_KBPerClientFlags */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 pad1 B16;
+ CARD32 change B32;
+ CARD32 value B32;
+ CARD32 ctrlsToChange B32;
+ CARD32 autoCtrls B32;
+ CARD32 autoCtrlValues B32;
+} xkbPerClientFlagsReq;
+#define sz_xkbPerClientFlagsReq 28
+
+typedef struct _xkbPerClientFlagsReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 supported B32;
+ CARD32 value B32;
+ CARD32 autoCtrls B32;
+ CARD32 autoCtrlValues B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xkbPerClientFlagsReply;
+#define sz_xkbPerClientFlagsReply 32
+
+typedef struct _xkbListComponents {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBListComponents */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 maxNames B16;
+} xkbListComponentsReq;
+#define sz_xkbListComponentsReq 8
+
+typedef struct _xkbListComponentsReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nKeymaps B16;
+ CARD16 nKeycodes B16;
+ CARD16 nTypes B16;
+ CARD16 nCompatMaps B16;
+ CARD16 nSymbols B16;
+ CARD16 nGeometries B16;
+ CARD16 extra B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbListComponentsReply;
+#define sz_xkbListComponentsReply 32
+
+typedef struct _xkbGetKbdByName {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetKbdByName */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 need B16; /* combination of XkbGBN_* */
+ CARD16 want B16; /* combination of XkbGBN_* */
+ BOOL load;
+ CARD8 pad;
+} xkbGetKbdByNameReq;
+#define sz_xkbGetKbdByNameReq 12
+
+typedef struct _xkbGetKbdByNameReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ BOOL loaded;
+ BOOL newKeyboard;
+ CARD16 found B16; /* combination of XkbGBN_* */
+ CARD16 reported B16; /* combination of XkbAllComponents */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbGetKbdByNameReply;
+#define sz_xkbGetKbdByNameReply 32
+
+typedef struct _xkbDeviceLedsWireDesc {
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD32 namesPresent B32;
+ CARD32 mapsPresent B32;
+ CARD32 physIndicators B32;
+ CARD32 state B32;
+} xkbDeviceLedsWireDesc;
+#define sz_xkbDeviceLedsWireDesc 20
+
+typedef struct _xkbGetDeviceInfo {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBGetDeviceInfo */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD16 wanted B16;
+ BOOL allBtns;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD8 pad;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+} xkbGetDeviceInfoReq;
+#define sz_xkbGetDeviceInfoReq 16
+
+typedef struct _xkbGetDeviceInfoReply {
+ CARD8 type; /* always X_Reply */
+ CARD8 deviceID;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 present B16;
+ CARD16 supported B16;
+ CARD16 unsupported B16;
+ CARD16 nDeviceLedFBs B16;
+ CARD8 firstBtnWanted;
+ CARD8 nBtnsWanted;
+ CARD8 firstBtnRtrn;
+ CARD8 nBtnsRtrn;
+ CARD8 totalBtns;
+ BOOL hasOwnState;
+ CARD16 dfltKbdFB B16;
+ CARD16 dfltLedFB B16;
+ CARD16 pad B16;
+ Atom devType B32;
+} xkbGetDeviceInfoReply;
+#define sz_xkbGetDeviceInfoReply 32
+
+typedef struct _xkbSetDeviceInfo {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetDeviceInfo */
+ CARD16 length B16;
+ CARD16 deviceSpec B16;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD16 change B16;
+ CARD16 nDeviceLedFBs B16;
+} xkbSetDeviceInfoReq;
+#define sz_xkbSetDeviceInfoReq 12
+
+typedef struct _xkbSetDebuggingFlags {
+ CARD8 reqType;
+ CARD8 xkbReqType; /* always X_KBSetDebuggingFlags */
+ CARD16 length B16;
+ CARD16 msgLength B16;
+ CARD16 pad B16;
+ CARD32 affectFlags B32;
+ CARD32 flags B32;
+ CARD32 affectCtrls B32;
+ CARD32 ctrls B32;
+} xkbSetDebuggingFlagsReq;
+#define sz_xkbSetDebuggingFlagsReq 24
+
+typedef struct _xkbSetDebuggingFlagsReply {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 currentFlags B32;
+ CARD32 currentCtrls B32;
+ CARD32 supportedFlags B32;
+ CARD32 supportedCtrls B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+} xkbSetDebuggingFlagsReply;
+#define sz_xkbSetDebuggingFlagsReply 32
+
+ /*
+ * X KEYBOARD EXTENSION EVENT STRUCTURES
+ */
+
+typedef struct _xkbAnyEvent {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xkbAnyEvent;
+#define sz_xkbAnyEvent 32
+
+typedef struct _xkbNewKeyboardNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 oldDeviceID;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ KeyCode oldMinKeyCode;
+ KeyCode oldMaxKeyCode;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+ CARD16 changed B16;
+ CARD8 detail;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbNewKeyboardNotify;
+#define sz_xkbNewKeyboardNotify 32
+
+typedef struct _xkbMapNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 ptrBtnActions;
+ CARD16 changed B16;
+ KeyCode minKeyCode;
+ KeyCode maxKeyCode;
+ CARD8 firstType;
+ CARD8 nTypes;
+ KeyCode firstKeySym;
+ CARD8 nKeySyms;
+ KeyCode firstKeyAct;
+ CARD8 nKeyActs;
+ KeyCode firstKeyBehavior;
+ CARD8 nKeyBehaviors;
+ KeyCode firstKeyExplicit;
+ CARD8 nKeyExplicit;
+ KeyCode firstModMapKey;
+ CARD8 nModMapKeys;
+ KeyCode firstVModMapKey;
+ CARD8 nVModMapKeys;
+ CARD16 virtualMods B16;
+ CARD16 pad1 B16;
+} xkbMapNotify;
+#define sz_xkbMapNotify 32
+
+typedef struct _xkbStateNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 mods;
+ CARD8 baseMods;
+ CARD8 latchedMods;
+ CARD8 lockedMods;
+ CARD8 group;
+ INT16 baseGroup B16;
+ INT16 latchedGroup B16;
+ CARD8 lockedGroup;
+ CARD8 compatState;
+ CARD8 grabMods;
+ CARD8 compatGrabMods;
+ CARD8 lookupMods;
+ CARD8 compatLookupMods;
+ CARD16 ptrBtnState B16;
+ CARD16 changed B16;
+ KeyCode keycode;
+ CARD8 eventType;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+} xkbStateNotify;
+#define sz_xkbStateNotify 32
+
+typedef struct _xkbControlsNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 numGroups;
+ CARD16 pad1 B16;
+ CARD32 changedControls B32;
+ CARD32 enabledControls B32;
+ CARD32 enabledControlChanges B32;
+ KeyCode keycode;
+ CARD8 eventType;
+ CARD8 requestMajor;
+ CARD8 requestMinor;
+ CARD32 pad2 B32;
+} xkbControlsNotify;
+#define sz_xkbControlsNotify 32
+
+typedef struct _xkbIndicatorNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 state B32;
+ CARD32 changed B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+} xkbIndicatorNotify;
+#define sz_xkbIndicatorNotify 32
+
+typedef struct _xkbNamesNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 changed B16;
+ CARD8 firstType;
+ CARD8 nTypes;
+ CARD8 firstLevelName;
+ CARD8 nLevelNames;
+ CARD8 pad2;
+ CARD8 nRadioGroups;
+ CARD8 nAliases;
+ CARD8 changedGroupNames;
+ CARD16 changedVirtualMods B16;
+ CARD8 firstKey;
+ CARD8 nKeys;
+ CARD32 changedIndicators B32;
+ CARD32 pad3 B32;
+} xkbNamesNotify;
+#define sz_xkbNamesNotify 32
+
+typedef struct _xkbCompatMapNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 changedGroups;
+ CARD16 firstSI B16;
+ CARD16 nSI B16;
+ CARD16 nTotalSI B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbCompatMapNotify;
+#define sz_xkbCompatMapNotify 32
+
+typedef struct _xkbBellNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 bellClass;
+ CARD8 bellID;
+ CARD8 percent;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+ Atom name B32;
+ Window window B32;
+ BOOL eventOnly;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+} xkbBellNotify;
+#define sz_xkbBellNotify 32
+
+typedef struct _xkbActionMessage {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ KeyCode keycode;
+ BOOL press;
+ BOOL keyEventFollows;
+ CARD8 mods;
+ CARD8 group;
+ CARD8 message[8];
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+} xkbActionMessage;
+#define sz_xkbActionMessage 32
+
+typedef struct _xkbAccessXNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ KeyCode keycode;
+ CARD16 detail B16;
+ CARD16 slowKeysDelay B16;
+ CARD16 debounceDelay B16;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xkbAccessXNotify;
+#define sz_xkbAccessXNotify 32
+
+typedef struct _xkbExtensionDeviceNotify {
+ BYTE type;
+ BYTE xkbType;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 deviceID;
+ CARD8 pad1;
+ CARD16 reason B16;
+ CARD16 ledClass B16;
+ CARD16 ledID B16;
+ CARD32 ledsDefined B32;
+ CARD32 ledState B32;
+ CARD8 firstBtn;
+ CARD8 nBtns;
+ CARD16 supported B16;
+ CARD16 unsupported B16;
+ CARD16 pad3 B16;
+} xkbExtensionDeviceNotify;
+#define sz_xkbExtensionDeviceNotify 32
+
+typedef struct _xkbEvent {
+ union {
+ xkbAnyEvent any;
+ xkbNewKeyboardNotify new_kbd;
+ xkbMapNotify map;
+ xkbStateNotify state;
+ xkbControlsNotify ctrls;
+ xkbIndicatorNotify indicators;
+ xkbNamesNotify names;
+ xkbCompatMapNotify compat;
+ xkbBellNotify bell;
+ xkbActionMessage message;
+ xkbAccessXNotify accessx;
+ xkbExtensionDeviceNotify device;
+ } u;
+} xkbEvent;
+#define sz_xkbEvent 32
+
+#undef Window
+#undef Atom
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* _XKBPROTO_H_ */
diff --git a/kbproto/XKBsrv.h b/kbproto/XKBsrv.h
new file mode 100644
index 0000000..26a4ed8
--- /dev/null
+++ b/kbproto/XKBsrv.h
@@ -0,0 +1,1187 @@
+/* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/* $XdotOrg: $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */
+
+#ifndef _XKBSRV_H_
+#define _XKBSRV_H_
+
+#ifdef XKB_IN_SERVER
+#define XkbAllocClientMap SrvXkbAllocClientMap
+#define XkbAllocServerMap SrvXkbAllocServerMap
+#define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey
+#define XkbAddKeyType SrvXkbAddKeyType
+#define XkbCopyKeyType SrvXkbCopyKeyType
+#define XkbCopyKeyTypes SrvXkbCopyKeyTypes
+#define XkbFreeClientMap SrvXkbFreeClientMap
+#define XkbFreeServerMap SrvXkbFreeServerMap
+#define XkbInitCanonicalKeyTypes SrvXkbInitCanonicalKeyTypes
+#define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols
+#define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey
+#define XkbUpdateMapFromCore SrvXkbUpdateMapFromCore
+#define XkbResizeKeyActions SrvXkbResizeKeyActions
+#define XkbResizeKeySyms SrvXkbResizeKeySyms
+#define XkbResizeKeyType SrvXkbResizeKeyType
+#define XkbAllocCompatMap SrvXkbAllocCompatMap
+#define XkbAllocControls SrvXkbAllocControls
+#define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps
+#define XkbAllocKeyboard SrvXkbAllocKeyboard
+#define XkbAllocNames SrvXkbAllocNames
+#define XkbFreeCompatMap SrvXkbFreeCompatMap
+#define XkbFreeControls SrvXkbFreeControls
+#define XkbFreeIndicatorMaps SrvXkbFreeIndicatorMaps
+#define XkbFreeKeyboard SrvXkbFreeKeyboard
+#define XkbFreeNames SrvXkbFreeNames
+#define XkbAddDeviceLedInfo SrvXkbAddDeviceLedInfo
+#define XkbAllocDeviceInfo SrvXkbAllocDeviceInfo
+#define XkbFreeDeviceInfo SrvXkbFreeDeviceInfo
+#define XkbResizeDeviceButtonActions SrvXkbResizeDeviceButtonActions
+#define XkbLatchModifiers SrvXkbLatchModifiers
+#define XkbLatchGroup SrvXkbLatchGroup
+#define XkbVirtualModsToReal SrvXkbVirtualModsToReal
+#define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange
+#define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges
+#define XkbUpdateActionVirtualMods SrvXkbUpdateActionVirtualMods
+#define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods
+#endif
+
+#include <X11/extensions/XKBstr.h>
+#include <X11/extensions/XKBproto.h>
+#include "inputstr.h"
+
+typedef struct _XkbInterest {
+ DeviceIntPtr dev;
+ ClientPtr client;
+ XID resource;
+ struct _XkbInterest * next;
+ CARD16 extDevNotifyMask;
+ CARD16 stateNotifyMask;
+ CARD16 namesNotifyMask;
+ CARD32 ctrlsNotifyMask;
+ CARD8 compatNotifyMask;
+ BOOL bellNotifyMask;
+ BOOL actionMessageMask;
+ CARD16 accessXNotifyMask;
+ CARD32 iStateNotifyMask;
+ CARD32 iMapNotifyMask;
+ CARD16 altSymsNotifyMask;
+ CARD32 autoCtrls;
+ CARD32 autoCtrlValues;
+} XkbInterestRec,*XkbInterestPtr;
+
+typedef struct _XkbRadioGroup {
+ CARD8 flags;
+ CARD8 nMembers;
+ CARD8 dfltDown;
+ CARD8 currentDown;
+ CARD8 members[XkbRGMaxMembers];
+} XkbRadioGroupRec, *XkbRadioGroupPtr;
+
+typedef struct _XkbEventCause {
+ CARD8 kc;
+ CARD8 event;
+ CARD8 mjr;
+ CARD8 mnr;
+ ClientPtr client;
+} XkbEventCauseRec,*XkbEventCausePtr;
+#define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\
+ (c)->mjr= (c)->mnr= 0; \
+ (c)->client= NULL; }
+#define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
+ (c)->mjr= (j),(c)->mnr= (n);\
+ (c)->client= (cl); }
+#define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
+#define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl)
+#define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0)
+
+#define _OFF_TIMER 0
+#define _KRG_WARN_TIMER 1
+#define _KRG_TIMER 2
+#define _SK_TIMEOUT_TIMER 3
+#define _ALL_TIMEOUT_TIMER 4
+
+#define _BEEP_NONE 0
+#define _BEEP_FEATURE_ON 1
+#define _BEEP_FEATURE_OFF 2
+#define _BEEP_FEATURE_CHANGE 3
+#define _BEEP_SLOW_WARN 4
+#define _BEEP_SLOW_PRESS 5
+#define _BEEP_SLOW_ACCEPT 6
+#define _BEEP_SLOW_REJECT 7
+#define _BEEP_SLOW_RELEASE 8
+#define _BEEP_STICKY_LATCH 9
+#define _BEEP_STICKY_LOCK 10
+#define _BEEP_STICKY_UNLOCK 11
+#define _BEEP_LED_ON 12
+#define _BEEP_LED_OFF 13
+#define _BEEP_LED_CHANGE 14
+#define _BEEP_BOUNCE_REJECT 15
+
+typedef struct _XkbSrvInfo {
+ XkbStateRec prev_state;
+ XkbStateRec state;
+ XkbDescPtr desc;
+
+ DeviceIntPtr device;
+ KbdCtrlProcPtr kbdProc;
+
+ XkbRadioGroupPtr radioGroups;
+ CARD8 nRadioGroups;
+ CARD8 clearMods;
+ CARD8 setMods;
+ INT16 groupChange;
+
+ CARD16 dfltPtrDelta;
+
+ double mouseKeysCurve;
+ double mouseKeysCurveFactor;
+ INT16 mouseKeysDX;
+ INT16 mouseKeysDY;
+ CARD8 mouseKeysFlags;
+ Bool mouseKeysAccel;
+ CARD8 mouseKeysCounter;
+
+ CARD8 lockedPtrButtons;
+ CARD8 shiftKeyCount;
+ KeyCode mouseKey;
+ KeyCode inactiveKey;
+ KeyCode slowKey;
+ KeyCode repeatKey;
+ CARD8 krgTimerActive;
+ CARD8 beepType;
+ CARD8 beepCount;
+
+ CARD32 flags;
+ CARD32 lastPtrEventTime;
+ CARD32 lastShiftEventTime;
+ OsTimerPtr beepTimer;
+ OsTimerPtr mouseKeyTimer;
+ OsTimerPtr slowKeysTimer;
+ OsTimerPtr bounceKeysTimer;
+ OsTimerPtr repeatKeyTimer;
+ OsTimerPtr krgTimer;
+} XkbSrvInfoRec, *XkbSrvInfoPtr;
+
+#define XkbSLI_IsDefault (1L<<0)
+#define XkbSLI_HasOwnState (1L<<1)
+
+typedef struct _XkbSrvLedInfo {
+ CARD16 flags;
+ CARD16 class;
+ CARD16 id;
+ union {
+ KbdFeedbackPtr kf;
+ LedFeedbackPtr lf;
+ } fb;
+
+ CARD32 physIndicators;
+ CARD32 autoState;
+ CARD32 explicitState;
+ CARD32 effectiveState;
+
+ CARD32 mapsPresent;
+ CARD32 namesPresent;
+ XkbIndicatorMapPtr maps;
+ Atom * names;
+
+ CARD32 usesBase;
+ CARD32 usesLatched;
+ CARD32 usesLocked;
+ CARD32 usesEffective;
+ CARD32 usesCompat;
+ CARD32 usesControls;
+
+ CARD32 usedComponents;
+} XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
+
+/*
+ * Settings for xkbClientFlags field (used by DIX)
+ * These flags _must_ not overlap with XkbPCF_*
+ */
+#define _XkbClientInitialized (1<<15)
+
+#define _XkbWantsDetectableAutoRepeat(c)\
+ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
+
+/*
+ * Settings for flags field
+ */
+#define _XkbStateNotifyInProgress (1<<0)
+
+typedef struct
+{
+ ProcessInputProc processInputProc;
+ ProcessInputProc realInputProc;
+ DeviceUnwrapProc unwrapProc;
+} xkbDeviceInfoRec, *xkbDeviceInfoPtr;
+
+#define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ if (device->public.processInputProc == device->public.realInputProc)\
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
+ device->public.processInputProc = oldprocs->processInputProc; \
+ device->public.realInputProc = oldprocs->realInputProc; \
+ device->unwrapProc = oldprocs->unwrapProc;
+
+#define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
+
+/***====================================================================***/
+
+
+/***====================================================================***/
+
+#define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask)
+#define XkbAllFilteredEventsMask \
+ (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
+
+/***====================================================================***/
+
+extern int XkbReqCode;
+extern int XkbEventBase;
+extern int XkbKeyboardErrorCode;
+extern int XkbDisableLockActions;
+extern char * XkbBaseDirectory;
+extern char * XkbBinDirectory;
+extern char * XkbInitialMap;
+extern int _XkbClientMajor;
+extern int _XkbClientMinor;
+extern unsigned int XkbXIUnsupported;
+
+extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed;
+extern Bool noXkbExtension;
+extern Bool XkbWantRulesProp;
+
+extern pointer XkbLastRepeatEvent;
+
+extern CARD32 xkbDebugFlags;
+extern CARD32 xkbDebugCtrls;
+
+#define _XkbAlloc(s) xalloc((s))
+#define _XkbCalloc(n,s) Xcalloc((n)*(s))
+#define _XkbRealloc(o,s) Xrealloc((o),(s))
+#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
+#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
+#define _XkbTypedRealloc(o,n,t) \
+ ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
+#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
+#define _XkbFree(p) Xfree(p)
+
+#define _XkbLibError(c,l,d) \
+ { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
+#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
+#define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
+#define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
+
+extern int DeviceKeyPress,DeviceKeyRelease;
+extern int DeviceButtonPress,DeviceButtonRelease;
+
+#ifdef XINPUT
+#define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
+#define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease))
+#else
+#define _XkbIsPressEvent(t) ((t)==KeyPress)
+#define _XkbIsReleaseEvent(t) ((t)==KeyRelease)
+#endif
+
+#define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\
+ ((k)<=(c)->curKeySyms.maxKeyCode))
+#define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\
+ (c)->curKeySyms.minKeyCode+1)
+
+#define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
+#undef IsKeypadKey
+#define IsKeypadKey(s) XkbKSIsKeypad(s)
+
+typedef int Status;
+typedef pointer XPointer;
+typedef struct _XDisplay Display;
+
+#ifndef True
+#define True 1
+#define False 0
+#endif
+
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+
+_XFUNCPROTOBEGIN
+
+extern void XkbUseMsg(
+ void
+);
+
+extern int XkbProcessArguments(
+ int /* argc */,
+ char ** /* argv */,
+ int /* i */
+);
+
+extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
+
+extern void XkbFreeCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern DeviceIntPtr _XkbLookupAnyDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupKeyboard(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupBellDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupLedDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupButtonDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern XkbDescPtr XkbAllocKeyboard(
+ void
+);
+
+extern Status XkbAllocClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nTypes */
+);
+
+extern Status XkbAllocServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nNewActions */
+);
+
+extern void XkbFreeClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern Status XkbAllocIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbAllocCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nInterpret */
+);
+
+extern Status XkbAllocNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* nTotalRG */,
+ int /* nTotalAliases */
+);
+
+extern Status XkbAllocControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which*/
+);
+
+extern Status XkbCopyKeyType(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */
+);
+
+extern Status XkbCopyKeyTypes(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */,
+ int /* num_types */
+);
+
+extern Status XkbResizeKeyType(
+ XkbDescPtr /* xkb */,
+ int /* type_ndx */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* new_num_lvls */
+);
+
+extern void XkbFreeKeyboard(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeDesc */
+);
+
+extern void XkbSetActionKeyMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* mods */
+);
+
+extern Bool XkbCheckActionVMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern Bool XkbApplyVModChanges(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* pChanges */,
+ unsigned int * /* needChecksRtrn */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyVModChangesToAllDevices(
+ DeviceIntPtr /* dev */,
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbEventCausePtr /* cause */
+);
+
+extern unsigned int XkbMaskForVMask(
+ XkbDescPtr /* xkb */,
+ unsigned int /* vmask */
+);
+
+extern Bool XkbVirtualModsToReal(
+ XkbDescPtr /* xkb */,
+ unsigned int /* virtua_mask */,
+ unsigned int * /* mask_rtrn */
+);
+
+extern unsigned int XkbAdjustGroup(
+ int /* group */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern KeySym *XkbResizeKeySyms(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern XkbAction *XkbResizeKeyActions(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern void XkbUpdateKeyTypesFromCore(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */
+);
+
+extern void XkbUpdateDescActions(
+ XkbDescPtr /* xkb */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbUpdateActions(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */,
+ unsigned int * /* needChecksRtrn */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateCoreDescription(
+ DeviceIntPtr /* keybd */,
+ Bool /* resize */
+);
+
+extern void XkbApplyMappingChange(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* request */,
+ KeyCode /* firstKey */,
+ CARD8 /* num */,
+ ClientPtr /* client */
+);
+
+extern void XkbSetIndicators(
+ DeviceIntPtr /* pXDev */,
+ CARD32 /* affect */,
+ CARD32 /* values */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateIndicators(
+ DeviceIntPtr /* keybd */,
+ CARD32 /* changed */,
+ Bool /* check_edevs */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ KbdFeedbackPtr /* kf */,
+ LedFeedbackPtr /* lf */,
+ unsigned int /* needed_parts */
+);
+
+extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ unsigned int /* class */,
+ unsigned int /* id */,
+ unsigned int /* needed_parts */
+);
+
+extern void XkbApplyLedNameChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_names */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedMapChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_maps */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedStateChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_leds */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateLedAutoState(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* maps_to_check */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbFlushLedEvents(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ XkbSrvLedInfoPtr /* sli */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateAllDeviceIndicators(
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern unsigned int XkbIndicatorsToUpdate(
+ DeviceIntPtr /* dev */,
+ unsigned long /* state_changes */,
+ Bool /* enabled_ctrl_changes */
+);
+
+extern void XkbComputeDerivedState(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern void XkbCheckSecondaryEffects(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned int /* which */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbCheckIndicatorMaps(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* which */
+);
+
+extern unsigned int XkbStateChangedFlags(
+ XkbStatePtr /* old */,
+ XkbStatePtr /* new */
+);
+
+extern void XkbSendStateNotify(
+ DeviceIntPtr /* kbd */,
+ xkbStateNotify * /* pSN */
+);
+
+extern void XkbSendMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbMapNotify * /* ev */
+);
+
+extern int XkbComputeControlsNotify(
+ DeviceIntPtr /* kbd */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */,
+ xkbControlsNotify * /* pCN */,
+ Bool /* forceCtrlProc */
+);
+
+extern void XkbSendControlsNotify(
+ DeviceIntPtr /* kbd */,
+ xkbControlsNotify * /* ev */
+);
+
+extern void XkbSendCompatMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbSendIndicatorNotify(
+ DeviceIntPtr /* kbd */,
+ int /* xkbType */,
+ xkbIndicatorNotify * /* ev */
+);
+
+extern void XkbHandleBell(
+ BOOL /* force */,
+ BOOL /* eventOnly */,
+ DeviceIntPtr /* kbd */,
+ CARD8 /* percent */,
+ pointer /* ctrl */,
+ CARD8 /* class */,
+ Atom /* name */,
+ WindowPtr /* pWin */,
+ ClientPtr /* pClient */
+);
+
+extern void XkbSendAccessXNotify(
+ DeviceIntPtr /* kbd */,
+ xkbAccessXNotify * /* pEv */
+);
+
+extern void XkbSendNamesNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNamesNotify * /* ev */
+);
+
+extern void XkbSendCompatNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbSendActionMessage(
+ DeviceIntPtr /* kbd */,
+ xkbActionMessage * /* ev */
+);
+
+extern void XkbSendExtensionDeviceNotify(
+ DeviceIntPtr /* kbd */,
+ ClientPtr /* client */,
+ xkbExtensionDeviceNotify * /* ev */
+);
+
+extern void XkbSendNotification(
+ DeviceIntPtr /* kbd */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbProcessKeyboardEvent(
+ struct _xEvent * /* xE */,
+ DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void XkbProcessOtherEvent(
+ struct _xEvent * /* xE */,
+ DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void XkbHandleActions(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ struct _xEvent * /* xE */,
+ int /* count */
+);
+
+extern Bool XkbEnableDisableControls(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned long /* change */,
+ unsigned long /* newValues */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void AccessXInit(
+ DeviceIntPtr /* dev */
+);
+
+extern Bool AccessXFilterPressEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern Bool AccessXFilterReleaseEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void AccessXCancelRepeatKey(
+ XkbSrvInfoPtr /* xkbi */,
+ KeyCode /* key */
+);
+
+extern void AccessXComputeCurveFactor(
+ XkbSrvInfoPtr /* xkbi */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledId */
+);
+
+extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
+ unsigned int /* deviceSpec */,
+ unsigned int /* nButtons */,
+ unsigned int /* szLeds */
+);
+
+extern void XkbFreeDeviceInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* which */,
+ Bool /* freeDevI */
+);
+
+extern Status XkbResizeDeviceButtonActions(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* newTotal */
+);
+
+extern XkbInterestPtr XkbFindClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */
+);
+
+extern XkbInterestPtr XkbAddClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */,
+ XID /* id */
+);
+
+extern int XkbRemoveClient(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */
+);
+
+extern int XkbRemoveResourceClient(
+ DevicePtr /* inDev */,
+ XID /* id */
+);
+
+extern int XkbDDXInitDevice(
+ DeviceIntPtr /* dev */
+);
+
+extern int XkbDDXAccessXBeep(
+ DeviceIntPtr /* dev */,
+ unsigned int /* what */,
+ unsigned int /* which */
+);
+
+extern void XkbDDXKeyClick(
+ DeviceIntPtr /* dev */,
+ int /* keycode */,
+ int /* synthetic */
+);
+
+extern int XkbDDXUsesSoftRepeat(
+ DeviceIntPtr /* dev */
+);
+
+extern void XkbDDXKeybdCtrlProc(
+ DeviceIntPtr /* dev */,
+ KeybdCtrl * /* ctrl */
+);
+
+extern void XkbDDXChangeControls(
+ DeviceIntPtr /* dev */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */
+);
+
+extern void XkbDDXUpdateIndicators(
+ DeviceIntPtr /* keybd */,
+ CARD32 /* newState */
+);
+
+extern void XkbDDXUpdateDeviceIndicators(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ CARD32 /* newState */
+);
+
+extern void XkbDDXFakePointerButton(
+ int /* event */,
+ int /* button */
+);
+
+extern void XkbDDXFakePointerMotion(
+ unsigned int /* flags */,
+ int /* x */,
+ int /* y */
+);
+
+extern void XkbDDXFakeDeviceButton(
+ DeviceIntPtr /* dev */,
+ Bool /* press */,
+ int /* button */
+);
+
+extern int XkbDDXTerminateServer(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXSwitchScreen(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXPrivate(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern void XkbDisableComputedAutoRepeats(
+ DeviceIntPtr /* pXDev */,
+ unsigned int /* key */
+);
+
+extern void XkbSetRepeatKeys(
+ DeviceIntPtr /* pXDev */,
+ int /* key */,
+ int /* onoff */
+);
+
+extern int XkbLatchModifiers(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* mask */,
+ CARD8 /* latches */
+);
+
+extern int XkbLatchGroup(
+ DeviceIntPtr /* pXDev */,
+ int /* group */
+);
+
+extern void XkbClearAllLatchesAndLocks(
+ DeviceIntPtr /* dev */,
+ XkbSrvInfoPtr /* xkbi */,
+ Bool /* genEv */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbSetRulesDflts(
+ char * /* rulesFile */,
+ char * /* model */,
+ char * /* layout */,
+ char * /* variant */,
+ char * /* options */
+);
+
+extern void XkbInitDevice(
+ DeviceIntPtr /* pXDev */
+);
+
+extern Bool XkbInitKeyboardDeviceStruct(
+ DeviceIntPtr /* pXDev */,
+ XkbComponentNamesPtr /* pNames */,
+ KeySymsPtr /* pSyms */,
+ CARD8 /* pMods */[],
+ BellProcPtr /* bellProc */,
+ KbdCtrlProcPtr /* ctrlProc */
+);
+
+extern int SProcXkbDispatch(
+ ClientPtr /* client */
+);
+
+extern XkbGeometryPtr XkbLookupNamedGeometry(
+ DeviceIntPtr /* dev */,
+ Atom /* name */,
+ Bool * /* shouldFree */
+);
+
+extern char * _XkbDupString(
+ char * /* str */
+);
+
+extern void XkbConvertCase(
+ KeySym /* sym */,
+ KeySym * /* lower */,
+ KeySym * /* upper */
+);
+
+extern Status XkbChangeKeycodeRange(
+ XkbDescPtr /* xkb */,
+ int /* minKC */,
+ int /* maxKC */,
+ XkbChangesPtr /* changes */
+);
+
+extern int XkbFinishDeviceInit(
+ DeviceIntPtr /* pXDev */
+);
+
+extern void XkbFreeSrvLedInfo(
+ XkbSrvLedInfoPtr /* sli */
+);
+
+extern void XkbFreeInfo(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern Status XkbChangeTypesOfKey(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* nGroups */,
+ unsigned int /* groups */,
+ int * /* newTypesIn */,
+ XkbMapChangesPtr /* changes */
+);
+
+extern XkbKeyTypePtr XkbAddKeyType(
+ XkbDescPtr /* xkb */,
+ Atom /* name */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* num_lvls */
+);
+
+extern Status XkbInitCanonicalKeyTypes(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* keypadVMod */
+);
+
+extern int XkbKeyTypesForCoreSymbols(
+ XkbDescPtr /* xkb */,
+ int /* map_width */,
+ KeySym * /* core_syms */,
+ unsigned int /* protected */,
+ int * /* types_inout */,
+ KeySym * /* xkb_syms_rtrn */
+);
+
+extern Bool XkbApplyCompatMapToKey(
+ XkbDescPtr /* xkb */,
+ KeyCode /* key */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateMapFromCore(
+ XkbDescPtr /* xkb */,
+ KeyCode /* first_key */,
+ int /* num_keys */,
+ int /* map_width */,
+ KeySym * /* core_keysyms */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbFreeControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern Bool XkbApplyVirtualModChanges(
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateActionVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern void XkbUpdateKeyTypeVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbSendNewKeyboardNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNewKeyboardNotify * /* pNKN */
+);
+
+#ifdef XKBSRV_NEED_FILE_FUNCS
+
+#include <X11/extensions/XKMformat.h>
+#include <X11/extensions/XKBfile.h>
+#include <X11/extensions/XKBrules.h>
+
+#define _XkbListKeymaps 0
+#define _XkbListKeycodes 1
+#define _XkbListTypes 2
+#define _XkbListCompat 3
+#define _XkbListSymbols 4
+#define _XkbListGeometry 5
+#define _XkbListNumComponents 6
+
+typedef struct _XkbSrvListInfo {
+ int szPool;
+ int nPool;
+ char * pool;
+
+ int maxRtrn;
+ int nTotal;
+
+ char * pattern[_XkbListNumComponents];
+ int nFound[_XkbListNumComponents];
+} XkbSrvListInfoRec,*XkbSrvListInfoPtr;
+
+char *
+XkbGetRulesDflts(
+ XkbRF_VarDefsPtr /* defs */
+);
+
+extern void XkbSetRulesUsed(
+ XkbRF_VarDefsPtr /* defs */
+);
+
+
+extern Status XkbDDXList(
+ DeviceIntPtr /* dev */,
+ XkbSrvListInfoPtr /* listing */,
+ ClientPtr /* client */
+);
+
+extern unsigned int XkbDDXLoadKeymapByNames(
+ DeviceIntPtr /* keybd */,
+ XkbComponentNamesPtr /* names */,
+ unsigned int /* want */,
+ unsigned int /* need */,
+ XkbFileInfoPtr /* finfoRtrn */,
+ char * /* keymapNameRtrn */,
+ int /* keymapNameRtrnLen */
+);
+
+extern Bool XkbDDXNamesFromRules(
+ DeviceIntPtr /* keybd */,
+ char * /* rules */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */
+);
+
+extern FILE *XkbDDXOpenConfigFile(
+ char * /* mapName */,
+ char * /* fileNameRtrn */,
+ int /* fileNameRtrnLen */
+);
+
+extern Bool XkbDDXApplyConfig(
+ XPointer /* cfg_in */,
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern XPointer XkbDDXPreloadConfig(
+ char ** /* rulesFileRtrn */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */,
+ DeviceIntPtr /* dev */
+);
+
+extern int _XkbStrCaseCmp(
+ char * /* str1 */,
+ char * /* str2 */
+);
+
+#endif /* XKBSRV_NEED_FILE_FUNCS */
+
+
+_XFUNCPROTOEND
+
+#define XkbAtomGetString(d,s) NameForAtom(s)
+
+#endif /* _XKBSRV_H_ */
+
+
diff --git a/kbproto/XKBstr.h b/kbproto/XKBstr.h
new file mode 100644
index 0000000..bc63f49
--- /dev/null
+++ b/kbproto/XKBstr.h
@@ -0,0 +1,614 @@
+/* $Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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.
+
+********************************************************/
+
+#ifndef _XKBSTR_H_
+#define _XKBSTR_H_
+
+#include <X11/extensions/XKB.h>
+
+#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
+#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))
+
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)):\
+ (int)(((h)<<8)|(l)&0x7fff))
+#else
+#define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l)))
+#endif
+
+ /*
+ * Common data structures and access macros
+ */
+
+typedef struct _XkbStateRec {
+ unsigned char group;
+ unsigned char locked_group;
+ unsigned short base_group;
+ unsigned short latched_group;
+ unsigned char mods;
+ unsigned char base_mods;
+ unsigned char latched_mods;
+ unsigned char locked_mods;
+ unsigned char compat_state;
+ unsigned char grab_mods;
+ unsigned char compat_grab_mods;
+ unsigned char lookup_mods;
+ unsigned char compat_lookup_mods;
+ unsigned short ptr_buttons;
+} XkbStateRec,*XkbStatePtr;
+#define XkbModLocks(s) ((s)->locked_mods)
+#define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s))
+#define XkbGroupLock(s) ((s)->locked_group)
+#define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s))
+#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
+#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
+
+typedef struct _XkbMods {
+ unsigned char mask; /* effective mods */
+ unsigned char real_mods;
+ unsigned short vmods;
+} XkbModsRec,*XkbModsPtr;
+
+typedef struct _XkbKTMapEntry {
+ Bool active;
+ unsigned char level;
+ XkbModsRec mods;
+} XkbKTMapEntryRec,*XkbKTMapEntryPtr;
+
+typedef struct _XkbKeyType {
+ XkbModsRec mods;
+ unsigned char num_levels;
+ unsigned char map_count;
+ XkbKTMapEntryPtr map;
+ XkbModsPtr preserve;
+ Atom name;
+ Atom * level_names;
+} XkbKeyTypeRec, *XkbKeyTypePtr;
+
+#define XkbNumGroups(g) ((g)&0x0f)
+#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
+#define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
+#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
+#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
+#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
+
+ /*
+ * Structures and access macros used primarily by the server
+ */
+
+typedef struct _XkbBehavior {
+ unsigned char type;
+ unsigned char data;
+} XkbBehavior;
+
+#define XkbAnyActionDataSize 7
+typedef struct _XkbAnyAction {
+ unsigned char type;
+ unsigned char data[XkbAnyActionDataSize];
+} XkbAnyAction;
+
+typedef struct _XkbModAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbModAction;
+#define XkbModActionVMods(a) \
+ ((short)(((a)->vmods1<<8)|((a)->vmods2)))
+#define XkbSetModActionVMods(a,v) \
+ (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff))
+
+typedef struct _XkbGroupAction {
+ unsigned char type;
+ unsigned char flags;
+ char group_XXX;
+} XkbGroupAction;
+#define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX))
+#define XkbSASetGroup(a,g) ((a)->group_XXX=(g))
+
+typedef struct _XkbISOAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ char group_XXX;
+ unsigned char affect;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbISOAction;
+
+typedef struct _XkbPtrAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char high_XXX;
+ unsigned char low_XXX;
+ unsigned char high_YYY;
+ unsigned char low_YYY;
+} XkbPtrAction;
+#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
+#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
+#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
+#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
+
+typedef struct _XkbPtrBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+} XkbPtrBtnAction;
+
+typedef struct _XkbPtrDfltAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char affect;
+ char valueXXX;
+} XkbPtrDfltAction;
+#define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX))
+#define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff))
+
+typedef struct _XkbSwitchScreenAction {
+ unsigned char type;
+ unsigned char flags;
+ char screenXXX;
+} XkbSwitchScreenAction;
+#define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX))
+#define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff))
+
+typedef struct _XkbCtrlsAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char ctrls3;
+ unsigned char ctrls2;
+ unsigned char ctrls1;
+ unsigned char ctrls0;
+} XkbCtrlsAction;
+#define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),\
+ ((a)->ctrls2=(((c)>>16)&0xff)),\
+ ((a)->ctrls1=(((c)>>8)&0xff)),\
+ ((a)->ctrls0=((c)&0xff)))
+#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\
+ (((unsigned int)(a)->ctrls2)<<16)|\
+ (((unsigned int)(a)->ctrls1)<<8)|\
+ ((unsigned int)((a)->ctrls0)))
+
+typedef struct _XkbMessageAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char message[6];
+} XkbMessageAction;
+
+typedef struct _XkbRedirectKeyAction {
+ unsigned char type;
+ unsigned char new_key;
+ unsigned char mods_mask;
+ unsigned char mods;
+ unsigned char vmods_mask0;
+ unsigned char vmods_mask1;
+ unsigned char vmods0;
+ unsigned char vmods1;
+} XkbRedirectKeyAction;
+
+#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\
+ ((unsigned int)(a)->vmods0))
+#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\
+ ((unsigned int)(a)->vmods_mask0))
+#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+
+typedef struct _XkbDeviceBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+ unsigned char device;
+} XkbDeviceBtnAction;
+
+typedef struct _XkbDeviceValuatorAction {
+ unsigned char type;
+ unsigned char device;
+ unsigned char v1_what;
+ unsigned char v1_ndx;
+ unsigned char v1_value;
+ unsigned char v2_what;
+ unsigned char v2_ndx;
+ unsigned char v2_value;
+} XkbDeviceValuatorAction;
+
+typedef union _XkbAction {
+ XkbAnyAction any;
+ XkbModAction mods;
+ XkbGroupAction group;
+ XkbISOAction iso;
+ XkbPtrAction ptr;
+ XkbPtrBtnAction btn;
+ XkbPtrDfltAction dflt;
+ XkbSwitchScreenAction screen;
+ XkbCtrlsAction ctrls;
+ XkbMessageAction msg;
+ XkbRedirectKeyAction redirect;
+ XkbDeviceBtnAction devbtn;
+ XkbDeviceValuatorAction devval;
+ unsigned char type;
+} XkbAction;
+
+typedef struct _XkbControls {
+ unsigned char mk_dflt_btn;
+ unsigned char num_groups;
+ unsigned char groups_wrap;
+ XkbModsRec internal;
+ XkbModsRec ignore_lock;
+ unsigned int enabled_ctrls;
+ unsigned short repeat_delay;
+ unsigned short repeat_interval;
+ unsigned short slow_keys_delay;
+ unsigned short debounce_delay;
+ unsigned short mk_delay;
+ unsigned short mk_interval;
+ unsigned short mk_time_to_max;
+ unsigned short mk_max_speed;
+ short mk_curve;
+ unsigned short ax_options;
+ unsigned short ax_timeout;
+ unsigned short axt_opts_mask;
+ unsigned short axt_opts_values;
+ unsigned int axt_ctrls_mask;
+ unsigned int axt_ctrls_values;
+ unsigned char per_key_repeat[XkbPerKeyBitArraySize];
+} XkbControlsRec, *XkbControlsPtr;
+
+#define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask)
+#define XkbAX_NeedOption(c,w) ((c)->ax_options&(w))
+#define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w))
+
+typedef struct _XkbServerMapRec {
+ unsigned short num_acts;
+ unsigned short size_acts;
+ XkbAction *acts;
+
+ XkbBehavior *behaviors;
+ unsigned short *key_acts;
+#if defined(__cplusplus) || defined(c_plusplus)
+ /* explicit is a C++ reserved word */
+ unsigned char *c_explicit;
+#else
+ unsigned char *explicit;
+#endif
+ unsigned char vmods[XkbNumVirtualMods];
+ unsigned short *vmodmap;
+} XkbServerMapRec, *XkbServerMapPtr;
+
+#define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
+
+ /*
+ * Structures and access macros used primarily by clients
+ */
+
+typedef struct _XkbSymMapRec {
+ unsigned char kt_index[XkbNumKbdGroups];
+ unsigned char group_info;
+ unsigned char width;
+ unsigned short offset;
+} XkbSymMapRec, *XkbSymMapPtr;
+
+typedef struct _XkbClientMapRec {
+ unsigned char size_types;
+ unsigned char num_types;
+ XkbKeyTypePtr types;
+
+ unsigned short size_syms;
+ unsigned short num_syms;
+ KeySym *syms;
+ XkbSymMapPtr key_sym_map;
+
+ unsigned char *modmap;
+} XkbClientMapRec, *XkbClientMapPtr;
+
+#define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)
+#define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))
+#define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
+#define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
+#define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
+#define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
+#define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
+#define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
+#define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
+
+ /*
+ * Compatibility structures and access macros
+ */
+
+typedef struct _XkbSymInterpretRec {
+ KeySym sym;
+ unsigned char flags;
+ unsigned char match;
+ unsigned char mods;
+ unsigned char virtual_mod;
+ XkbAnyAction act;
+} XkbSymInterpretRec,*XkbSymInterpretPtr;
+
+typedef struct _XkbCompatMapRec {
+ XkbSymInterpretPtr sym_interpret;
+ XkbModsRec groups[XkbNumKbdGroups];
+ unsigned short num_si;
+ unsigned short size_si;
+} XkbCompatMapRec, *XkbCompatMapPtr;
+
+typedef struct _XkbIndicatorMapRec {
+ unsigned char flags;
+ unsigned char which_groups;
+ unsigned char groups;
+ unsigned char which_mods;
+ XkbModsRec mods;
+ unsigned int ctrls;
+} XkbIndicatorMapRec, *XkbIndicatorMapPtr;
+
+#define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&\
+ (((i)->which_groups&&(i)->groups)||\
+ ((i)->which_mods&&(i)->mods.mask)||\
+ ((i)->ctrls)))
+#define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||\
+ ((i)->which_mods)||((i)->ctrls))
+
+
+typedef struct _XkbIndicatorRec {
+ unsigned long phys_indicators;
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbIndicatorRec,*XkbIndicatorPtr;
+
+typedef struct _XkbKeyNameRec {
+ char name[XkbKeyNameLength];
+} XkbKeyNameRec,*XkbKeyNamePtr;
+
+typedef struct _XkbKeyAliasRec {
+ char real[XkbKeyNameLength];
+ char alias[XkbKeyNameLength];
+} XkbKeyAliasRec,*XkbKeyAliasPtr;
+
+ /*
+ * Names for everything
+ */
+typedef struct _XkbNamesRec {
+ Atom keycodes;
+ Atom geometry;
+ Atom symbols;
+ Atom types;
+ Atom compat;
+ Atom vmods[XkbNumVirtualMods];
+ Atom indicators[XkbNumIndicators];
+ Atom groups[XkbNumKbdGroups];
+ XkbKeyNamePtr keys;
+ XkbKeyAliasPtr key_aliases;
+ Atom *radio_groups;
+ Atom phys_symbols;
+
+ unsigned char num_keys;
+ unsigned char num_key_aliases;
+ unsigned short num_rg;
+} XkbNamesRec,*XkbNamesPtr;
+
+typedef struct _XkbGeometry *XkbGeometryPtr;
+ /*
+ * Tie it all together into one big keyboard description
+ */
+typedef struct _XkbDesc {
+ struct _XDisplay * dpy;
+ unsigned short flags;
+ unsigned short device_spec;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+
+ XkbControlsPtr ctrls;
+ XkbServerMapPtr server;
+ XkbClientMapPtr map;
+ XkbIndicatorPtr indicators;
+ XkbNamesPtr names;
+ XkbCompatMapPtr compat;
+ XkbGeometryPtr geom;
+} XkbDescRec, *XkbDescPtr;
+#define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
+#define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
+#define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
+#define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
+#define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
+#define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
+#define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
+#define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
+#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
+#define XkbKeySymEntry(d,k,sl,g) \
+ (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
+#define XkbKeyAction(d,k,n) \
+ (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
+#define XkbKeyActionEntry(d,k,sl,g) \
+ (XkbKeyHasActions(d,k)?\
+ XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
+
+#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
+#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
+#define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
+#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\
+ ((k)<=(d)->max_key_code))
+#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
+
+
+ /*
+ * The following structures can be used to track changes
+ * to a keyboard device
+ */
+typedef struct _XkbMapChanges {
+ unsigned short changed;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+ unsigned char first_type;
+ unsigned char num_types;
+ KeyCode first_key_sym;
+ unsigned char num_key_syms;
+ KeyCode first_key_act;
+ unsigned char num_key_acts;
+ KeyCode first_key_behavior;
+ unsigned char num_key_behaviors;
+ KeyCode first_key_explicit;
+ unsigned char num_key_explicit;
+ KeyCode first_modmap_key;
+ unsigned char num_modmap_keys;
+ KeyCode first_vmodmap_key;
+ unsigned char num_vmodmap_keys;
+ unsigned char pad;
+ unsigned short vmods;
+} XkbMapChangesRec,*XkbMapChangesPtr;
+
+typedef struct _XkbControlsChanges {
+ unsigned int changed_ctrls;
+ unsigned int enabled_ctrls_changes;
+ Bool num_groups_changed;
+} XkbControlsChangesRec,*XkbControlsChangesPtr;
+
+typedef struct _XkbIndicatorChanges {
+ unsigned int state_changes;
+ unsigned int map_changes;
+} XkbIndicatorChangesRec,*XkbIndicatorChangesPtr;
+
+typedef struct _XkbNameChanges {
+ unsigned int changed;
+ unsigned char first_type;
+ unsigned char num_types;
+ unsigned char first_lvl;
+ unsigned char num_lvls;
+ unsigned char num_aliases;
+ unsigned char num_rg;
+ unsigned char first_key;
+ unsigned char num_keys;
+ unsigned short changed_vmods;
+ unsigned long changed_indicators;
+ unsigned char changed_groups;
+} XkbNameChangesRec,*XkbNameChangesPtr;
+
+typedef struct _XkbCompatChanges {
+ unsigned char changed_groups;
+ unsigned short first_si;
+ unsigned short num_si;
+} XkbCompatChangesRec,*XkbCompatChangesPtr;
+
+typedef struct _XkbChanges {
+ unsigned short device_spec;
+ unsigned short state_changes;
+ XkbMapChangesRec map;
+ XkbControlsChangesRec ctrls;
+ XkbIndicatorChangesRec indicators;
+ XkbNameChangesRec names;
+ XkbCompatChangesRec compat;
+} XkbChangesRec, *XkbChangesPtr;
+
+ /*
+ * These data structures are used to construct a keymap from
+ * a set of components or to list components in the server
+ * database.
+ */
+typedef struct _XkbComponentNames {
+ char * keymap;
+ char * keycodes;
+ char * types;
+ char * compat;
+ char * symbols;
+ char * geometry;
+} XkbComponentNamesRec, *XkbComponentNamesPtr;
+
+typedef struct _XkbComponentName {
+ unsigned short flags;
+ char * name;
+} XkbComponentNameRec,*XkbComponentNamePtr;
+
+typedef struct _XkbComponentList {
+ int num_keymaps;
+ int num_keycodes;
+ int num_types;
+ int num_compat;
+ int num_symbols;
+ int num_geometry;
+ XkbComponentNamePtr keymaps;
+ XkbComponentNamePtr keycodes;
+ XkbComponentNamePtr types;
+ XkbComponentNamePtr compat;
+ XkbComponentNamePtr symbols;
+ XkbComponentNamePtr geometry;
+} XkbComponentListRec, *XkbComponentListPtr;
+
+ /*
+ * The following data structures describe and track changes to a
+ * non-keyboard extension device
+ */
+typedef struct _XkbDeviceLedInfo {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int phys_indicators;
+ unsigned int maps_present;
+ unsigned int names_present;
+ unsigned int state;
+ Atom names[XkbNumIndicators];
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr;
+
+typedef struct _XkbDeviceInfo {
+ char * name;
+ Atom type;
+ unsigned short device_spec;
+ Bool has_own_state;
+ unsigned short supported;
+ unsigned short unsupported;
+
+ unsigned short num_btns;
+ XkbAction * btn_acts;
+
+ unsigned short sz_leds;
+ unsigned short num_leds;
+ unsigned short dflt_kbd_fb;
+ unsigned short dflt_led_fb;
+ XkbDeviceLedInfoPtr leds;
+} XkbDeviceInfoRec,*XkbDeviceInfoPtr;
+
+#define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL))
+#define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns))
+#define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL))
+
+typedef struct _XkbDeviceLedChanges {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int defined; /* names or maps changed */
+ struct _XkbDeviceLedChanges *next;
+} XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr;
+
+typedef struct _XkbDeviceChanges {
+ unsigned int changed;
+ unsigned short first_btn;
+ unsigned short num_btns;
+ XkbDeviceLedChangesRec leds;
+} XkbDeviceChangesRec,*XkbDeviceChangesPtr;
+
+#endif /* _XKBSTR_H_ */
diff --git a/kbproto/autogen.sh b/kbproto/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/kbproto/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/kbproto/configure.ac b/kbproto/configure.ac
new file mode 100644
index 0000000..829baea
--- /dev/null
+++ b/kbproto/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([KBProto], [1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ kbproto.pc])
diff --git a/kbproto/kbproto.pc.in b/kbproto/kbproto.pc.in
new file mode 100644
index 0000000..02a6d44
--- /dev/null
+++ b/kbproto/kbproto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: KBProto
+Description: KB extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}