Git init
authorKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:09:26 +0000 (01:09 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:09:26 +0000 (01:09 +0900)
66 files changed:
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0755]
EVI.h [new file with mode: 0644]
EVIproto.h [new file with mode: 0644]
Makefile.am [new file with mode: 0755]
README [new file with mode: 0755]
ag.h [new file with mode: 0644]
agproto.h [new file with mode: 0644]
autogen.sh [new file with mode: 0644]
configure.ac [new file with mode: 0755]
cup.h [new file with mode: 0644]
cupproto.h [new file with mode: 0644]
dbe.h [new file with mode: 0644]
dbeproto.h [new file with mode: 0644]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0755]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0755]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/watch [new file with mode: 0644]
debian/x11proto-xext-dev.install [new file with mode: 0644]
debian/xsfbs/repack.sh [new file with mode: 0644]
debian/xsfbs/xsfbs.mk [new file with mode: 0644]
debian/xsfbs/xsfbs.sh [new file with mode: 0644]
dpmsconst.h [new file with mode: 0644]
dpmsproto.h [new file with mode: 0644]
ge.h [new file with mode: 0755]
geproto.h [new file with mode: 0755]
geproto.txt [new file with mode: 0644]
lbx.h [new file with mode: 0644]
lbxproto.h [new file with mode: 0644]
mitmiscconst.h [new file with mode: 0644]
mitmiscproto.h [new file with mode: 0644]
multibufconst.h [new file with mode: 0644]
multibufproto.h [new file with mode: 0644]
packaging/xorg-x11-proto-xextproto.spec [new file with mode: 0644]
secur.h [new file with mode: 0644]
securproto.h [new file with mode: 0644]
shapeconst.h [new file with mode: 0644]
shapeproto.h [new file with mode: 0644]
shapestr.h [new file with mode: 0755]
shm.h [new file with mode: 0644]
shmproto.h [new file with mode: 0644]
shmstr.h [new file with mode: 0755]
specs/Makefile.am [new file with mode: 0755]
specs/appgroup.xml [new file with mode: 0755]
specs/dbe.xml [new file with mode: 0755]
specs/dpms.xml [new file with mode: 0755]
specs/evi.xml [new file with mode: 0755]
specs/geproto.xml [new file with mode: 0755]
specs/multibuf.xml [new file with mode: 0755]
specs/security.xml [new file with mode: 0755]
specs/shape.xml [new file with mode: 0755]
specs/shm.xml [new file with mode: 0755]
specs/sync.xml [new file with mode: 0755]
specs/tog-cup.xml [new file with mode: 0755]
specs/xtest.xml [new file with mode: 0755]
syncconst.h [new file with mode: 0755]
syncproto.h [new file with mode: 0755]
syncstr.h [new file with mode: 0755]
xextproto.pc.in [new file with mode: 0644]
xtestconst.h [new file with mode: 0644]
xtestext1const.h [new file with mode: 0644]
xtestext1proto.h [new file with mode: 0644]
xtestproto.h [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..23135f9
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,201 @@
+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 (c) 1997 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.
+
+
+Copyright 1992 Network Computing Devices
+
+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 NCD. not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  NCD. makes no representations about the
+suitability of this software for any purpose.  It is provided "as is"
+without express or implied warranty.
+
+NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+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) 1994, 1995  Hewlett-Packard Company
+
+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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard
+Company 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 Hewlett-Packard Company.
+
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+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.
+
+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
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation 
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital 
+Equipment Corporation.
+
+
+Copyright 1988, 1989, 1990, 1994 Network Computing Devices, 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 Network Computing Devices, Inc. not be
+used in advertising or publicity pertaining to distribution of this 
+software without specific, written prior permission.
+
+THIS SOFTWARE IS PROVIDED `AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
+DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
+COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+                        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 names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY 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 1986, 1987, 1988 by Hewlett-Packard Corporation
+
+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 makes no representations about the 
+suitability of this software for any purpose.  It is provided 
+"as is" without express or implied warranty.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+
+
+Copyright Â© 2007-2008 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.
diff --git a/ChangeLog b/ChangeLog
new file mode 100755 (executable)
index 0000000..7163138
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,675 @@
+commit 35741d9dc745532dc4af37cc07e256392e3880da
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Aug 3 11:03:49 2010 -0400
+
+    specs: convert protocol geproto.txt to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 260da6ca1dec9abde11c064d0aeac01f695a1596
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 15:10:04 2010 -0400
+
+    specs: convert protocol xtest.ms from xorg-docs to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 4240526710d837cf06502521ee58c6a4538c6c0e
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 13:43:32 2010 -0400
+
+    specs: convert protocol buffer.ms from xorg-docs to DocBook XML
+    
+    multibuf.xml
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit c86700c0c87de8d6ec7f085d06e9a48558bb5118
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 13:35:26 2010 -0400
+
+    specs: convert protocol evi.ms from xorg-docs to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit f825b85bd8bde4b78c6e3d0b05b713e6f48a2ff5
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 13:28:07 2010 -0400
+
+    specs: convert protocol appgroup.ms from xorg-docs to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 99a5fde423a301167cb825edbf718de7af9f1158
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 13:21:31 2010 -0400
+
+    specs: convert protocol tog-cup.ms from xorg-docs to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit fc2c585ab9bfe0815a917c897e0b463bf04f8475
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 10:46:54 2010 -0400
+
+    specs: convert protocol dpms.ms specs from xorg-docs module to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 7c9b2197cbb0f787b6330243eb777f612251064d
+Author: Matt Dew <matt@osource.org>
+Date:   Mon Aug 2 10:40:47 2010 -0400
+
+    specs: convert protocol shm.ms specs from xorg-docs module to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit cf083a0d35da6665b2aebc6eea4f65009c32411b
+Author: Matt Dew <matt@osource.org>
+Date:   Sun Aug 1 20:41:48 2010 -0400
+
+    specs: convert protocol shape.ms specs from xorg-docs module to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 69996150256954ef71c45ee7727fea96e02f8db2
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Jun 30 13:39:21 2010 -0400
+
+    specs: move geproto.txt in the specs directory
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 3f1718e39c73475fb8384e61b6dc78f313d926f9
+Author: Matt Dew <matt@osource.org>
+Date:   Wed Jun 30 13:21:28 2010 -0400
+
+    specs: convert protocol .ms specs from xorg-docs module to DocBook XML
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit c4595fad1d79c0957d3f4dff6ef56d72ae8cc38d
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date:   Tue Mar 30 09:54:26 2010 -0700
+
+    XGE: Don't reserve an extension event.
+    
+    The Generic Event Extension extension uses the "GenericEvent" core event type,
+    so it doesn't need to also reserve an extension event.
+    
+    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5f2cc1e2b99d45a612204a86583abb386907be04
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:25:52 2010 -0400
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 21f7dc38add3bda551216a0fa6319d9f3f9af99a
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:00:31 2010 -0400
+
+    config: remove the pkgconfig pc.in file from EXTRA_DIST
+    
+    Automake always includes it in the tarball.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 650615405c327398b5708787bc19198cbb864d20
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 17:51:29 2010 -0400
+
+    config: install and distribute geproto.txt
+    
+    It will now be installed in $docdir in addition
+    to being distributed in the tarball.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 37f6affde561251df61c7011f9d1d83b006d2fbe
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 22 19:24:48 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit e9fa939ef8515bca5f8cde85a91b3ae0ae456de7
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Nov 16 11:13:30 2009 -0500
+
+    README: file created or updated #24206
+    
+    Contains a set of URLs to freedesktop.org.
+
+commit 3690603986929a706acd76fc0b33132fe0178129
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 19:45:27 2009 -0500
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit e52cb6ef1baa65c1688b3160727214efae57b0e2
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:31:29 2009 -0500
+
+    Makefile.am: INSTALL file is missing or incorrect #24206
+    
+    The standard GNU file on building/installing  tarball is copied
+    using the XORG_INSTALL macro contained in XORG_DEFAULT_OPTIONS
+    Add INSTALL target
+
+commit bfaecf2a80ef1bcbfa6243fdb1bfc2e335f86a10
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:11:36 2009 -0500
+
+    configure.ac: deploy the new XORG_DEFAULT_OPTIONS #24242
+    
+    This macro aggregate a number of existing macros that sets commmon
+    X.Org components configuration options. It shields the configuration file from
+    future changes.
+
+commit 182e739d8ff1f9bb8ddb8fcff8737dabde96c47f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 13:55:25 2009 -0500
+
+    configure.ac: AM_MAINTAINER_MODE missing #24238
+    
+    This turns off maintainer mode build rules in tarballs.
+    Works in conjunction with autogen.sh --enable-maintainer-mode
+
+commit 4b0b3afee88fdefaab2d9aa690dc5dc465964316
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Nov 14 18:26:47 2009 -0500
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 9d5e140111ef0e7e0c9d30d7e0acf8c43a248816
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Nov 3 14:41:33 2009 -0800
+
+    Allow old servers to build with new headers
+    
+    This provides header compatibility back to X server version 1.6 at
+    least (that's all I tested).
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 987aeb9bd1915a655f31e250ee9c02d04927b150
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Aug 25 09:30:15 2009 +1000
+
+    xextproto 7.1.1
+
+commit 55a0bbdde9b27b8dbc6e75d41c51af3f92dea6e3
+Author: Eduard Bagrov <ebagrov@linuxtesting.org>
+Date:   Fri Aug 21 18:48:19 2009 +0200
+
+    Fix XSyncValueSubtract typo
+    
+    X.Org bug#23438 <http://bugs.freedesktop.org/show_bug.cgi?id=23438>
+    
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+
+commit 23ac4d5235862d51f0cfb080ad2118a9fb181673
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Aug 5 15:09:11 2009 +1000
+
+    xextproto 7.1.0
+
+commit 5ffa318ddb35308e3a87122bfb3944e3201532ba
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Aug 5 15:06:52 2009 +1000
+
+    lbxproto: remove debug macro and definition of lbxDebug.
+    
+    This should not be in the protocol headers.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5a266968b1ced367df1a47dc9729313c85be0516
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jul 22 20:26:35 2009 +1000
+
+    Bump to 7.0.99.3
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d7ead7a591da851f6bb2efecdd35b63836df4ed0
+Author: Magnus Kessler <Magnus.Kessler@gmx.net>
+Date:   Wed Jul 22 09:37:38 2009 +0100
+
+    Rename xtest.h to xtestconst.h to avoid a collision with XTest.h on case-insensitive filesystems
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2fd05eca7dd501c58b284d9cceb73d6146672b0a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jul 21 13:35:58 2009 +1000
+
+    Bump to 7.0.99.2
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a049c37f789f881fad09e60a061488cba2b4072e
+Author: Jon TURNEY <jon.turney@dronecode.org.uk>
+Date:   Mon Jul 20 22:42:59 2009 +0100
+
+    Rename mitmisc.h to mitmiscconst.h to avoid a collision with MITMisc.h on case-insensitive filesystems
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 609c3b03fbed24f05d636d98dad9febc7226624c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jul 15 16:28:12 2009 +1000
+
+    Remove RCS tags.
+
+commit 6e9e47edf97a0bb504b4b65f5ef066f3d5e3d34b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jul 15 16:20:13 2009 +1000
+
+    Bump to 7.0.99.1
+
+commit ef8766e44c5cdd1e3ba7ebabf576e2de77f57a09
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:43:12 2009 +1000
+
+    xtestext1: split xtestext1.h header into xtestext1proto.h
+
+commit a1f0b58efce74176c71070818fa98c25021bb25e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:36:22 2009 +1000
+
+    sync: remove sync.h library header, split into syncconst.h
+    
+    Rename syncstr.h to syncproto.h
+
+commit 35ec2669091197a4e5b3c56d79ea26ae87759b16
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:32:29 2009 +1000
+
+    shape: remove shape.h, split into shapeconst.h
+    
+    Rename shapestr.h to shapeproto.h
+
+commit 7cfdafd5ec565502a40e9e1f5b3edbb2be6aafbc
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:30:17 2009 +1000
+
+    security: remove security.h, split into secur.h
+    
+    Rename securstr.h to securproto.h
+
+commit 19f527b4abe17b58dd78ec988a11c8081166cf01
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:28:02 2009 +1000
+
+    multibuf: remove multibuf.h, split into multibufconst.h
+
+commit 4b7fff5309f3e51e17372e3eaf91ee01c00ffd08
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:19:04 2009 +1000
+
+    remove extutil.h, pure library header
+
+commit 0af7f152239a0f14fc85acd146845c784bb1cd6a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:18:06 2009 +1000
+
+    dpms: remove dpms.h library header, split into dpmsconst.h
+
+commit ac0dfab3fe1ae9c9633696825636a4bcfa14dfd6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:14:14 2009 +1000
+
+    Remove Xext.h and Xge.h - pure library headers.
+
+commit 413572e112e24aa7a28632e13a8aa15c9fdaa57e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:10:01 2009 +1000
+
+    Xdbe: remove Xdbe.h library header, split into dbe.h
+    
+    Rename Xdbeproto to dbeproto.h
+
+commit d2574e8804a204653bda1786c1ece3437f7901a2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 11:04:12 2009 +1000
+
+    Xcup: remove XCup.h library header, split into cup.h
+    
+    Rename Xcupstr.h to cupproto.h
+
+commit 38daa9d8d9d86f3b9df12dd5032959822b7c0a45
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:59:10 2009 +1000
+
+    Xag: remove Xag.h library header, split into Xagconst.h
+
+commit 8cb2568c4a7df1eb0482009bf9150912e98969e6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:54:21 2009 +1000
+
+    XTest: remove XTest.h, split into xtest.h and xtestproto.h
+    
+    To avoid conflicts, xtest.h uses a XTEST_CONST_H include barrier.
+
+commit c63abdd1eb7bc1d8ae4e25073ef2f29d94991e2b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:46:33 2009 +1000
+
+    XShm: remove XShm.h library header, split into shm.h, shmproto.h
+    
+    Removing Xlib function prototypes.
+    Move extension name to shm.h
+    Move protocol request opcodes to shmproto.h
+
+commit 0adb09e032e3bd56426620b19438be9c0c66dd54
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:43:32 2009 +1000
+
+    XLbx: remove XLbx library headers, split into lbx.h, lbxproto.h
+    
+    Remove Xlib function prototypes.
+    Move extension name into lbx.h, move protocol opcodes into lbxproto.h
+
+commit 727003b51844dd1bd41b668bedfa92d2bb7ef964
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:30:40 2009 +1000
+
+    XEVI: remove XEVI.h library header, split into EVIproto.h
+    
+    Remove Xlib function prototypes.
+    Move protocol opcodes to EVIproto.h
+    Move extension name from EVIproto.h into EVI.h
+
+commit 3770d4bd035e43c8e2228d45184d9d398fccb325
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 25 10:24:57 2009 +1000
+
+    MITMisc: remove MITMisc.h library header, split into mitmistproto.h
+    
+    Moving extension name from mitmiststr.h into mitmisc.h.
+    Removing Xlib function prototypes from mitmisc.h.
+    Moving protocol request opcodes into mitmiscproto.h
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 57d09e47d05fce0d6df4060b2eff9a8efcc25b2f
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Jul 15 13:41:36 2009 -0400
+
+    Remove most LBX headers.
+    
+    XLbx.h and lbxstr.h are required for libXext to build, and we're not
+    allowed to remove API from that.
+
+commit 7629def0733b82687f2879095451d72e42e13db7
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Sat Mar 28 14:20:38 2009 -0400
+
+    C sucks: define XEventClass in terms of unsigned int, not CARD32.
+    
+    Apparently pulling in Xmd.h here breaks qt, since they both define an
+    INT32 type (and incompatible ones even, since Xmd's is unsigned long on
+    ILP32 because whoever wrote Xmd.h is a C novice).
+    
+    (Based on inputproto commit b5cbe2d93f6c0129b8f29da97778f6d1b15c38f9.
+    Patch submitted to xorg@ in <20090117121713.46bf3332@family.dyweni.com>.)
+
+commit ac98d8c559dc798f09e35d13f51cb1116c6378bb
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jan 29 16:22:20 2009 -0200
+
+    Bump to libXext Version 7.0.5.
+    
+      Add required change to correct #18038
+    (patch to avoid gcc warning in libXext)
+
+commit 8b5b82ec72dd6952d0664655715a0a47951454f4
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 27 20:06:28 2009 -0200
+
+    Janitor: Correct make distcheck and dont distribute autogen.sh
+
+commit fa652c6013a5d3ae8106814d97245fdbac3557ac
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Dec 23 16:16:46 2008 +0100
+
+    Add geproto.txt to EXTRA_DIST
+
+commit bd7f3e16b5a5520f0abb8c481f23a19219d26c7f
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Dec 23 15:45:13 2008 +0100
+
+    COPYING: add Peter Hutterer's license and copyright notice
+    
+    Taken from Xge.h
+
+commit e1773d8ad7d36535f856dcb308be9a1b0601c1fc
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Dec 18 10:10:42 2008 +1000
+
+    Bump to 7.0.4
+
+commit e7f0c4261c59da82da1c151dd1bd0d143a32906a
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Dec 1 14:44:03 2008 +1000
+
+    Clean up XGE documentation.
+
+commit b0080664e432f8ee569ce099a536c0232dd64d3e
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Dec 1 15:41:16 2008 +1000
+
+    geproto: remote trailing whitespaces.
+
+commit f7e5f23e37e62cc0a981d9b002b69d90b8a7daa9
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 14:54:19 2008 +0930
+
+    Xge.h: include Xmd.h for CARD8
+
+commit db08133016b421ef12c65db9c4a2819078f01b06
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed May 28 17:18:14 2008 +0930
+
+    Bump to 7.0.3.
+
+commit 801650f0d15b4497c63d056559ad98a8ca82f271
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon May 12 17:26:02 2008 +0930
+
+    Xge: replace copyrights with standard format from xserver COPYING.
+
+commit 9dc48efe2b3136756613ae00afd706f9a52d6f10
+Merge: 69356e4 a07a30f
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon May 12 17:22:14 2008 +0930
+
+    Merge branch 'master' into xge
+
+commit a07a30f9922e9768e2cf00cc2e479978242c58a8
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:39:10 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 087c2ccc7e348e530422a578059173c959aa5a78
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:54:25 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 69356e4165f11f3ed4b377d29df038549191a91e
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Thu May 17 19:40:15 2007 +0930
+
+    Add XGE header files and protocol description.
+
+commit 88c24404b44def76a56f52a216a8cf2e0991c3e6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 14 18:56:41 2006 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit a63b4a9d7ebc5929ce9172b10743396cd36addb8
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jun 27 16:25:22 2006 +0000
+
+    Remove Xserver API for appgroup extension [Will break Xorg server builds
+        prior to 2006-06-21 / git commit
+    77c947b900faf34f425eef1549d8210c475e093b]
+
+commit 7bcd3400a8043dee6399680ddc6592747b30f599
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Wed Jun 21 21:20:22 2006 +0000
+
+    Remove Xserver API for security extension (#ifdef _SECURITY_SERVER) [Will
+        break Xorg server builds prior to 2006-06-20 / git commit
+        d44b2a0a57fb89741173c31676af0ccc822387dc]
+
+commit cb67dc36362b018f3a9faa5c4558ce99dbfb2334
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:39 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 9f8dd222022cfafe3ca6467e02232af7d4d7934b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:48:15 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit cba4432f0d088517f2475881e93cf4dda96a7f94
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Tue Aug 2 19:19:40 2005 +0000
+
+    Add basic .cvsignore files for proto modules.
+
+commit 790de7da644c6f9114a715b99789253a9c79b0a5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:57 2005 +0000
+
+    Various changes preparing packages for RC0:
+    - Verify and update package version numbers as needed
+    - Implement versioning scheme
+    - Change bug address to point to bugzilla bug entry form
+    - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+        reenable it)
+    - Fix makedepend to use pkgconfig and pass distcheck
+    - Update build script to build macros first
+    - Update modular Xorg version
+
+commit cf67142f46ec2f754f2b3347b21139b66b7167cf
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri Jun 10 04:01:14 2005 +0000
+
+    Bug #2799: Input shape. (Keith Packard)
+
+commit b855e49cf845cf814fa1d8a9abcd65cb14356644
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu May 19 00:22:40 2005 +0000
+
+    revert last change, didn't do right thing at all, sorry for the noise
+
+commit 1e1659043f908d2e648d0ee73f7f33f5fc79813b
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu May 19 00:10:19 2005 +0000
+
+    Require automake 1.7 in AM_INIT_AUTOMAKE
+
+commit 1d316d39381cf0981b2f9687cd2f0200c92961ea
+Author: Josh Triplett <josh@speakeasy.net>
+Date:   Wed May 18 08:09:13 2005 +0000
+
+    Add COPYING file for XExt. Note that there are several similar but
+        subtly-different licenses included; in particular, there are some
+        copyright holders with multiple slightly-different licenses included.
+
+commit f3c7759e6dc671ab6db160e739d00133e9996296
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Mon May 9 18:20:06 2005 +0000
+
+    Change all the protonames from <extension>Ext to <extension>Proto.
+
+commit 474a31667a8addb29a0f115790df2910400c4081
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri May 6 01:46:32 2005 +0000
+
+    Initial build system files for proto module.
+
+commit be09530f849ec00001fc0575816030b7a5dde05c
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Tue Dec 7 23:37:37 2004 +0000
+
+    //bugs.freedesktop.org/show_bug.cgi?id=830): Get DPMS header file
+        (include/extensions/dpms.h) working with C++ applications. Patch by
+        Kevin DeKorte <kdekorte@yahoo.com> and Roland Mainz
+        <roland.mainz@nrubsig.org>.
+
+commit da24110547ed45c08d707dbffb2972f043dbc1b1
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 18:43:06 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 8fc2a0fd8ac1b777a35b01d65934ee100b304d20
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:31:36 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit e7af2a9e4c47a46b3a68a2efebb171dc7872c341
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:10:54 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit abb02cac08ca1d7d3a64b361df5d1be6f15c6440
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:35:14 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit c9d6200d559e57f4ca67291213cd282c7437c3c7
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:22:28 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 023a09fe640f876478157e5b4cd9cfec1452da4b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:28:02 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 343e78e15048e6a25791449bfc7566c07ccddf28
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:43 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 9a41c9c6452753ac1911a585e59982e8e5186c6b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:35 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/EVI.h b/EVI.h
new file mode 100644 (file)
index 0000000..7f3f733
--- /dev/null
+++ b/EVI.h
@@ -0,0 +1,36 @@
+/************************************************************
+Copyright (c) 1997 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 _EVI_H_
+#define _EVI_H_
+
+#define XEVI_TRANSPARENCY_NONE         0
+#define XEVI_TRANSPARENCY_PIXEL                1
+#define XEVI_TRANSPARENCY_MASK         2
+
+#define EVINAME "Extended-Visual-Information"
+
+#define XEVI_MAJOR_VERSION     1       /* current version numbers */
+#define XEVI_MINOR_VERSION     0
+
+#endif
diff --git a/EVIproto.h b/EVIproto.h
new file mode 100644 (file)
index 0000000..afa282a
--- /dev/null
@@ -0,0 +1,96 @@
+/************************************************************
+Copyright (c) 1997 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 _EVIPROTO_H_
+#define _EVIPROTO_H_
+
+#include <X11/extensions/EVI.h>
+
+#define X_EVIQueryVersion              0
+#define X_EVIGetVisualInfo             1
+
+#define VisualID CARD32
+
+typedef CARD32 VisualID32;
+#define sz_VisualID32 4
+
+typedef struct _xExtendedVisualInfo {
+    VisualID   core_visual_id B32;
+    INT8       screen;
+    INT8       level;
+    CARD8      transparency_type;
+    CARD8      pad0;
+    CARD32     transparency_value B32;
+    CARD8      min_hw_colormaps;
+    CARD8      max_hw_colormaps;
+    CARD16     num_colormap_conflicts B16;
+} xExtendedVisualInfo;
+#define sz_xExtendedVisualInfo 16
+
+typedef struct _XEVIQueryVersion {
+    CARD8      reqType;                /* always XEVIReqCode */
+    CARD8      xeviReqType;            /* always X_EVIQueryVersion */
+    CARD16     length B16;
+} xEVIQueryVersionReq;
+#define sz_xEVIQueryVersionReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     majorVersion B16;       /* major version of EVI protocol */
+    CARD16     minorVersion B16;       /* minor version of EVI protocol */
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xEVIQueryVersionReply;
+#define sz_xEVIQueryVersionReply       32
+
+typedef struct _XEVIGetVisualInfoReq {
+    CARD8      reqType;        /* always XEVIReqCode */
+    CARD8      xeviReqType;    /* always X_EVIGetVisualInfo */
+    CARD16      length B16;
+    CARD32     n_visual B32;
+} xEVIGetVisualInfoReq;
+#define sz_xEVIGetVisualInfoReq        8
+
+typedef struct _XEVIGetVisualInfoReply {
+    BYTE       type;  /* X_Reply */
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     n_info B32;
+    CARD32     n_conflicts B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+} xEVIGetVisualInfoReply;
+#define sz_xEVIGetVisualInfoReply      32
+
+#undef VisualID
+
+#endif /* _EVIPROTO_H_ */
diff --git a/Makefile.am b/Makefile.am
new file mode 100755 (executable)
index 0000000..bbe5dd4
--- /dev/null
@@ -0,0 +1,59 @@
+SUBDIRS=specs
+
+xextdir = $(includedir)/X11/extensions
+xext_HEADERS = \
+       dpmsconst.h \
+       dpmsproto.h \
+        ge.h \
+        geproto.h \
+       lbx.h \
+       lbxproto.h \
+       mitmiscconst.h \
+       mitmiscproto.h \
+       multibufconst.h \
+       multibufproto.h \
+       secur.h \
+       securproto.h \
+       shapeconst.h \
+       shapeproto.h \
+       shm.h \
+       shmproto.h \
+       syncconst.h \
+       syncproto.h \
+       ag.h \
+       agproto.h \
+       cup.h \
+       cupproto.h \
+       dbe.h \
+       dbeproto.h \
+       EVI.h \
+       EVIproto.h \
+       xtestext1proto.h \
+       xtestext1const.h \
+       xtestconst.h \
+       xtestproto.h
+
+#
+# These headers allow old servers to be built with
+# new headers
+#
+compatdir = $(xextdir)
+compat_HEADERS = \
+       shapestr.h \
+       shmstr.h \
+       syncstr.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xextproto.pc
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/README b/README
new file mode 100755 (executable)
index 0000000..bb6fc79
--- /dev/null
+++ b/README
@@ -0,0 +1,42 @@
+                               X Protocol Extensions
+
+Extension names:
+
+DOUBLE-BUFFER
+DPMS
+Extended-Visual-Information
+Generic Event Extension
+LBX
+MIT-SHM
+MIT-SUNDRY-NONSTANDARD
+Multi-Buffering
+SECURITY
+SHAPE
+SYNC
+TOG-CUP
+XC-APPGROUP
+XTEST
+
+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/xextproto
+
+        http://cgit.freedesktop.org/xorg/proto/xextproto
+
+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/ag.h b/ag.h
new file mode 100644 (file)
index 0000000..be5883a
--- /dev/null
+++ b/ag.h
@@ -0,0 +1,52 @@
+/*
+Copyright 1996, 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 _AG_H_
+#define _AG_H_
+
+#define XAGNAME "XC-APPGROUP"
+
+#define XAG_MAJOR_VERSION      1       /* current version numbers */
+#define XAG_MINOR_VERSION      0
+
+#define XagWindowTypeX11       0
+#define XagWindowTypeMacintosh 1
+#define XagWindowTypeWin32     2
+#define XagWindowTypeWin16     3
+
+#define XagBadAppGroup                 0
+#define XagNumberErrors                        (XagBadAppGroup + 1)
+
+#define XagNsingleScreen               7
+#define XagNdefaultRoot                        1
+#define XagNrootVisual                 2
+#define XagNdefaultColormap            3
+#define XagNblackPixel                 4
+#define XagNwhitePixel                 5
+#define XagNappGroupLeader             6
+
+#endif /* _AG_H_ */
+
diff --git a/agproto.h b/agproto.h
new file mode 100644 (file)
index 0000000..1086661
--- /dev/null
+++ b/agproto.h
@@ -0,0 +1,178 @@
+/*
+Copyright 1996, 1998, 2001  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 _AGPROTO_H_ /* { */
+#define _AGPROTO_H_
+
+#include <X11/extensions/ag.h>
+
+#define X_XagQueryVersion              0
+#define X_XagCreate                    1
+#define X_XagDestroy                   2
+#define X_XagGetAttr                   3
+#define X_XagQuery                     4
+#define X_XagCreateAssoc               5
+#define X_XagDestroyAssoc              6
+
+#define XAppGroup CARD32
+
+/*
+* Redefine some basic types used by structures defined herein.  This allows
+* both the library and server to view communicated data as 32-bit entities,
+* thus preventing problems on 64-bit architectures where libXext sees this
+* data as 64 bits and the server sees it as 32 bits.
+*/
+
+#define Colormap CARD32
+#define VisualID CARD32
+#define Window CARD32
+
+typedef struct _XagQueryVersion {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagQueryVersion */
+    CARD16     length B16;
+    CARD16     client_major_version B16;
+    CARD16     client_minor_version B16;
+} xXagQueryVersionReq;
+#define sz_xXagQueryVersionReq         8
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    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;
+} xXagQueryVersionReply;
+#define sz_xXagQueryVersionReply       32
+
+/* Set AppGroup Attributes masks */
+#define XagSingleScreenMask            1 << 0
+#define XagDefaultRootMask             1 << XagNdefaultRoot
+#define XagRootVisualMask              1 << XagNrootVisual
+#define XagDefaultColormapMask         1 << XagNdefaultColormap
+#define XagBlackPixelMask              1 << XagNblackPixel
+#define XagWhitePixelMask              1 << XagNwhitePixel
+#define XagAppGroupLeaderMask          1 << XagNappGroupLeader
+
+typedef struct _XagCreate {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagCreate */
+    CARD16     length B16;
+    XAppGroup  app_group B32;
+    CARD32     attrib_mask B32; /* LISTofVALUE follows */
+} xXagCreateReq;
+#define sz_xXagCreateReq               12
+
+typedef struct _XagDestroy {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagDestroy */
+    CARD16     length B16;
+    XAppGroup  app_group  B32;
+} xXagDestroyReq;
+#define sz_xXagDestroyReq              8
+
+typedef struct _XagGetAttr {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagGetAttr */
+    CARD16     length B16;
+    XAppGroup  app_group B32;
+} xXagGetAttrReq;
+#define sz_xXagGetAttrReq              8
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    BOOL       pad1;
+    CARD16     sequence_number B16;
+    CARD32     length B32;
+    Window     default_root B32;
+    VisualID   root_visual B32;
+    Colormap   default_colormap B32;
+    CARD32     black_pixel B32;
+    CARD32     white_pixel B32;
+    BOOL       single_screen;
+    BOOL       app_group_leader;
+    CARD16     pad2 B16;
+} xXagGetAttrReply;
+#define sz_xXagGetAttrReply            32
+
+typedef struct _XagQuery {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagQuery */
+    CARD16     length B16;
+    CARD32     resource B32;
+} xXagQueryReq;
+#define sz_xXagQueryReq                        8
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    BOOL       pad1;
+    CARD16     sequence_number B16;
+    CARD32     length B32;
+    XAppGroup  app_group B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xXagQueryReply;
+#define sz_xXagQueryReply              32
+
+typedef struct _XagCreateAssoc {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagCreateAssoc */
+    CARD16     length B16;
+    Window     window B32;
+    CARD16     window_type B16;
+    CARD16     system_window_len B16; /* LISTofCARD8 follows */
+} xXagCreateAssocReq;
+#define sz_xXagCreateAssocReq          12
+
+typedef struct _XagDestroyAssoc {
+    CARD8      reqType;        /* always XagReqCode */
+    CARD8      xagReqType;     /* always X_XagDestroyAssoc */
+    CARD16     length B16;
+    Window     window B32;
+} xXagDestroyAssocReq;
+#define sz_xXagDestroyAssocReq         8
+
+#undef XAppGroup
+/*
+ * Cancel the previous redefinition of the basic types, thus restoring their
+ * X.h definitions.
+ */
+
+#undef Window
+#undef Colormap
+#undef VisualID
+
+#endif /* } _AGPROTO_H_ */
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100644 (file)
index 0000000..904cd67
--- /dev/null
@@ -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/configure.ac b/configure.ac
new file mode 100755 (executable)
index 0000000..41269a3
--- /dev/null
@@ -0,0 +1,18 @@
+AC_PREREQ([2.60])
+AC_INIT([XExtProto], [7.1.99.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros minimum of 1.10 for DocBook XML documentation
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.10)
+XORG_DEFAULT_OPTIONS
+XORG_ENABLE_SPECS
+XORG_WITH_XMLTO(0.0.20)
+XORG_WITH_FOP
+XORG_CHECK_SGML_DOCTOOLS(1.5)
+
+AC_OUTPUT([Makefile
+           specs/Makefile
+           xextproto.pc])
diff --git a/cup.h b/cup.h
new file mode 100644 (file)
index 0000000..cbbc34b
--- /dev/null
+++ b/cup.h
@@ -0,0 +1,38 @@
+/*
+
+Copyright 1987, 1988, 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 _CUP_H_
+#define _CUP_H_
+
+#define XCUPNAME "TOG-CUP"
+
+#define XCUP_MAJOR_VERSION     1       /* current version numbers */
+#define XCUP_MINOR_VERSION     0
+
+#define XcupNumberErrors                       0
+
+#endif /* _CUP_H_ */
+
diff --git a/cupproto.h b/cupproto.h
new file mode 100644 (file)
index 0000000..f61c9f0
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+
+Copyright 1987, 1988, 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 _XCUPPROTO_H_ /* { */
+#define _XCUPPROTO_H_
+
+#include <X11/extensions/cup.h>
+
+#define X_XcupQueryVersion                     0
+#define X_XcupGetReservedColormapEntries       1
+#define X_XcupStoreColors                      2
+
+typedef struct _XcupQueryVersion {
+    CARD8      reqType;        /* always XcupReqCode */
+    CARD8      xcupReqType;    /* always X_XcupQueryVersion */
+    CARD16     length B16;
+    CARD16     client_major_version B16;
+    CARD16     client_minor_version B16;
+} xXcupQueryVersionReq;
+#define sz_xXcupQueryVersionReq                8
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    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;
+} xXcupQueryVersionReply;
+#define sz_xXcupQueryVersionReply      32
+
+typedef struct _XcupGetReservedColormapEntries {
+    CARD8      reqType;        /* always XcupReqCode */
+    CARD8      xcupReqType;    /* always X_XcupGetReservedColormapEntries */
+    CARD16     length B16;
+    CARD32     screen B32;
+} xXcupGetReservedColormapEntriesReq;
+#define sz_xXcupGetReservedColormapEntriesReq 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;
+} xXcupGetReservedColormapEntriesReply;
+#define sz_xXcupGetReservedColormapEntriesReply                32
+
+typedef struct _XcupStoreColors {
+    CARD8      reqType;        /* always XcupReqCode */
+    CARD8      xcupReqType;    /* always X_XcupStoreColors */
+    CARD16     length B16;
+    CARD32     cmap B32;
+} xXcupStoreColorsReq;
+#define sz_xXcupStoreColorsReq         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;
+} xXcupStoreColorsReply;
+#define sz_xXcupStoreColorsReply       32
+
+#endif /* } _XCUPPROTO_H_ */
+
diff --git a/dbe.h b/dbe.h
new file mode 100644 (file)
index 0000000..7968552
--- /dev/null
+++ b/dbe.h
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ * Copyright (c) 1994, 1995  Hewlett-Packard Company
+ *
+ * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard
+ * Company 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 Hewlett-Packard Company.
+ *
+ *     Header file for Xlib-related DBE
+ *
+ *****************************************************************************/
+
+#ifndef DBE_H
+#define DBE_H
+
+/* Values for swap_action field of XdbeSwapInfo structure */
+#define XdbeUndefined    0
+#define XdbeBackground   1
+#define XdbeUntouched    2
+#define XdbeCopied       3
+
+/* Errors */
+#define XdbeBadBuffer    0
+
+#define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
+
+/* Current version numbers */
+#define DBE_MAJOR_VERSION       1
+#define DBE_MINOR_VERSION       0
+
+/* Used when adding extension; also used in Xdbe macros */
+#define DbeNumberEvents                        0
+#define DbeBadBuffer                   0
+#define DbeNumberErrors                        (DbeBadBuffer + 1)
+
+#endif /* DBE_H */
+
diff --git a/dbeproto.h b/dbeproto.h
new file mode 100644 (file)
index 0000000..784926e
--- /dev/null
@@ -0,0 +1,224 @@
+/******************************************************************************
+ *
+ * Copyright (c) 1994, 1995  Hewlett-Packard Company
+ *
+ * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard
+ * Company 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 Hewlett-Packard Company.
+ *
+ *     Header file for Xlib-related DBE
+ *
+ *****************************************************************************/
+
+#ifndef DBE_PROTO_H
+#define DBE_PROTO_H
+
+#include <X11/extensions/dbe.h>
+
+/* Request values used in (S)ProcDbeDispatch() */
+#define X_DbeGetVersion                 0
+#define X_DbeAllocateBackBufferName     1
+#define X_DbeDeallocateBackBufferName   2
+#define X_DbeSwapBuffers                3
+#define X_DbeBeginIdiom                 4
+#define X_DbeEndIdiom                   5
+#define X_DbeGetVisualInfo              6
+#define X_DbeGetBackBufferAttributes    7
+
+typedef CARD8  xDbeSwapAction;
+typedef CARD32 xDbeBackBuffer;
+
+/* TYPEDEFS */
+
+/* Protocol data types */
+
+typedef struct
+{
+    CARD32             window B32;     /* window      */
+    xDbeSwapAction     swapAction;     /* swap action */
+    CARD8              pad1;           /* unused      */
+    CARD16             pad2 B16;
+
+} xDbeSwapInfo;
+
+typedef struct
+{
+    CARD32     visualID B32;   /* associated visual      */
+    CARD8      depth;          /* depth of visual        */
+    CARD8      perfLevel;      /* performance level hint */
+    CARD16     pad1 B16;
+
+} xDbeVisInfo;
+#define sz_xDbeVisInfo 8
+
+typedef struct
+{
+    CARD32     n B32;  /* number of visual info items in list  */
+
+} xDbeScreenVisInfo;   /* followed by n xDbeVisInfo items */
+
+typedef struct
+{
+    CARD32     window B32;     /* window */
+
+} xDbeBufferAttributes;
+
+
+/* Requests and replies */
+
+typedef struct
+{
+    CARD8      reqType;        /* major-opcode: always codes->major_opcode */
+    CARD8      dbeReqType;     /* minor-opcode: always X_DbeGetVersion (0) */
+    CARD16     length B16;     /* request length: (2)                      */
+    CARD8      majorVersion;   /* client-major-version                     */
+    CARD8      minorVersion;   /* client-minor-version                     */
+    CARD16     unused B16;     /* unused                                   */
+
+} xDbeGetVersionReq;
+#define sz_xDbeGetVersionReq   8
+
+typedef struct
+{
+    BYTE       type;                   /* Reply: X_Reply (1)   */
+    CARD8      unused;                 /* unused               */
+    CARD16     sequenceNumber B16;     /* sequence number      */
+    CARD32     length B32;             /* reply length: (0)    */
+    CARD8      majorVersion;           /* server-major-version */
+    CARD8      minorVersion;           /* server-minor-version */
+    CARD16     pad1 B16;               /* unused               */
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+
+} xDbeGetVersionReply;
+#define sz_xDbeGetVersionReply 32
+
+typedef struct
+{
+    CARD8              reqType;        /* major-opcode: codes->major_opcode */
+    CARD8              dbeReqType;     /* X_DbeAllocateBackBufferName (1)   */
+    CARD16             length B16;     /* request length: (4)               */
+    CARD32             window B32;     /* window                            */
+    xDbeBackBuffer     buffer B32;     /* back buffer name                  */
+    xDbeSwapAction     swapAction;     /* swap action hint                  */
+    CARD8              pad1;           /* unused                            */
+    CARD16             pad2 B16;
+
+} xDbeAllocateBackBufferNameReq;
+#define sz_xDbeAllocateBackBufferNameReq       16
+
+typedef struct
+{
+    CARD8              reqType;        /* major-opcode: codes->major_opcode */
+    CARD8              dbeReqType;     /* X_DbeDeallocateBackBufferName (2) */
+    CARD16             length B16;     /* request length: (2)               */
+    xDbeBackBuffer     buffer B32;     /* back buffer name                  */
+
+} xDbeDeallocateBackBufferNameReq;
+#define sz_xDbeDeallocateBackBufferNameReq     8
+
+typedef struct
+{
+    CARD8      reqType;        /* major-opcode: always codes->major_opcode  */
+    CARD8      dbeReqType;     /* minor-opcode: always X_DbeSwapBuffers (3) */
+    CARD16     length B16;     /* request length: (2+2n)                    */
+    CARD32     n B32;          /* n, number of window/swap action pairs     */
+
+} xDbeSwapBuffersReq;          /* followed by n window/swap action pairs    */
+#define sz_xDbeSwapBuffersReq  8
+
+typedef struct
+{
+    CARD8      reqType;        /* major-opcode: always codes->major_opcode */
+    CARD8      dbeReqType;     /* minor-opcode: always X_DbeBeginIdom (4)  */
+    CARD16     length B16;     /* request length: (1)                      */
+
+} xDbeBeginIdiomReq;
+#define sz_xDbeBeginIdiomReq   4
+
+typedef struct
+{
+    CARD8      reqType;        /* major-opcode: always codes->major_opcode */
+    CARD8      dbeReqType;     /* minor-opcode: always X_DbeEndIdom (5)    */
+    CARD16     length B16;     /* request length: (1)                      */
+
+} xDbeEndIdiomReq;
+#define sz_xDbeEndIdiomReq     4
+
+typedef struct
+{
+    CARD8      reqType;        /* always codes->major_opcode     */
+    CARD8      dbeReqType;     /* always X_DbeGetVisualInfo (6)  */
+    CARD16     length B16;     /* request length: (2+n)          */
+    CARD32     n B32;          /* n, number of drawables in list */
+
+} xDbeGetVisualInfoReq;                /* followed by n drawables        */
+#define sz_xDbeGetVisualInfoReq        8
+
+typedef struct
+{
+    BYTE       type;                   /* Reply: X_Reply (1)                */
+    CARD8      unused;                 /* unused                            */
+    CARD16     sequenceNumber B16;     /* sequence number                   */
+    CARD32     length B32;             /* reply length                      */
+    CARD32     m;                      /* m, number of visual infos in list */
+    CARD32     pad1 B32;               /* unused                            */
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+
+} xDbeGetVisualInfoReply;              /* followed by m visual infos        */
+#define sz_xDbeGetVisualInfoReply      32
+
+typedef struct
+{
+    CARD8              reqType;        /* always codes->major_opcode       */
+    CARD8              dbeReqType;     /* X_DbeGetBackBufferAttributes (7) */
+    CARD16             length B16;     /* request length: (2)              */
+    xDbeBackBuffer     buffer B32;     /* back buffer name                 */
+
+} xDbeGetBackBufferAttributesReq;
+#define sz_xDbeGetBackBufferAttributesReq      8
+
+typedef struct
+{
+    BYTE       type;                   /* Reply: X_Reply (1) */
+    CARD8      unused;                 /* unused             */
+    CARD16     sequenceNumber B16;     /* sequence number    */
+    CARD32     length B32;             /* reply length: (0)  */
+    CARD32     attributes;             /* attributes         */
+    CARD32     pad1 B32;               /* unused             */
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+
+} xDbeGetBackBufferAttributesReply;
+#define sz_xDbeGetBackBufferAttributesReply    32
+
+#endif /* DBE_PROTO_H */
+
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..34ab4bf
--- /dev/null
@@ -0,0 +1,73 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+  git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
new file mode 100755 (executable)
index 0000000..373fe18
--- /dev/null
@@ -0,0 +1,153 @@
+x11proto-xext (7.1.2-1slp2) unstable; urgency=low
+
+  * [X11R7.6] upgrade package
+  * Git: 165.213.180.234:slp/pkgs/xorg/proto/x11proto-xext
+  * Tag: x11proto-xext_7.1.2-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Mon, 03 Jan 2011 20:50:24 +0900
+
+x11proto-xext (7.1.1-6slp2) unstable; urgency=low
+
+  * Add an omitted macro (_F_ENABLE_XI2_SENDEVENT_) in
+    geproto.h
+  * Git: 165.213.180.234:/git/slp/pkgs/xorg/proto/x11proto-xext
+  * Tag: x11proto-xext_7.1.1-6slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Sat, 27 Nov 2010 17:22:27 +0900
+
+x11proto-xext (7.1.1-5slp2) unstable; urgency=low
+
+  * Apply XI2 sendevent patch and enable _F_ENABLE_XI2_SENDEVENT_ macro
+  * Git: 165.213.180.234:/git/slp/pkgs/xorg/proto/x11proto-xext
+  * Tag: x11proto-xext_7.1.1-5slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Sat, 27 Nov 2010 16:54:18 +0900
+
+x11proto-xext (7.1.1-4slp2) unstable; urgency=low
+
+  * update maintainer
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+  * Tag: x11proto-xext_7.1.1-4slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 20 Apr 2010 17:34:36 +0900
+
+x11proto-xext (7.1.1-3slp2) unstable; urgency=low
+
+  * Changed package name as a pure open souroce code.
+
+ -- YoungHoon Jung <yhoon.jung@samsung.com>  Thu, 25 Mar 2010 17:05:01 +0900
+
+x11proto-xext (7.1.1-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 06 Jan 2010 12:30:57 +0000
+
+x11proto-xext (7.1.1-1) experimental; urgency=low
+
+  [ Timo Aaltonen ]
+  * Add README.source from xsfbs. Bump Standards-Version to 3.8.1.
+
+  [ Julien Cristau ]
+  * Drop Pre-Depends on x11-common, needed for upgrades from sarge.
+  * Drop Conflicts/Replaces on libxext-dev and libxtst-dev, same deal.
+  * Bump debhelper compat level to 5.
+  * Bump Standards-Version to 3.8.3.
+  * New upstream release
+    + many files moved from here to libXext and other extension libraries,
+      some others have been renamed
+  * Break old versions of libxtst-dev and libxext-dev to make sure the headers
+    don't go missing.
+  * Bump xutils-dev build-dep to 1:7.4+4.
+
+ -- Julien Cristau <jcristau@debian.org>  Sat, 12 Sep 2009 10:38:48 +0200
+
+x11proto-xext (7.0.4-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 15 Feb 2009 21:01:20 +0100
+
+x11proto-xext (7.0.4-1) experimental; urgency=low
+
+  [ Timo Aaltonen, Julien Cristau ]
+  * New upstream release.
+
+  [ Julien Cristau ]
+  * Run autoreconf on build.  Build-dep on xutils-dev, autoconf and automake.
+  * Update debian/copyright.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 23 Dec 2008 15:51:45 +0100
+
+x11proto-xext (7.0.2-6) unstable; urgency=low
+
+  [ Brice Goglin ]
+  * Update the long description.
+  * Add URL in debian/copyright.
+  * Add Vcs-* to debian/control.
+  * Remove Fabio from Uploaders, with his permission.
+
+  [ Julien Cristau ]
+  * Remove Branden from Uploaders with his permission.
+  * Add myself to Uploaders.
+  * Bump Standards-Version to 3.7.3.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 11 May 2008 21:13:40 +0200
+
+x11proto-xext (7.0.2-5) unstable; urgency=low
+
+  * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+    idempotency fix.
+  * Run dh_install w/ --list-missing.
+  * Change debhelper build-dep-indep to a normal build-dep, as dh_clean
+    is called inside the clean rule.
+  * Drop duplicate x11-common dep in -dev package.
+  * Bump standards version to 3.7.2.0.
+  * Version x11-common pre-dep in -dev package to 1:7.0.0 to match
+    the rest of Debian.
+
+ -- Andres Salomon <dilinger@debian.org>  Fri, 21 Jul 2006 03:00:19 -0400
+
+x11proto-xext (7.0.2-4) unstable; urgency=low
+
+  * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 23 Mar 2006 21:36:28 -0500
+
+x11proto-xext (7.0.2-3) UNRELEASED-experimental; urgency=low
+
+  * Replace dependency on libxi-dev by x11proto-input-dev, as suggested by
+    Daniel Stone.
+
+ -- Denis Barbier <barbier@debian.org>  Tue, 14 Mar 2006 23:00:09 +0000
+
+x11proto-xext (7.0.2-2) experimental; urgency=low
+
+  * Add epoch to versioned Pre-Depends on x11-common to make upgrades
+    from monolithic x11-common work (Closes: #351779).
+
+ -- Michel Dänzer <daenzer@debian.org>  Thu,  9 Feb 2006 16:41:07 +0100
+
+x11proto-xext (7.0.2-1) experimental; urgency=low
+
+  * First upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org>  Fri, 30 Dec 2005 14:36:39 -0500
+
+x11proto-xext (6.9.99.0-1) breezy; urgency=low
+
+  * Update to version from 7.0RC1 to get ShapeInput.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Wed, 17 Aug 2005 22:40:29 +1000
+
+x11proto-xext (6.8.99.7-2) breezy; urgency=low
+
+  * Add Depends on libxi-dev and libxau-dev.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Thu, 14 Jul 2005 14:08:55 +1000
+
+x11proto-xext (6.8.99.7-1) breezy; urgency=low
+
+  * First x11proto-xext release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 16 May 2005 22:10:17 +1000
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100755 (executable)
index 0000000..134c14f
--- /dev/null
@@ -0,0 +1,27 @@
+Source: x11proto-xext
+Section: x11
+Priority: optional
+Maintainer: Sung-Jin Park <sj76.park@samsung.com>, SangJin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, David Nusinow <dnusinow@debian.org>, Andres Salomon <dilinger@debian.org>, Julien Cristau <jcristau@debian.org>
+Build-Depends: debhelper (>= 5.0.0), xutils-dev (>= 1:7.4+4), autoconf, automake
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-xorg/proto/x11proto-xext
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/proto/x11proto-xext.git
+
+Package: x11proto-xext-dev
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, x11proto-input-dev, libxau-dev
+Breaks:
+ libxext-dev (<< 2:1.0.99),
+ libxtst-dev (<< 2:1.0.99)
+Description: X11 various extension wire protocol
+ This package provides development headers describing the wire protocol
+ for various extensions, the client-side libraries of which are provided
+ in the Xext library.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This package is built from the X.org xextproto proto module.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..fbde54f
--- /dev/null
@@ -0,0 +1,204 @@
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/proto/
+
+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 (c) 1997 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.
+
+
+Copyright 1992 Network Computing Devices
+
+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 NCD. not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  NCD. makes no representations about the
+suitability of this software for any purpose.  It is provided "as is"
+without express or implied warranty.
+
+NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+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) 1994, 1995  Hewlett-Packard Company
+
+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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard
+Company 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 Hewlett-Packard Company.
+
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+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.
+
+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
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation 
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital 
+Equipment Corporation.
+
+
+Copyright 1988, 1989, 1990, 1994 Network Computing Devices, 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 Network Computing Devices, Inc. not be
+used in advertising or publicity pertaining to distribution of this 
+software without specific, written prior permission.
+
+THIS SOFTWARE IS PROVIDED `AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
+DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
+LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
+COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE,
+DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND
+REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+                        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 names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY 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 1986, 1987, 1988 by Hewlett-Packard Corporation
+
+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 makes no representations about the 
+suitability of this software for any purpose.  It is provided 
+"as is" without express or implied warranty.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+
+
+Copyright Â© 2007-2008 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.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..c4483de
--- /dev/null
@@ -0,0 +1,100 @@
+#!/usr/bin/make -f
+# debian/rules for the Debian x11proto-xext-dev package.
+# Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright Â© 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright Â© 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGE = x11proto-xext-dev
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+CFLAGS += -D_F_ENABLE_XI2_SENDEVENT_
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+       confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+       confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+#      confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+configure:
+       autoreconf -vfi
+
+obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
+       mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
+       cd obj-$(DEB_BUILD_GNU_TYPE) && \
+       ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
+                    --infodir=\$${prefix}/share/info --disable-shared \
+                    $(confflags) CFLAGS="$(CFLAGS)" 
+
+build: build-stamp
+build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
+       dh_testdir
+       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+
+       rm -f config.cache config.log config.status config.guess config.sub
+       rm -f */config.cache */config.log */config.status */config.guess */config.sub
+       rm -f conftest* */conftest*
+       rm -rf autom4te.cache */autom4te.cache
+       rm -rf obj-*
+       rm -f $$(find -name Makefile.in)
+       rm -f aclocal.m4 configure install-sh missing mkinstalldirs
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-independent files here.
+binary-indep: build install
+       dh_testdir
+       dh_testroot
+
+#      dh_installdocs
+#      dh_installman
+       dh_install --sourcedir=debian/tmp --list-missing
+#      dh_installchangelogs
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..5c8758e
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/proto/ xextproto-(.*)\.tar\.gz
diff --git a/debian/x11proto-xext-dev.install b/debian/x11proto-xext-dev.install
new file mode 100644 (file)
index 0000000..5f72853
--- /dev/null
@@ -0,0 +1,2 @@
+usr/include/X11/extensions/*
+usr/lib/pkgconfig/xextproto.pc
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
new file mode 100644 (file)
index 0000000..5935cc9
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+       exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+       exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+       exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
new file mode 100644 (file)
index 0000000..1f86848
--- /dev/null
@@ -0,0 +1,289 @@
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2.  See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number.  Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+  ARCH:=$(ARCH)
+ else
+  ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+#   1) A target name that is invoked by a package-building tool or the user.
+#      This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+#   2) A line delcaring 1) as a phony target (".PHONY:").
+#   3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+#   depend on other targets.
+#   4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+#   "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir".  Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again.  Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+       mkdir $(STAMP_DIR)
+       >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+       >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+       mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+       if ! [ `which quilt` ]; then \
+               echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+               exit 1; \
+       fi; \
+       if $(QUILT) next >/dev/null 2>&1; then \
+         echo -n "Applying patches..."; \
+         if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "No patches to apply"; \
+       fi; \
+       >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+       rm -f $(STAMP_DIR)/patch
+       @echo -n "Unapplying patches..."; \
+       if $(QUILT) applied >/dev/null 2>/dev/null; then \
+         if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "nothing to do."; \
+       fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+       rm -f $(STAMP_DIR)/genscripts
+       rm -f debian/*.config \
+             debian/*.postinst \
+             debian/*.postrm \
+             debian/*.preinst \
+             debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+       dh_testdir
+       rm -rf .pc
+       rm -rf $(STAMP_DIR) $(SOURCE_DIR)
+       rm -rf imports
+       dh_clean debian/shlibs.local \
+                debian/po/pothead
+
+# Generate the debconf templates POT file header.
+debian/po/pothead: debian/po/pothead.in
+       sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \
+         -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@
+
+# Update POT and PO files.
+.PHONY: updatepo
+updatepo: debian/po/pothead
+       debian/scripts/debconf-updatepo --pot-header=pothead --verbose
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems.  It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+       # Ensure we're in the correct directory.
+       dh_testdir
+       grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+       @echo -n "Auditing patches..."; \
+       >$(STAMP_DIR)/log/patch; \
+       FUZZY=; \
+       while [ -n "$$($(QUILT) next)" ]; do \
+         RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+         case "$$RESULT" in \
+           succeeded) \
+             echo "fuzzy patch: $$($(QUILT) top)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+             FUZZY=yes; \
+             ;; \
+           FAILED) \
+             echo "broken patch: $$($(QUILT) next)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+             exit 1; \
+             ;; \
+         esac; \
+       done; \
+       if [ -n "$$FUZZY" ]; then \
+         echo "there were fuzzy patches; please fix."; \
+         exit 1; \
+       else \
+         echo "done."; \
+       fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+       for FILE in debian/*.config.in \
+                   debian/*.postinst.in \
+                   debian/*.postrm.in \
+                   debian/*.preinst.in \
+                   debian/*.prerm.in; do \
+         if [ -e "$$FILE" ]; then \
+           MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+           sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+           cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+           sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+           sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+               -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+               -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \
+             <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+           rm $$MAINTSCRIPT.tmp; \
+         fi; \
+       done
+       # Validate syntax of generated shell scripts.
+       #sh debian/scripts/validate-posix-sh debian/*.config \
+       #                                    debian/*.postinst \
+       #                                    debian/*.postrm \
+       #                                    debian/*.preinst \
+       #                                    debian/*.prerm
+       >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+       @echo error: xserver-xorg-dev needs to be installed
+       @exit 1
+else
+       echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+       echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+       echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
new file mode 100644 (file)
index 0000000..45acd59
--- /dev/null
@@ -0,0 +1,624 @@
+# $Id$
+
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts.  It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions.  By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+  RECONFIGURE="true"
+else
+  RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+  FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+  UPGRADE="yes"
+fi
+
+trap "message;\
+      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+      message;\
+      exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+  # syntax: reject_nondigits [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters other than decimal digits and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain anything but digits?
+    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+      # can't use die(), because it wraps message() which wraps this function
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+           "possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+reject_unlikely_path_chars () {
+  # syntax: reject_unlikely_path_chars [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters unlikely to be seen in a path and which the shell might
+  # interpret and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain any funny characters?
+    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+      # can't use die(), because I want to avoid forward references
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+           "encountered possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user.  This is used only as a fallback in the
+# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+  DEFCOLUMNS=80
+fi
+
+message () {
+  # pretty-print messages of arbitrary length
+  reject_nondigits "$COLUMNS"
+  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+  # syntax: observe message ...
+  #
+  # issue observational message suitable for logging someday when support for
+  # it exists in dpkg
+  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+  fi
+}
+
+warn () {
+  # syntax: warn message ...
+  #
+  # issue warning message suitable for logging someday when support for
+  # it exists in dpkg; also send to standard error
+  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+  # syntax: die message ...
+  #
+  # exit script with error message
+  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+  exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+  message "internal error: $*"
+  if [ -n "$OFFICIAL_BUILD" ]; then
+    message "Please report a bug in the $THIS_SCRIPT script of the" \
+            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+            "Tracking System.  Include all messages above that mention the" \
+            "$THIS_PACKAGE package.  Visit " \
+            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+            "instructions, read the file" \
+            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+            "package, or install the reportbug package and use the command of" \
+            "the same name to file a report."
+  fi
+  exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+  message "usage error: $*"
+  message "Please report a bug in the $THIS_SCRIPT script of the" \
+          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+          "Tracking System.  Include all messages above that mention the" \
+          "$THIS_PACKAGE package.  Visit " \
+          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+          "instructions, read the file" \
+          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+          "package, or install the reportbug package and use the command of" \
+          "the same name to file a report."
+  exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+  # run $UPDATECMDS in $FONTDIRS
+
+  local dir cmd shortcmd x_font_dir_prefix
+
+  x_font_dir_prefix="/usr/share/fonts/X11"
+
+  if [ -z "$UPDATECMDS" ]; then
+    usage_error "font_update() called but \$UPDATECMDS not set"
+  fi
+  if [ -z "$FONTDIRS" ]; then
+    usage_error "font_update() called but \$FONTDIRS not set"
+  fi
+
+  reject_unlikely_path_chars "$UPDATECMDS"
+  reject_unlikely_path_chars "$FONTDIRS"
+
+  for dir in $FONTDIRS; do
+    if [ -d "$x_font_dir_prefix/$dir" ]; then
+      for cmd in $UPDATECMDS; do
+        if which "$cmd" > /dev/null 2>&1; then
+          shortcmd=${cmd##*/}
+          observe "running $shortcmd in $dir font directory"
+         cmd_opts=
+          if [ "$shortcmd" = "update-fonts-alias" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-dir" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-scale" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+                              "failed; font directory data may not" \
+                              "be up to date"
+        else
+          warn "$cmd not found; not updating corresponding $dir font" \
+               "directory data"
+        fi
+      done
+    else
+      warn "$dir is not a directory; not updating font directory data"
+    fi
+  done
+}
+
+remove_conffile_prepare () {
+  # syntax: remove_conffile_prepare filename official_md5sum ...
+  #
+  # Check a conffile "filename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 2 ]; then
+    usage_error "remove_conffile_prepare() called with wrong number of" \
+                "arguments; expected at least 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+  shift
+
+  # does the conffile even exist?
+  if [ -e "$conffile" ]; then
+    # calculate its checksum
+    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+    # compare it to each supplied checksum
+    while [ -n "$1" ]; do
+      if [ "$current_checksum" = "$1" ]; then
+        # we found a match; move the confffile and stop looking
+        observe "preparing obsolete conffile $conffile for removal"
+        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+        break
+      fi
+      shift
+    done
+  fi
+}
+
+remove_conffile_lookup () {
+  # syntax: remove_conffile_lookup package filename
+  #
+  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+  # if it matches the actual file's md5sum.
+  #
+  # Call this function when you would call remove_conffile_prepare but only
+  # want to check against dpkg's status database instead of known checksums.
+
+  local package conffile old_md5sum
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "remove_conffile_lookup() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  package="$1"
+  conffile="$2"
+
+  if ! [ -e "$conffile" ]; then
+    return
+  fi
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+  if [ -n "$old_md5sum" ]; then
+    remove_conffile_prepare "$conffile" "$old_md5sum"
+  fi
+}
+
+remove_conffile_commit () {
+  # syntax: remove_conffile_commit filename
+  #
+  # Complete the removal of a conffile "filename" that has become obsolete.
+  #
+  # Call this function from a postinst script after having used
+  # remove_conffile_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_commit() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, remove it
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "committing removal of obsolete conffile $conffile"
+    rm "$conffile.$THIS_PACKAGE-tmp"
+  fi
+}
+
+remove_conffile_rollback () {
+  # syntax: remove_conffile_rollback filename
+  #
+  # Roll back the removal of a conffile "filename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" is  after having used remove_conffile_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_rollback() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, move it
+  # back
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "rolling back removal of obsolete conffile $conffile"
+    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+  fi
+}
+
+replace_conffile_with_symlink_prepare () {
+  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+  # official_md5sum ...
+  #
+  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails. Otherwise copy it
+  # to newfilename and let dpkg handle it through conffiles mechanism.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 3 ]; then
+    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+                " number of arguments; expected at least 3, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  shift
+  newconffile="$1"
+  shift
+
+  remove_conffile_prepare "$_oldconffile" "$@"
+  # If $oldconffile still exists, then md5sums didn't match.
+  # Copy it to new one.
+  if [ -f "$oldconffile" ]; then
+    cp "$oldconffile" "$newconffile"
+  fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+  # syntax: replace_conffile_with_symlink_commit oldfilename
+  #
+  # Complete the removal of a conffile "oldfilename" that has been
+  # replaced by a symlink.
+  #
+  # Call this function from a postinst script after having used
+  # replace_conffile_with_symlink_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+                "number of arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+  #
+  # Roll back the replacing of a conffile "oldfilename" with symlink to
+  # "newfilename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" and verify $2 to ensure the package failed to upgrade
+  # from a version (or install over a version removed-but-not-purged) prior
+  # to the one in which the conffile was obsoleted.
+  # You should have  used replace_conffile_with_symlink_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+                "number of arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  newconffile="$2"
+
+  remove_conffile_rollback "$_oldconffile"
+  if [ -f "$newconffile" ]; then
+    rm "$newconffile"
+  fi
+}
+
+run () {
+  # syntax: run command [ argument ... ]
+  #
+  # Run specified command with optional arguments and report its exit status.
+  # Useful for commands whose exit status may be nonzero, but still acceptable,
+  # or commands whose failure is not fatal to us.
+  #
+  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+  # those cases the return value of the debconf command *must* be checked
+  # before the string returned by debconf is used for anything.
+
+  local retval
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "run() called with wrong number of arguments; expected at" \
+                "least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  "$@" || retval=$?
+
+  if [ ${retval:-0} -ne 0 ]; then
+    observe "command \"$*\" exited with status $retval"
+  fi
+}
+
+make_symlink_sane () {
+  # syntax: make_symlink_sane symlink target
+  #
+  # Ensure that the symbolic link symlink exists, and points to target.
+  #
+  # If symlink does not exist, create it and point it at target.
+  #
+  # If symlink exists but is not a symbolic link, back it up.
+  #
+  # If symlink exists, is a symbolic link, but points to the wrong location, fix
+  # it.
+  #
+  # If symlink exists, is a symbolic link, and already points to target, do
+  # nothing.
+  #
+  # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "make_symlink_sane() called with wrong number of arguments;" \
+      "expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local symlink target
+
+  symlink="$1"
+  target="$2"
+
+  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+      observe "link from $symlink to $target already exists"
+  else
+    observe "creating symbolic link from $symlink to $target"
+    mkdir -p "${target%/*}" "${symlink%/*}"
+    ln -s -b -S ".dpkg-old" "$target" "$symlink"
+  fi
+}
+
+migrate_dir_to_symlink () {
+  # syntax: migrate_dir_to_symlink old_location new_location
+  #
+  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+  # symbolic link to a directory or vice versa; instead, the existing state
+  # (symlink or not) will be left alone and dpkg will follow the symlink if
+  # there is one."
+  #
+  # We have to do it ourselves.
+  #
+  # This function moves the contents of old_location, a directory, into
+  # new_location, a directory, then makes old_location a symbolic link to
+  # new_location.
+  #
+  # old_location need not exist, but if it does, it must be a directory (or a
+  # symlink to a directory).  If it is not, it is backed up.  If new_location
+  # exists already and is not a directory, it is backed up.
+  #
+  # This function should be called from a package's preinst so that other
+  # packages unpacked after this one --- but before this package's postinst runs
+  # --- are unpacked into new_location even if their payloads contain
+  # old_location filespecs.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "migrate_dir_to_symlink() called with wrong number of"
+                "arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local new old
+
+  old="$1"
+  new="$2"
+
+  # Is old location a symlink?
+  if [ -L "$old" ]; then
+    # Does it already point to new location?
+    if [ "$(readlink "$old")" = "$new" ]; then
+      # Nothing to do; migration has already been done.
+      observe "migration of $old to $new already done"
+      return 0
+    else
+      # Back it up.
+      warn "backing up symbolic link $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+    fi
+  fi
+
+  # Does old location exist, but is not a directory?
+  if [ -e "$old" ] && ! [ -d "$old" ]; then
+      # Back it up.
+      warn "backing up non-directory $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+  fi
+
+  observe "migrating $old to $new"
+
+  # Is new location a symlink?
+  if [ -L "$new" ]; then
+    # Does it point the wrong way, i.e., back to where we're migrating from?
+    if [ "$(readlink "$new")" = "$old" ]; then
+      # Get rid of it.
+      observe "removing symbolic link $new which points to $old"
+      rm "$new"
+    else
+      # Back it up.
+      warn "backing up symbolic link $new as $new.dpkg-old"
+      mv -b "$new" "$new.dpkg-old"
+    fi
+  fi
+
+  # Does new location exist, but is not a directory?
+  if [ -e "$new" ] && ! [ -d "$new" ]; then
+    warn "backing up non-directory $new as $new.dpkg-old"
+    mv -b "$new" "$new.dpkg-old"
+  fi
+
+  # Create new directory if it does not yet exist.
+  if ! [ -e "$new" ]; then
+    observe "creating $new"
+    mkdir -p "$new"
+  fi
+
+  # Copy files in old location to new location.  Back up any filenames that
+  # already exist in the new location with the extension ".dpkg-old".
+  observe "copying files from $old to $new"
+  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+    die "error(s) encountered while copying files from $old to $new"
+  fi
+
+  # Remove files at old location.
+  observe "removing $old"
+  rm -r "$old"
+
+  # Create symlink from old location to new location.
+  make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
diff --git a/dpmsconst.h b/dpmsconst.h
new file mode 100644 (file)
index 0000000..75f0586
--- /dev/null
@@ -0,0 +1,43 @@
+/*****************************************************************
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+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.
+
+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
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+
+#ifndef _DPMSCONST_H
+#define _DPMSCONST_H 1
+
+#define DPMSMajorVersion       1
+#define DPMSMinorVersion       1
+
+#define DPMSExtensionName      "DPMS"
+
+#define DPMSModeOn     0
+#define DPMSModeStandby        1
+#define DPMSModeSuspend        2
+#define DPMSModeOff    3
+
+#endif /* !_DPMSCONST_H */
+
diff --git a/dpmsproto.h b/dpmsproto.h
new file mode 100644 (file)
index 0000000..63fd3fc
--- /dev/null
@@ -0,0 +1,175 @@
+/*****************************************************************
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+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.
+
+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
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+
+#ifndef _DPMSPROTO_H_
+#define _DPMSPROTO_H_
+
+#include <X11/extensions/dpmsconst.h>
+
+#define X_DPMSGetVersion       0
+#define X_DPMSCapable          1
+#define X_DPMSGetTimeouts      2
+#define X_DPMSSetTimeouts      3
+#define X_DPMSEnable           4
+#define X_DPMSDisable          5
+#define X_DPMSForceLevel               6
+#define X_DPMSInfo             7
+
+#define DPMSNumberEvents       0
+
+#define DPMSNumberErrors       0
+
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSGetVersion */
+    CARD16     length B16;
+    CARD16     majorVersion B16;
+    CARD16     minorVersion B16;
+} xDPMSGetVersionReq;
+#define sz_xDPMSGetVersionReq 8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     majorVersion B16;
+    CARD16     minorVersion B16;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xDPMSGetVersionReply;
+#define sz_xDPMSGetVersionReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSCapable */
+    CARD16     length B16;
+} xDPMSCapableReq;
+#define sz_xDPMSCapableReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    BOOL       capable;
+    CARD8      pad1;
+    CARD16     pad2 B16;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+    CARD32     pad7 B32;
+} xDPMSCapableReply;
+#define sz_xDPMSCapableReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSGetTimeouts */
+    CARD16     length B16;
+} xDPMSGetTimeoutsReq;
+#define sz_xDPMSGetTimeoutsReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     standby B16;
+    CARD16     suspend B16;
+    CARD16     off B16;
+    CARD16     pad1 B16;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xDPMSGetTimeoutsReply;
+#define sz_xDPMSGetTimeoutsReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSSetTimeouts */
+    CARD16     length B16;
+    CARD16     standby B16;
+    CARD16     suspend B16;
+    CARD16     off B16;
+    CARD16     pad0 B16;
+} xDPMSSetTimeoutsReq;
+#define sz_xDPMSSetTimeoutsReq 12
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSEnable */
+    CARD16     length B16;
+} xDPMSEnableReq;
+#define sz_xDPMSEnableReq 4
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSDisable */
+    CARD16     length B16;
+} xDPMSDisableReq;
+#define sz_xDPMSDisableReq 4
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSForceLevel */
+    CARD16     length B16;
+    CARD16     level B16;      /* power level requested */
+    CARD16     pad0 B16;
+} xDPMSForceLevelReq;
+#define sz_xDPMSForceLevelReq 8
+
+typedef struct {
+    CARD8      reqType;        /* always DPMSCode */
+    CARD8      dpmsReqType;    /* always X_DPMSInfo */
+    CARD16     length B16;
+} xDPMSInfoReq;
+#define sz_xDPMSInfoReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     power_level B16;
+    BOOL       state;
+    CARD8      pad1;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xDPMSInfoReply;
+#define sz_xDPMSInfoReply 32
+
+#endif /* _DPMSPROTO_H_ */
diff --git a/ge.h b/ge.h
new file mode 100755 (executable)
index 0000000..484ae50
--- /dev/null
+++ b/ge.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright Â© 2007-2008 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.
+ *
+ * Authors: Peter Hutterer, University of South Australia, NICTA
+ *
+ */
+
+#ifndef _GE_H_
+#define _GE_H_
+
+#define GE_NAME         "Generic Event Extension"
+#define GE_MAJOR        1
+#ifndef _F_ENABLE_XI2_SENDEVENT_
+#define GE_MINOR        0
+#else//_F_ENABLE_XI2_SENDEVENT_
+#define GE_MINOR        1
+#endif//_F_ENABLE_XI2_SENDEVENT_
+
+/*********************************************************
+ *
+ * Requests
+ *
+ */
+
+#define X_GEQueryVersion        0
+#ifdef _F_ENABLE_XI2_SENDEVENT_
+#define X_GESendEvent           1
+
+#define GENumberRequests       (X_GESendEvent + 1)
+#else//_F_ENABLE_XI2_SENDEVENT_
+#define GENumberRequests       (X_GEQueryVersion + 1)
+#endif//_F_ENABLE_XI2_SENDEVENT_
+
+/*********************************************************
+ *
+ * Events
+ *
+ */
+
+#define GENumberEvents        0
+
+/*********************************************************
+ *
+ * Errors
+ *
+ */
+
+#define GENumberErrors        0
+
+#endif /* _GE_H_ */
diff --git a/geproto.h b/geproto.h
new file mode 100755 (executable)
index 0000000..eac23ac
--- /dev/null
+++ b/geproto.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright Â© 2007-2008 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.
+ *
+ * Authors: Peter Hutterer, University of South Australia, NICTA
+ *
+ */
+
+#ifndef _GEPROTO_H_
+#define _GEPROTO_H_
+
+#include<X11/Xproto.h>
+#include<X11/X.h>
+#include<X11/extensions/ge.h>
+
+
+/*********************************************************
+ *
+ * Protocol request constants
+ *
+ */
+
+#define X_GEGetExtensionVersion 1
+
+/*********************************************************
+ *
+ * XGE protocol requests/replies
+ *
+ */
+
+/* generic request */
+typedef struct {
+    CARD8   reqType;
+    CARD8   ReqType;
+    CARD16  length B16;
+} xGEReq;
+
+
+/* QueryVersion */
+typedef struct {
+    CARD8      reqType;       /* input extension major code   */
+    CARD8      ReqType;       /* always X_GEQueryVersion */
+    CARD16     length B16;
+    CARD16      majorVersion B16;
+    CARD16      minorVersion B16;
+} xGEQueryVersionReq;
+
+#define sz_xGEQueryVersionReq    8
+
+typedef struct {
+    CARD8      repType;        /* X_Reply                      */
+    CARD8      RepType;        /* always X_GEQueryVersion */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     majorVersion B16;
+    CARD16     minorVersion B16;
+    CARD32     pad00 B32;
+    CARD32     pad01 B32;
+    CARD32     pad02 B32;
+    CARD32     pad03 B32;
+    CARD32     pad04 B32;
+} xGEQueryVersionReply;
+
+#ifndef _F_ENABLE_XI2_SENDEVENT_
+#define sz_xGEQueryVersionReply    32
+#else//_F_ENABLE_XI2_SENDEVENT_
+typedef struct {
+    CARD8   reqType;
+    CARD8   ReqType;
+    CARD16  length B16;
+    CARD8   propagate;
+    CARD8   pad1;
+    CARD16  pad2;
+    CARD32  destination B32;
+    CARD32  eventMask B32;
+} xGESendEventReq;
+
+#define sz_xGESendEventReq    16
+#endif//_F_ENABLE_XI2_SENDEVENT_
+
+#endif /* _GEPROTO_H_ */
+
diff --git a/geproto.txt b/geproto.txt
new file mode 100644 (file)
index 0000000..654cd0f
--- /dev/null
@@ -0,0 +1,83 @@
+                        X Generic Event Extension
+                              Peter Hutterer
+                          peter.hutterer@who-t.net
+
+
+1. Introduction
+2. Extension Initialization
+3. Extension Events
+4. Notes
+
+_____________________________________________________________________________
+1. Introduction
+
+X was designed to provide 64 event opcodes for all extensions. These events
+are limited to 32 bytes.
+
+The Generic Event Extension provides a template event for extensions to re-use
+a single event opcode. GE only provide headers and the most basic
+functionality, leaving the extensions to interpret the events in their
+specific context.
+
+GenericEvents may be longer than 32 bytes. If so, the number of 4 byte units
+following the initial 32 bytes must be specified in the length field of the
+event.
+_____________________________________________________________________________
+2. Extension Initialization
+
+The name of this extension is "Generic Event Extension"
+
+┌───
+    GEQueryVersion
+       client-major-version:   CARD16
+       client-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 clients responsibility to ensure that the server
+       supports a version which is compatible with its expectations.
+
+
+        As of version 1.0, no other requests are provided by this extension.
+_____________________________________________________________________________
+3. Extension Events
+
+GE defines a single event, to be used by all extensions. The event's structure 
+is similar to a reply.
+
+┌───
+    GenericEvent
+       type: BYTE;                     always GenericEvent
+       extension: CARD8;               extension offset
+       sequenceNumber: CARD16          low 16 bits of request seq. number
+       length: CARD32                  length
+       evtype: CARD16                  event type
+└───
+
+       The field 'extension' is to be set to the major opcode of the
+       extension. The 'evtype' field is the actual opcode of the event. 
+       The length field specifies the number of 4-byte blocks after the
+       initial 32 bytes. If length is 0, the event is 32 bytes long.
+_____________________________________________________________________________
+4. Notes
+
+Although the wire event is of arbitrary length, the actual size of an XEvent
+is restricted to sizeof(XEvent) [96 bytes, see Xlib.h]. If an extension
+converts a wire event to an XEvent > 96 bytes, it will overwrite the space
+allocated for the event. See struct _XSQEvent in Xlibint.h for details.
+
+Extensions need to malloc additional data and fill the XEvent structure with
+pointers to the malloc'd data. The client then needs to free the data, only
+the XEvent structure will be released by Xlib.
+
+The server must not send GenericEvents longer than 32 bytes until it has
+verified that the client is able to interpret these events. If a long event is
+sent to a client unable to process GenericEvents, future interpretation of
+replies and events by this client will fail.
diff --git a/lbx.h b/lbx.h
new file mode 100644 (file)
index 0000000..ecd24ff
--- /dev/null
+++ b/lbx.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright 1992 Network Computing Devices
+ *
+ * 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 NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  NCD. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * 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 _LBX_H_
+#define _LBX_H_
+
+#define LBXNAME "LBX"
+
+#define LBX_MAJOR_VERSION      1
+#define LBX_MINOR_VERSION      0
+
+#define LbxNumberReqs                  44
+#define LbxEvent                       0
+#define LbxQuickMotionDeltaEvent       1
+#define LbxNumberEvents                        2
+
+/* This is always the master client */
+#define LbxMasterClientIndex           0
+
+/* LbxEvent lbxType sub-fields */
+#define LbxSwitchEvent                 0
+#define LbxCloseEvent                  1
+#define LbxDeltaEvent                  2
+#define LbxInvalidateTagEvent          3
+#define LbxSendTagDataEvent            4
+#define LbxListenToOne                 5
+#define LbxListenToAll                 6
+#define LbxMotionDeltaEvent            7
+#define LbxReleaseCmapEvent            8
+#define LbxFreeCellsEvent              9
+
+/*
+ * Lbx image compression methods
+ *
+ * No compression is always assigned the value of 0.
+ *
+ * The rest of the compression method opcodes are assigned dynamically
+ * at option negotiation time.
+ */
+
+#define LbxImageCompressNone           0
+
+
+#define BadLbxClient                   0
+#define LbxNumberErrors                        (BadLbxClient + 1)
+
+/* tagged data types */
+#define        LbxTagTypeModmap                1
+#define        LbxTagTypeKeymap                2
+#define        LbxTagTypeProperty              3
+#define        LbxTagTypeFont                  4
+#define        LbxTagTypeConnInfo              5
+
+#endif
diff --git a/lbxproto.h b/lbxproto.h
new file mode 100644 (file)
index 0000000..a1ae62b
--- /dev/null
@@ -0,0 +1,975 @@
+/*
+ * Copyright 1992 Network Computing Devices
+ *
+ * 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 NCD. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  NCD. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
+ * 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 _LBXPROTO_H_
+#define _LBXPROTO_H_
+
+#include <X11/extensions/lbx.h>
+/*
+ * NOTE:  any changes or additions to the opcodes needs to be reflected
+ * in the lbxCacheable array in Xserver/lbx/lbxmain.c
+ */
+
+#define X_LbxQueryVersion              0
+#define X_LbxStartProxy                        1
+#define X_LbxStopProxy                 2
+#define X_LbxSwitch                    3
+#define X_LbxNewClient                 4
+#define X_LbxCloseClient               5
+#define X_LbxModifySequence            6
+#define X_LbxAllowMotion               7
+#define X_LbxIncrementPixel            8
+#define X_LbxDelta                     9
+#define        X_LbxGetModifierMapping         10
+#define        X_LbxInvalidateTag              12
+#define X_LbxPolyPoint                 13
+#define X_LbxPolyLine                  14
+#define X_LbxPolySegment               15
+#define X_LbxPolyRectangle             16
+#define X_LbxPolyArc                   17
+#define X_LbxFillPoly                  18
+#define X_LbxPolyFillRectangle         19
+#define X_LbxPolyFillArc               20
+#define        X_LbxGetKeyboardMapping         21
+#define        X_LbxQueryFont                  22
+#define        X_LbxChangeProperty             23
+#define        X_LbxGetProperty                24
+#define        X_LbxTagData                    25
+
+#define X_LbxCopyArea                  26
+#define X_LbxCopyPlane                 27
+#define X_LbxPolyText8                 28
+#define X_LbxPolyText16                        29
+#define X_LbxImageText8                        30
+#define X_LbxImageText16               31
+
+#define X_LbxQueryExtension            32
+#define X_LbxPutImage                  33
+#define X_LbxGetImage                  34
+
+#define X_LbxBeginLargeRequest         35
+#define X_LbxLargeRequestData          36
+#define X_LbxEndLargeRequest           37
+
+#define X_LbxInternAtoms               38
+#define X_LbxGetWinAttrAndGeom         39
+
+#define X_LbxGrabCmap                  40
+#define X_LbxReleaseCmap               41
+#define X_LbxAllocColor                        42
+
+#define X_LbxSync                      43
+
+/*
+ * Redefine some basic types used by structures defined herein.  This removes
+ * any possibility on 64-bit architectures of one entity viewing communicated
+ * data as 32-bit quantities and another entity viewing the same data as 64-bit
+ * quantities.
+ */
+#define XID CARD32
+#define Atom CARD32
+#define Colormap CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define Window CARD32
+
+typedef struct {
+    BOOL       success;                /* TRUE */
+    BOOL       changeType;
+    CARD16     majorVersion B16,
+               minorVersion B16;
+    CARD16     length B16;             /* 1/4 additional bytes in setup info */
+    CARD32     tag B32;
+} xLbxConnSetupPrefix;
+
+typedef struct _LbxQueryVersion {
+    CARD8      reqType;                /* always LbxReqCode */
+    CARD8      lbxReqType;             /* always X_LbxQueryVersion */
+    CARD16     length B16;
+} xLbxQueryVersionReq;
+#define sz_xLbxQueryVersionReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     majorVersion B16;       /* major version of LBX protocol */
+    CARD16     minorVersion B16;       /* minor version of LBX protocol */
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxQueryVersionReply;
+#define sz_xLbxQueryVersionReply       32
+
+typedef struct _LbxStartProxy {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxStartProxy */
+    CARD16     length B16;
+} xLbxStartProxyReq;
+#define sz_xLbxStartProxyReq       4
+
+typedef struct _LbxStopProxy {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxStopProxy */
+    CARD16     length B16;
+} xLbxStopProxyReq;
+#define sz_xLbxStopProxyReq        4
+
+typedef struct _LbxSwitch {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxSwitch */
+    CARD16     length B16;
+    CARD32     client B32;     /* new client */
+} xLbxSwitchReq;
+#define sz_xLbxSwitchReq       8
+
+typedef struct _LbxNewClient {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxNewClient */
+    CARD16     length B16;
+    CARD32     client B32;     /* new client */
+} xLbxNewClientReq;
+#define sz_xLbxNewClientReq    8
+
+typedef struct _LbxCloseClient {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxCloseClient */
+    CARD16     length B16;
+    CARD32     client B32;     /* new client */
+} xLbxCloseClientReq;
+#define sz_xLbxCloseClientReq  8
+
+typedef struct _LbxModifySequence {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxModifySequence */
+    CARD16     length B16;
+    CARD32     adjust B32;
+} xLbxModifySequenceReq;
+#define sz_xLbxModifySequenceReq    8
+
+typedef struct _LbxAllowMotion {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxAllowMotion */
+    CARD16     length B16;
+    CARD32     num B32;
+} xLbxAllowMotionReq;
+#define sz_xLbxAllowMotionReq    8
+
+typedef struct {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGrabCmap */
+    CARD16     length B16;
+    Colormap   cmap B32;
+} xLbxGrabCmapReq;
+#define sz_xLbxGrabCmapReq     8
+
+#define LBX_SMART_GRAB         0x80
+#define LBX_AUTO_RELEASE       0x40
+#define LBX_3CHANNELS          0x20
+#define LBX_2BYTE_PIXELS       0x10
+#define LBX_RGB_BITS_MASK      0x0f
+
+#define LBX_LIST_END           0
+#define LBX_PIXEL_PRIVATE      1
+#define LBX_PIXEL_SHARED       2
+#define LBX_PIXEL_RANGE_PRIVATE        3
+#define LBX_PIXEL_RANGE_SHARED 4
+#define LBX_NEXT_CHANNEL       5
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      flags;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     pad0 B16;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B16;
+} xLbxGrabCmapReply;
+#define sz_xLbxGrabCmapReply   32
+#define sz_xLbxGrabCmapReplyHdr        8
+
+
+typedef struct {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxReleaseCmap */
+    CARD16     length B16;
+    Colormap   cmap B32;
+} xLbxReleaseCmapReq;
+#define sz_xLbxReleaseCmapReq  8
+
+typedef struct {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxAllocColor */
+    CARD16     length B16;
+    Colormap   cmap B32;
+    CARD32     pixel B32;
+    CARD16     red B16, green B16, blue B16;
+    CARD16     pad B16;
+} xLbxAllocColorReq;
+#define sz_xLbxAllocColorReq   20
+
+typedef struct _LbxIncrementPixel {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxIncrementPixel */
+    CARD16     length B16;
+    CARD32     cmap B32;
+    CARD32     pixel B32;
+} xLbxIncrementPixelReq;
+#define sz_xLbxIncrementPixelReq    12
+
+typedef struct _LbxDelta {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxDelta */
+    CARD16     length B16;
+    CARD8      diffs;          /* number of diffs */
+    CARD8      cindex;         /* cache index */
+                               /* list of diffs follows */
+} xLbxDeltaReq;
+#define sz_xLbxDeltaReq    6
+
+typedef struct _LbxGetModifierMapping {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGetModifierMapping */
+    CARD16     length B16;
+} xLbxGetModifierMappingReq;
+#define        sz_xLbxGetModifierMappingReq    4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      keyspermod;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     tag B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxGetModifierMappingReply;
+#define sz_xLbxGetModifierMappingReply 32
+
+typedef struct _LbxGetKeyboardMapping {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGetKeyboardMapping */
+    CARD16     length B16;
+    KeyCode    firstKeyCode;
+    CARD8      count;
+    CARD16     pad1 B16;
+} xLbxGetKeyboardMappingReq;
+#define        sz_xLbxGetKeyboardMappingReq    8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      keysperkeycode;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     tag B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxGetKeyboardMappingReply;
+#define sz_xLbxGetKeyboardMappingReply 32
+
+typedef struct _LbxQueryFont {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxQueryFont */
+    CARD16     length B16;
+    CARD32     fid B32;
+} xLbxQueryFontReq;
+#define        sz_xLbxQueryFontReq     8
+
+typedef struct _LbxInternAtoms {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxInternAtoms */
+    CARD16     length B16;
+    CARD16     num B16;
+} xLbxInternAtomsReq;
+#define sz_xLbxInternAtomsReq  6
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     atomsStart B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxInternAtomsReply;
+#define sz_xLbxInternAtomsReply                32
+#define sz_xLbxInternAtomsReplyHdr     8
+
+
+typedef struct _LbxGetWinAttrAndGeom {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGetWinAttrAndGeom */
+    CARD16     length B16;
+    CARD32     id B32;         /* window id */
+} xLbxGetWinAttrAndGeomReq;
+#define sz_xLbxGetWinAttrAndGeomReq 8
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 backingStore;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* NOT 0; this is an extra-large reply */
+    VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16 c_class B16;
+#else
+    CARD16 class B16;
+#endif
+    CARD8 bitGravity;
+    CARD8 winGravity;
+    CARD32 backingBitPlanes B32;
+    CARD32 backingPixel B32;
+    BOOL saveUnder;
+    BOOL mapInstalled;
+    CARD8 mapState;
+    BOOL override;
+    Colormap colormap B32;
+    CARD32 allEventMasks B32;
+    CARD32 yourEventMask B32;
+    CARD16 doNotPropagateMask B16;
+    CARD16 pad1 B16;
+    Window root B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+    CARD16 borderWidth B16;
+    CARD8 depth;
+    CARD8 pad2;
+} xLbxGetWinAttrAndGeomReply;
+#define sz_xLbxGetWinAttrAndGeomReply 60
+
+
+typedef struct {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxSync */
+    CARD16     length B16;
+} xLbxSyncReq;
+#define sz_xLbxSyncReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad0;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xLbxSyncReply;
+#define sz_xLbxSyncReply 32
+
+
+/* an LBX squished charinfo packs the data in a CARD32 as follows */
+#define        LBX_WIDTH_SHIFT         26
+#define        LBX_LEFT_SHIFT          20
+#define        LBX_RIGHT_SHIFT         13
+#define        LBX_ASCENT_SHIFT        7
+#define        LBX_DESCENT_SHIFT       0
+
+#define        LBX_WIDTH_BITS          6
+#define        LBX_LEFT_BITS           6
+#define        LBX_RIGHT_BITS          7
+#define        LBX_ASCENT_BITS         6
+#define        LBX_DESCENT_BITS        7
+
+#define        LBX_WIDTH_MASK          0xfc000000
+#define        LBX_LEFT_MASK           0x03f00000
+#define        LBX_RIGHT_MASK          0x000fe000
+#define        LBX_ASCENT_MASK         0x00001f80
+#define        LBX_DESCENT_MASK        0x0000007f
+
+#define        LBX_MASK_BITS(val, n)   ((unsigned int) ((val) & ((1 << (n)) - 1)))
+
+typedef struct {
+    CARD32     metrics B32;
+} xLbxCharInfo;
+
+/* note that this is identical to xQueryFontReply except for missing
+ * first 2 words
+ */
+typedef struct {
+    xCharInfo minBounds;
+/* XXX do we need to leave this gunk? */
+#ifndef WORD64
+    CARD32 walign1 B32;
+#endif
+    xCharInfo maxBounds;
+#ifndef WORD64
+    CARD32 walign2 B32;
+#endif
+    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+    CARD16 defaultChar B16;
+    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
+    CARD8 drawDirection;
+    CARD8 minByte1, maxByte1;
+    BOOL allCharsExist;
+    INT16 fontAscent B16, fontDescent B16;
+    CARD32 nCharInfos B32; /* followed by this many xLbxCharInfo structures */
+} xLbxFontInfo;
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      compression;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     tag B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    /* X_QueryFont sticks much of the data in the base reply packet,
+     * but we hope that it won't be needed, (and it won't fit in 32 bytes
+     * with the tag anyways)
+     *
+     * if any additional data is needed, its sent in a xLbxFontInfo
+     */
+} xLbxQueryFontReply;
+#define sz_xLbxQueryFontReply  32
+
+typedef struct _LbxChangeProperty {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxChangeProperty */
+    CARD16     length B16;
+    Window     window B32;
+    Atom       property B32;
+    Atom       type B32;
+    CARD8      format;
+    CARD8      mode;
+    BYTE       pad[2];
+    CARD32     nUnits B32;
+} xLbxChangePropertyReq;
+#define        sz_xLbxChangePropertyReq        24
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      pad;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     tag B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxChangePropertyReply;
+#define sz_xLbxChangePropertyReply     32
+
+typedef struct _LbxGetProperty {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGetProperty */
+    CARD16     length B16;
+    Window     window B32;
+    Atom       property B32;
+    Atom       type B32;
+    CARD8      delete;
+    BYTE       pad[3];
+    CARD32     longOffset B32;
+    CARD32     longLength B32;
+} xLbxGetPropertyReq;
+#define        sz_xLbxGetPropertyReq   28
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      format;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    Atom       propertyType B32;
+    CARD32     bytesAfter B32;
+    CARD32     nItems B32;
+    CARD32     tag B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+} xLbxGetPropertyReply;
+#define sz_xLbxGetPropertyReply        32
+
+typedef struct _LbxTagData {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxTagData */
+    CARD16     length B16;
+    XID                tag B32;
+    CARD32     real_length B32;
+    /* data */
+} xLbxTagDataReq;
+#define        sz_xLbxTagDataReq       12
+
+typedef struct _LbxInvalidateTag {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxInvalidateTag */
+    CARD16     length B16;
+    CARD32     tag B32;
+} xLbxInvalidateTagReq;
+#define        sz_xLbxInvalidateTagReq 8
+
+typedef struct _LbxPutImage {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxPutImage */
+    CARD16     length B16;
+    CARD8      compressionMethod;
+    CARD8      cacheEnts;
+    CARD8      bitPacked;
+    /* rest is variable */
+} xLbxPutImageReq;
+#define sz_xLbxPutImageReq     7
+
+typedef struct {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxGetImage */
+    CARD16     length B16;
+    Drawable   drawable B32;
+    INT16      x B16, y B16;
+    CARD16     width B16, height B16;
+    CARD32     planeMask B32;
+    CARD8      format;
+    CARD8      pad1;
+    CARD16     pad2 B16;
+} xLbxGetImageReq;
+
+#define sz_xLbxGetImageReq 24
+
+typedef struct {
+    BYTE type;                 /* X_Reply */
+    CARD8 depth;
+    CARD16 sequenceNumber B16;
+    CARD32 lbxLength B32;
+    CARD32 xLength B32;
+    VisualID visual B32;
+    CARD8 compressionMethod;
+    CARD8 pad1;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+} xLbxGetImageReply;
+
+#define sz_xLbxGetImageReply 32
+
+/* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment,
+   LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */
+
+#define GFX_CACHE_SIZE  15
+
+#define GFXdCacheEnt(e)            ((e) & 0xf)
+#define GFXgCacheEnt(e)            (((e) >> 4) & 0xf)
+#define GFXCacheEnts(d,g)   (((d) & 0xf) | (((g) & 0xf) << 4))
+
+#define GFXCacheNone   0xf
+
+typedef struct _LbxPolyPoint {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD8      cacheEnts;
+    CARD8      padBytes;
+} xLbxPolyPointReq;
+
+#define sz_xLbxPolyPointReq    6
+
+typedef xLbxPolyPointReq xLbxPolyLineReq;
+typedef xLbxPolyPointReq xLbxPolySegmentReq;
+typedef xLbxPolyPointReq xLbxPolyRectangleReq;
+typedef xLbxPolyPointReq xLbxPolyArcReq;
+typedef xLbxPolyPointReq xLbxPolyFillRectangleReq;
+typedef xLbxPolyPointReq xLbxPolyFillArcReq;
+
+#define sz_xLbxPolyLineReq             sz_xLbxPolyPointReq
+#define sz_xLbxPolySegmentReq          sz_xLbxPolyPointReq
+#define sz_xLbxPolyRectangleReq                sz_xLbxPolyPointReq
+#define sz_xLbxPolyArcReq              sz_xLbxPolyPointReq
+#define sz_xLbxPolyFillRectangleReq    sz_xLbxPolyPointReq
+#define sz_xLbxPolyFillArc             sz_xLbxPolyPointReq
+
+typedef struct _LbxFillPoly {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD8      cacheEnts;
+    BYTE       shape;
+    CARD8      padBytes;
+} xLbxFillPolyReq;
+#define sz_xLbxFillPolyReq     7
+
+typedef struct _LbxCopyArea {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD8      srcCache;       /* source drawable */
+    CARD8      cacheEnts;      /* dest drawable and gc */
+    /* followed by encoded src x, src y, dst x, dst y, width, height */
+} xLbxCopyAreaReq;
+
+#define sz_xLbxCopyAreaReq  6
+
+typedef struct _LbxCopyPlane {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD32     bitPlane B32;
+    CARD8      srcCache;       /* source drawable */
+    CARD8      cacheEnts;      /* dest drawable and gc */
+    /* followed by encoded src x, src y, dst x, dst y, width, height */
+} xLbxCopyPlaneReq;
+
+#define sz_xLbxCopyPlaneReq  10
+
+typedef struct _LbxPolyText {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD8      cacheEnts;
+    /* followed by encoded src x, src y coordinates and text elts */
+} xLbxPolyTextReq;
+
+#define sz_xLbxPolyTextReq  5
+
+typedef xLbxPolyTextReq xLbxPolyText8Req;
+typedef xLbxPolyTextReq xLbxPolyText16Req;
+
+#define sz_xLbxPolyTextReq     5
+#define sz_xLbxPolyText8Req    5
+#define sz_xLbxPolyText16Req   5
+
+typedef struct _LbxImageText {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;
+    CARD16     length B16;
+    CARD8      cacheEnts;
+    CARD8      nChars;
+    /* followed by encoded src x, src y coordinates and string */
+} xLbxImageTextReq;
+
+typedef xLbxImageTextReq xLbxImageText8Req;
+typedef xLbxImageTextReq xLbxImageText16Req;
+
+#define sz_xLbxImageTextReq    6
+#define sz_xLbxImageText8Req   6
+#define sz_xLbxImageText16Req  6
+
+typedef struct {
+    CARD8       offset;
+    CARD8       diff;
+} xLbxDiffItem;
+#define sz_xLbxDiffItem    2
+
+typedef struct {
+    BYTE       type;           /* X_Reply */
+    CARD8      nOpts;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     optDataStart B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxStartReply;
+#define sz_xLbxStartReply      32
+#define sz_xLbxStartReplyHdr   8
+
+typedef struct _LbxQueryExtension {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxQueryExtension */
+    CARD16     length B16;
+    CARD32     nbytes B32;
+} xLbxQueryExtensionReq;
+#define        sz_xLbxQueryExtensionReq        8
+
+typedef struct _LbxQueryExtensionReply {
+    BYTE       type;                   /* X_Reply */
+    CARD8      numReqs;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    BOOL       present;
+    CARD8      major_opcode;
+    CARD8      first_event;
+    CARD8      first_error;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+
+    /* reply & event generating requests */
+} xLbxQueryExtensionReply;
+#define sz_xLbxQueryExtensionReply     32
+
+
+typedef struct _LbxBeginLargeRequest {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxBeginLargeRequest */
+    CARD16     length B16;
+    CARD32     largeReqLength B32;
+} xLbxBeginLargeRequestReq;
+#define        sz_BeginLargeRequestReq 8
+
+typedef struct _LbxLargeRequestData {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxLargeRequestData */
+    CARD16     length B16;
+    /* followed by LISTofCARD8 data */
+} xLbxLargeRequestDataReq;
+#define        sz_LargeRequestDataReq 4
+
+typedef struct _LbxEndLargeRequest {
+    CARD8      reqType;        /* always LbxReqCode */
+    CARD8      lbxReqType;     /* always X_LbxEndLargeRequest */
+    CARD16     length B16;
+} xLbxEndLargeRequestReq;
+#define        sz_EndLargeRequestReq 4
+
+
+
+typedef struct _LbxSwitchEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxSwitchEvent */
+    CARD16     pad B16;
+    CARD32     client B32;
+} xLbxSwitchEvent;
+#define sz_xLbxSwitchEvent     8
+
+typedef struct _LbxCloseEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxCloseEvent */
+    CARD16     sequenceNumber B16;
+    CARD32     client B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xLbxCloseEvent;
+#define sz_xLbxCloseEvent      32
+
+typedef struct _LbxInvalidateTagEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxInvalidateTagEvent */
+    CARD16     sequenceNumber B16;
+    CARD32     tag B32;
+    CARD32     tagType B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xLbxInvalidateTagEvent;
+#define sz_xLbxInvalidateTagEvent 32
+
+typedef struct _LbxSendTagDataEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxSendTagDataEvent */
+    CARD16     sequenceNumber B16;
+    CARD32     tag B32;
+    CARD32     tagType B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xLbxSendTagDataEvent;
+#define sz_xLbxSendTagDataEvent 32
+
+typedef struct _LbxListenToOneEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxListenToOneEvent */
+    CARD16     sequenceNumber B16;
+    CARD32     client B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xLbxListenToOneEvent;
+#define sz_xLbxListenToOneEvent 32
+
+typedef struct _LbxListenToAllEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxListenToAllEvent */
+    CARD16     sequenceNumber B16;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+    CARD32     pad7 B32;
+} xLbxListenToAllEvent;
+#define sz_xLbxListenToOneEvent 32
+
+typedef struct _LbxReleaseCmapEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxReleaseCmapEvent */
+    CARD16     sequenceNumber B16;
+    Colormap   colormap B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xLbxReleaseCmapEvent;
+#define sz_xLbxReleaseCmapEvent        32
+
+
+typedef struct _LbxFreeCellsEvent {
+    BYTE       type;           /* always eventBase + LbxEvent */
+    BYTE       lbxType;        /* LbxFreeCellsEvent */
+    CARD16     sequenceNumber B16;
+    Colormap   colormap B32;
+    CARD32     pixelStart B32;
+    CARD32     pixelEnd B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xLbxFreeCellsEvent;
+#define sz_xLbxFreeCellsEvent  32
+
+
+/*
+ * squished X event sizes.  If these change, be sure to update lbxquish.c
+ * and unsquish.c appropriately
+ *
+ * lbxsz_* is the padded squished length
+ * lbxupsz_* is the unpadded squished length
+ */
+
+#define          lbxsz_KeyButtonEvent          32
+#define        lbxupsz_KeyButtonEvent          31
+
+#define          lbxsz_EnterLeaveEvent         32
+#define        lbxupsz_EnterLeaveEvent         32
+
+#define          lbxsz_FocusEvent              12
+#define        lbxupsz_FocusEvent              9
+
+#define          lbxsz_KeymapEvent             32
+#define        lbxupsz_KeymapEvent             32
+
+#define          lbxsz_ExposeEvent             20
+#define        lbxupsz_ExposeEvent             18
+
+#define          lbxsz_GfxExposeEvent          24
+#define        lbxupsz_GfxExposeEvent          21
+
+#define          lbxsz_NoExposeEvent           12
+#define        lbxupsz_NoExposeEvent           11
+
+#define          lbxsz_VisibilityEvent         12
+#define        lbxupsz_VisibilityEvent         9
+
+#define          lbxsz_CreateNotifyEvent       24
+#define        lbxupsz_CreateNotifyEvent       23
+
+#define          lbxsz_DestroyNotifyEvent      12
+#define        lbxupsz_DestroyNotifyEvent      12
+
+#define          lbxsz_UnmapNotifyEvent        16
+#define        lbxupsz_UnmapNotifyEvent        13
+
+#define          lbxsz_MapNotifyEvent          16
+#define        lbxupsz_MapNotifyEvent          13
+
+#define          lbxsz_MapRequestEvent         12
+#define        lbxupsz_MapRequestEvent         12
+
+#define          lbxsz_ReparentEvent           24
+#define        lbxupsz_ReparentEvent           21
+
+#define          lbxsz_ConfigureNotifyEvent    28
+#define        lbxupsz_ConfigureNotifyEvent    27
+
+#define          lbxsz_ConfigureRequestEvent   28
+#define        lbxupsz_ConfigureRequestEvent   28
+
+#define          lbxsz_GravityEvent            16
+#define        lbxupsz_GravityEvent            16
+
+#define          lbxsz_ResizeRequestEvent      12
+#define        lbxupsz_ResizeRequestEvent      12
+
+#define          lbxsz_CirculateEvent          20
+#define        lbxupsz_CirculateEvent          17
+
+#define          lbxsz_PropertyEvent           20
+#define        lbxupsz_PropertyEvent           17
+
+#define          lbxsz_SelectionClearEvent     16
+#define        lbxupsz_SelectionClearEvent     16
+
+#define          lbxsz_SelectionRequestEvent   28
+#define        lbxupsz_SelectionRequestEvent   28
+
+#define          lbxsz_SelectionNotifyEvent    24
+#define        lbxupsz_SelectionNotifyEvent    24
+
+#define          lbxsz_ColormapEvent           16
+#define        lbxupsz_ColormapEvent           14
+
+#define          lbxsz_MappingNotifyEvent      8
+#define        lbxupsz_MappingNotifyEvent      7
+
+#define          lbxsz_ClientMessageEvent      32
+#define        lbxupsz_ClientMessageEvent      32
+
+#define        lbxsz_UnknownEvent              32
+
+#ifdef DEBUG
+
+#define DBG_SWITCH     0x00000001
+#define DBG_CLOSE      0x00000002
+#define DBG_IO         0x00000004
+#define DBG_READ_REQ   0x00000008
+#define DBG_LEN                0x00000010
+#define DBG_BLOCK      0x00000020
+#define DBG_CLIENT     0x00000040
+#define DBG_DELTA      0x00000080
+#endif
+/*
+ * Cancel the previous redefinition of the basic types, thus restoring their
+ * X.h definitions.
+ */
+
+#undef XID
+#undef Atom
+#undef Colormap
+#undef Drawable
+#undef VisualID
+#undef Window
+
+#endif /* _LBXPROTO_H_ */
diff --git a/mitmiscconst.h b/mitmiscconst.h
new file mode 100644 (file)
index 0000000..adc5f94
--- /dev/null
@@ -0,0 +1,38 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
+
+
+#ifndef _MITMISCCONST_H_
+#define _MITMISCCONST_H_
+
+#define MITMiscNumberEvents            0
+#define MITMiscNumberErrors            0
+
+#define MITMISCNAME "MIT-SUNDRY-NONSTANDARD"
+
+#endif
diff --git a/mitmiscproto.h b/mitmiscproto.h
new file mode 100644 (file)
index 0000000..18c202a
--- /dev/null
@@ -0,0 +1,68 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM OR X PROJECT TEAM BLESSING */
+
+#ifndef _MITMISCPROTO_H_
+#define _MITMISCPROTO_H_
+
+#include <X11/extensions/mitmiscconst.h>
+
+#define X_MITSetBugMode                        0
+#define X_MITGetBugMode                        1
+
+typedef struct _SetBugMode {
+    CARD8      reqType;        /* always MITReqCode */
+    CARD8      mitReqType;     /* always X_MITSetBugMode */
+    CARD16     length B16;
+    BOOL       onOff;
+    BYTE       pad0;
+    CARD16     pad1;
+} xMITSetBugModeReq;
+#define sz_xMITSetBugModeReq   8
+
+typedef struct _GetBugMode {
+    CARD8      reqType;        /* always MITReqCode */
+    CARD8      mitReqType;     /* always X_MITGetBugMode */
+    CARD16     length B16;
+} xMITGetBugModeReq;
+#define sz_xMITGetBugModeReq   4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    BOOL       onOff;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xMITGetBugModeReply;
+#define sz_xMITGetBugModeReply 32
+
+#endif /* _MITMISCPROTO_H_ */
diff --git a/multibufconst.h b/multibufconst.h
new file mode 100644 (file)
index 0000000..2d1238c
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+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.
+ */
+
+#ifndef _MULTIBUFCONST_H_
+#define _MULTIBUFCONST_H_
+
+#define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
+
+#define MULTIBUFFER_MAJOR_VERSION      1       /* current version numbers */
+#define MULTIBUFFER_MINOR_VERSION      1       /* has ClearImageBufferArea */
+
+/*
+ * update_action field
+ */
+#define MultibufferUpdateActionUndefined       0
+#define MultibufferUpdateActionBackground      1
+#define MultibufferUpdateActionUntouched       2
+#define MultibufferUpdateActionCopied          3
+
+/*
+ * update_hint field
+ */
+#define MultibufferUpdateHintFrequent          0
+#define MultibufferUpdateHintIntermittent      1
+#define MultibufferUpdateHintStatic            2
+
+/*
+ * valuemask fields
+ */
+#define MultibufferWindowUpdateHint    (1L << 0)
+#define MultibufferBufferEventMask     (1L << 0)
+
+/*
+ * mono vs. stereo and left vs. right
+ */
+#define MultibufferModeMono            0
+#define MultibufferModeStereo          1
+#define MultibufferSideMono            0
+#define MultibufferSideLeft            1
+#define MultibufferSideRight           2
+
+/*
+ * clobber state
+ */
+#define MultibufferUnclobbered         0
+#define MultibufferPartiallyClobbered  1
+#define MultibufferFullyClobbered      2
+
+/*
+ * event stuff
+ */
+#define MultibufferClobberNotifyMask   0x02000000
+#define MultibufferUpdateNotifyMask    0x04000000
+
+#define MultibufferClobberNotify       0
+#define MultibufferUpdateNotify                1
+#define MultibufferNumberEvents                (MultibufferUpdateNotify + 1)
+
+#define MultibufferBadBuffer           0
+#define MultibufferNumberErrors                (MultibufferBadBuffer + 1)
+
+#endif /* _MULTIBUFCONST_H_ */
diff --git a/multibufproto.h b/multibufproto.h
new file mode 100644 (file)
index 0000000..e2184d3
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+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.
+ */
+
+#ifndef _MULTIBUFPROTO_H_
+#define _MULTIBUFPROTO_H_
+
+#include <X11/extensions/multibufconst.h>
+
+/*
+ * Protocol requests constants and alignment values
+ */
+
+#define Window CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define Multibuffer CARD32
+
+#define X_MbufGetBufferVersion         0
+#define X_MbufCreateImageBuffers       1
+#define X_MbufDestroyImageBuffers      2
+#define X_MbufDisplayImageBuffers      3
+#define X_MbufSetMBufferAttributes     4
+#define X_MbufGetMBufferAttributes     5
+#define X_MbufSetBufferAttributes      6
+#define X_MbufGetBufferAttributes      7
+#define X_MbufGetBufferInfo            8
+#define X_MbufCreateStereoWindow       9
+#define X_MbufClearImageBufferArea     10
+
+
+typedef struct xMbufBufferInfo {
+       CARD32  visualID B32;           /* associated visual */
+       CARD16  maxBuffers B16;         /* maximum supported buffers */
+       CARD8   depth;                  /* depth of visual (redundant) */
+       CARD8   unused;
+} xMbufBufferInfo;
+#define sz_xMbufBufferInfo 8
+
+typedef struct {
+    BYTE    type;
+    BYTE    unused;
+    CARD16  sequenceNumber B16;
+    CARD32  buffer B32;                        /* affected buffer */
+    BYTE    state;                     /* current status */
+    CARD8   unused1;
+    CARD16  unused2 B16;
+    CARD32  unused3 B32;
+    CARD32  unused4 B32;
+    CARD32  unused5 B32;
+    CARD32  unused6 B32;
+    CARD32  unused7 B32;
+} xMbufClobberNotifyEvent;
+
+typedef struct {
+    BYTE    type;
+    BYTE    unused;
+    CARD16  sequenceNumber B16;
+    CARD32  buffer B32;                        /* affected buffer */
+    CARD32  timeStamp B32;             /* update time */
+    CARD32  unused1 B32;
+    CARD32  unused2 B32;
+    CARD32  unused3 B32;
+    CARD32  unused4 B32;
+    CARD32  unused5 B32;
+    CARD32  unused6 B32;
+} xMbufUpdateNotifyEvent;
+
+typedef struct {
+    CARD8      reqType;                /* always codes->major_opcode */
+    CARD8      mbufReqType;            /* always X_MbufGetBufferVersion */
+    CARD16     length B16;
+} xMbufGetBufferVersionReq;
+#define sz_xMbufGetBufferVersionReq    4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;                 /* not used */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD8      majorVersion;   /* major version of Multi-Buffering protocol */
+    CARD8      minorVersion;   /* minor version of Multi-Buffering protocol */
+    CARD16     pad1 B16;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xMbufGetBufferVersionReply;
+#define sz_xMbufGetBufferVersionReply  32
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufCreateImageBuffers */
+    CARD16     length B16;
+    CARD32     window B32;     /* associated window */
+    CARD8      updateAction;   /* action at update */
+    CARD8      updateHint;     /* hint as to frequency of updates */
+    CARD16     unused;
+} xMbufCreateImageBuffersReq;  /* followed by buffer ids */
+#define sz_xMbufCreateImageBuffersReq  12
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;                 /* not used */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     numberBuffer B16;       /* number successfully allocated */
+    CARD16     unused1 B16;
+    CARD32     unused2 B32;
+    CARD32     unused3 B32;
+    CARD32     unused4 B32;
+    CARD32     unused5 B32;
+    CARD32     unused6 B32;
+} xMbufCreateImageBuffersReply;
+#define sz_xMbufCreateImageBuffersReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufDestroyImageBuffers */
+    CARD16     length B16;
+    CARD32     window B32;     /* associated window */
+} xMbufDestroyImageBuffersReq;
+#define sz_xMbufDestroyImageBuffersReq 8
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufDisplayImageBuffers */
+    CARD16     length B16;
+    CARD16     minDelay B16;   /* minimum time between last update and now */
+    CARD16     maxDelay B16;   /* maximum time between last update and now */
+} xMbufDisplayImageBuffersReq; /* followed by list of buffers */
+#define sz_xMbufDisplayImageBuffersReq 8
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufSetMBufferAttributes */
+    CARD16     length B16;
+    CARD32     window B32;     /* associated window */
+    CARD32     valueMask B32;  /* modified entries */
+} xMbufSetMBufferAttributesReq;        /* followed by values */
+#define sz_xMbufSetMBufferAttributesReq 12
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufGetMBufferAttributes */
+    CARD16     length B16;
+    CARD32     window B32;     /* associated window */
+} xMbufGetMBufferAttributesReq;
+#define sz_xMbufGetMBufferAttributesReq 8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;                 /* not used */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     displayedBuffer B16;    /* currently visible buffer */
+    CARD8      updateAction;
+    CARD8      updateHint;
+    CARD8      windowMode;
+    CARD8      unused0;
+    CARD16     unused1 B16;
+    CARD32     unused2 B32;
+    CARD32     unused3 B32;
+    CARD32     unused4 B32;
+    CARD32     unused5 B32;
+} xMbufGetMBufferAttributesReply;
+#define sz_xMbufGetMBufferAttributesReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufSetBufferAttributes */
+    CARD16     length B16;
+    CARD32     buffer B32;
+    CARD32     valueMask B32;
+} xMbufSetBufferAttributesReq; /* followed by values */
+#define sz_xMbufSetBufferAttributesReq 12
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufGetBufferAttributes */
+    CARD16     length B16;
+    CARD32     buffer B32;
+} xMbufGetBufferAttributesReq;
+#define sz_xMbufGetBufferAttributesReq 8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;                 /* not used */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     window B32;
+    CARD32     eventMask B32;
+    CARD16     bufferIndex B16;
+    CARD8      side;
+    CARD8      unused0;
+    CARD32     unused1 B32;
+    CARD32     unused2 B32;
+    CARD32     unused3 B32;
+} xMbufGetBufferAttributesReply;
+#define sz_xMbufGetBufferAttributesReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufGetBufferInfo */
+    CARD16     length B16;
+    Drawable   drawable B32;
+} xMbufGetBufferInfoReq;
+#define sz_xMbufGetBufferInfoReq 8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      unused;                 /* not used */
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     normalInfo B16;
+    CARD16     stereoInfo B16;
+    CARD32     unused1 B32;
+    CARD32     unused2 B32;
+    CARD32     unused3 B32;
+    CARD32     unused4 B32;
+    CARD32     unused5 B32;
+} xMbufGetBufferInfoReply;                     /* followed by buffer infos */
+#define sz_xMbufGetBufferInfoReply 32
+
+
+typedef struct {
+    CARD8      reqType;        /* always codes->major_opcode */
+    CARD8      mbufReqType;    /* always X_MbufCreateStereoWindow */
+    CARD16     length B16;
+    CARD8      unused0;
+    CARD8      unused1;
+    CARD8      unused2;
+    CARD8      depth;
+    Window     wid B32;
+    Window     parent B32;
+    Multibuffer        left B32;       /* associated buffers */
+    Multibuffer        right B32;
+    INT16      x B16;
+    INT16      y B16;
+    CARD16     width B16;
+    CARD16     height B16;
+    CARD16     borderWidth B16;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16     c_class B16;
+#else
+    CARD16     class B16;
+#endif
+    VisualID   visual B32;
+    CARD32     mask B32;
+} xMbufCreateStereoWindowReq;          /* followed by value list */
+#define sz_xMbufCreateStereoWindowReq 44
+
+typedef struct {
+    CARD8     reqType;        /* always codes->major_opcode */
+    CARD8     mbufReqType;    /* always X_MbufClearImageBufferArea */
+    CARD16    length B16;
+    Multibuffer       buffer B32;
+    INT16     x B16;
+    INT16     y B16;
+    CARD16    width B16;
+    CARD16    height B16;
+    CARD8     unused0;
+    CARD8     unused1;
+    CARD8     unused2;
+    BOOL      exposures;
+} xMbufClearImageBufferAreaReq;
+#define sz_xMbufClearImageBufferAreaReq 20
+
+#undef Window
+#undef Drawable
+#undef VisualID
+#undef Multibuffer
+
+#endif /* _MULTIBUFPROTO_H_ */
diff --git a/packaging/xorg-x11-proto-xextproto.spec b/packaging/xorg-x11-proto-xextproto.spec
new file mode 100644 (file)
index 0000000..976d5ba
--- /dev/null
@@ -0,0 +1,50 @@
+
+Name:       xorg-x11-proto-xextproto
+Summary:    X.Org X11 Protocol xextproto
+Version:    7.1.2
+Release:    1
+Group:      Development/System
+License:    MIT
+URL:        http://www.x.org
+Source0:    http://xorg.freedesktop.org/releases/individual/proto/xextproto-%{version}.tar.gz
+Provides:   xextproto
+BuildRequires: pkgconfig(xorg-macros)
+
+%description
+Description: %{summary}
+
+
+
+%prep
+%setup -q -n xextproto-%{version}
+
+
+%build
+%reconfigure --prefix=/usr --mandir=%{_datadir}/man --infodir=%{_datadir}/info \
+       --disable-shared \
+       CFLAGS="-Wall -g -D_F_ENABLE_XI2_SENDEVENT_"
+       
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+%clean
+rm -rf %{buildroot}
+
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/xextproto.pc
+%{_includedir}/X11/extensions/*.h
+%{_datadir}/doc/xextproto/*.xml
+
+
diff --git a/secur.h b/secur.h
new file mode 100644 (file)
index 0000000..ca27b29
--- /dev/null
+++ b/secur.h
@@ -0,0 +1,61 @@
+/*
+Copyright 1996, 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 _SECUR_H
+#define _SECUR_H
+
+#define SECURITY_EXTENSION_NAME                "SECURITY"
+#define SECURITY_MAJOR_VERSION         1
+#define SECURITY_MINOR_VERSION         0
+
+#define XSecurityNumberEvents          1
+#define XSecurityNumberErrors          2
+#define XSecurityBadAuthorization      0
+#define XSecurityBadAuthorizationProtocol 1
+
+/* trust levels */
+#define XSecurityClientTrusted         0
+#define XSecurityClientUntrusted       1
+
+/* authorization attribute masks */
+#define XSecurityTimeout               (1<<0)
+#define XSecurityTrustLevel            (1<<1)
+#define XSecurityGroup                 (1<<2)
+#define XSecurityEventMask             (1<<3)
+#define XSecurityAllAuthorizationAttributes \
+ (XSecurityTimeout | XSecurityTrustLevel | XSecurityGroup | XSecurityEventMask)
+
+/* event masks */
+#define XSecurityAuthorizationRevokedMask (1<<0)
+#define XSecurityAllEventMasks XSecurityAuthorizationRevokedMask
+
+/* event offsets */
+#define XSecurityAuthorizationRevoked 0
+
+#define XSecurityAuthorizationName     "XC-QUERY-SECURITY-1"
+#define XSecurityAuthorizationNameLen  19
+
+#endif /* _SECUR_H */
diff --git a/securproto.h b/securproto.h
new file mode 100644 (file)
index 0000000..409a4c5
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+Copyright 1996, 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 _SECURPROTO_H
+#define _SECURPROTO_H
+
+#include <X11/extensions/secur.h>
+
+#define X_SecurityQueryVersion         0
+#define X_SecurityGenerateAuthorization 1
+#define X_SecurityRevokeAuthorization   2
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       securityReqType;
+    CARD16      length B16;
+    CARD16      majorVersion B16;
+    CARD16      minorVersion B16;
+} xSecurityQueryVersionReq;
+#define sz_xSecurityQueryVersionReq    8
+
+typedef struct {
+    CARD8   type;
+    CARD8   pad0;
+    CARD16  sequenceNumber B16;
+    CARD32  length      B32;
+    CARD16  majorVersion B16;
+    CARD16  minorVersion B16;
+    CARD32  pad1        B32;
+    CARD32  pad2        B32;
+    CARD32  pad3        B32;
+    CARD32  pad4        B32;
+    CARD32  pad5        B32;
+ } xSecurityQueryVersionReply;
+#define sz_xSecurityQueryVersionReply          32
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       securityReqType;
+    CARD16      length B16;
+    CARD16     nbytesAuthProto B16;
+    CARD16     nbytesAuthData B16;
+    CARD32     valueMask B32;
+    /* auth protocol name padded to 4 bytes */
+    /* auth protocol data padded to 4 bytes */
+    /* list of CARD32 values, if any */
+} xSecurityGenerateAuthorizationReq;
+#define sz_xSecurityGenerateAuthorizationReq 12
+
+typedef struct {
+    CARD8   type;
+    CARD8   pad0;
+    CARD16  sequenceNumber B16;
+    CARD32  length      B32;
+    CARD32  authId      B32;
+    CARD16  dataLength   B16;
+    CARD16  pad1        B16;
+    CARD32  pad2        B32;
+    CARD32  pad3        B32;
+    CARD32  pad4        B32;
+    CARD32  pad5        B32;
+ } xSecurityGenerateAuthorizationReply;
+#define sz_xSecurityGenerateAuthorizationReply         32
+
+typedef struct {
+    CARD8       reqType;
+    CARD8       securityReqType;
+    CARD16      length B16;
+    CARD32     authId B32;
+} xSecurityRevokeAuthorizationReq;
+#define sz_xSecurityRevokeAuthorizationReq 8
+
+typedef struct _xSecurityAuthorizationRevokedEvent {
+    BYTE       type;
+    BYTE       detail;
+    CARD16     sequenceNumber B16;
+    CARD32     authId B32;
+    CARD32     pad0     B32;
+    CARD32     pad1     B32;
+    CARD32     pad2     B32;
+    CARD32     pad3     B32;
+    CARD32     pad4     B32;
+    CARD32     pad5     B32;
+} xSecurityAuthorizationRevokedEvent;
+#define sz_xSecurityAuthorizationRevokedEvent 32
+
+#endif /* _SECURPROTO_H */
diff --git a/shapeconst.h b/shapeconst.h
new file mode 100644 (file)
index 0000000..9088956
--- /dev/null
@@ -0,0 +1,55 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+#ifndef _SHAPECONST_H_
+#define _SHAPECONST_H_
+
+/*
+ * Protocol requests constants and alignment values
+ * These would really be in SHAPE's X.h and Xproto.h equivalents
+ */
+
+#define SHAPENAME "SHAPE"
+
+#define SHAPE_MAJOR_VERSION    1       /* current version numbers */
+#define SHAPE_MINOR_VERSION    1
+
+#define ShapeSet                       0
+#define ShapeUnion                     1
+#define ShapeIntersect                 2
+#define ShapeSubtract                  3
+#define ShapeInvert                    4
+
+#define ShapeBounding                  0
+#define ShapeClip                      1
+#define ShapeInput                     2
+
+#define ShapeNotifyMask                        (1L << 0)
+#define ShapeNotify                    0
+
+#define ShapeNumberEvents              (ShapeNotify + 1)
+
+#endif /* _SHAPECONST_H_ */
diff --git a/shapeproto.h b/shapeproto.h
new file mode 100644 (file)
index 0000000..49bd1a1
--- /dev/null
@@ -0,0 +1,237 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+#ifndef _SHAPEPROTO_H_
+#define _SHAPEPROTO_H_
+
+#include <X11/extensions/shapeconst.h>
+
+/*
+ * Protocol requests constants and alignment values
+ * These would really be in SHAPE's X.h and Xproto.h equivalents
+ */
+
+#define Window CARD32
+#define Time CARD32
+
+#define X_ShapeQueryVersion            0
+#define X_ShapeRectangles              1
+#define X_ShapeMask                    2
+#define X_ShapeCombine                 3
+#define X_ShapeOffset                  4
+#define X_ShapeQueryExtents            5
+#define X_ShapeSelectInput             6
+#define X_ShapeInputSelected           7
+#define X_ShapeGetRectangles           8
+
+typedef struct _ShapeQueryVersion {
+       CARD8   reqType;                /* always ShapeReqCode */
+       CARD8   shapeReqType;           /* always X_ShapeQueryVersion */
+       CARD16  length B16;
+} xShapeQueryVersionReq;
+#define sz_xShapeQueryVersionReq       4
+
+typedef struct {
+       BYTE    type;                   /* X_Reply */
+       CARD8   unused;                 /* not used */
+       CARD16  sequenceNumber B16;
+       CARD32  length B32;
+       CARD16  majorVersion B16;       /* major version of SHAPE protocol */
+       CARD16  minorVersion B16;       /* minor version of SHAPE protocol */
+       CARD32  pad0 B32;
+       CARD32  pad1 B32;
+       CARD32  pad2 B32;
+       CARD32  pad3 B32;
+       CARD32  pad4 B32;
+} xShapeQueryVersionReply;
+#define sz_xShapeQueryVersionReply     32
+
+typedef struct _ShapeRectangles {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeRectangles */
+       CARD16  length B16;
+       CARD8   op;             /* Set, ... */
+       CARD8   destKind;       /* ShapeBounding or ShapeClip */
+       CARD8   ordering;       /* UnSorted, YSorted, YXSorted, YXBanded */
+       CARD8   pad0;           /* not used */
+       Window  dest B32;
+       INT16   xOff B16;
+       INT16   yOff B16;
+} xShapeRectanglesReq;         /* followed by xRects */
+#define sz_xShapeRectanglesReq 16
+
+typedef struct _ShapeMask {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeMask */
+       CARD16  length B16;
+
+       CARD8   op;             /* Set, ... */
+       CARD8   destKind;       /* ShapeBounding or ShapeClip */
+       CARD16  junk B16;       /* not used */
+
+       Window  dest B32;
+       INT16   xOff B16;
+       INT16   yOff B16;
+       CARD32  src B32;        /* 1 bit pixmap */
+} xShapeMaskReq;
+#define sz_xShapeMaskReq       20
+
+typedef struct _ShapeCombine {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeCombine */
+       CARD16  length B16;
+       CARD8   op;             /* Set, ... */
+       CARD8   destKind;       /* ShapeBounding or ShapeClip */
+       CARD8   srcKind;        /* ShapeBounding or ShapeClip */
+       CARD8   junk;           /* not used */
+       Window  dest B32;
+       INT16   xOff B16;
+       INT16   yOff B16;
+       Window  src B32;
+} xShapeCombineReq;
+#define sz_xShapeCombineReq    20
+
+typedef struct _ShapeOffset {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeOffset */
+       CARD16  length B16;
+       CARD8   destKind;       /* ShapeBounding or ShapeClip */
+       CARD8   junk1;          /* not used */
+       CARD16  junk2 B16;      /* not used */
+       Window  dest B32;
+       INT16   xOff B16;
+       INT16   yOff B16;
+} xShapeOffsetReq;
+#define sz_xShapeOffsetReq     16
+
+typedef struct _ShapeQueryExtents {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeQueryExtents */
+       CARD16  length B16;
+       Window  window B32;
+} xShapeQueryExtentsReq;
+#define sz_xShapeQueryExtentsReq       8
+
+typedef struct {
+       BYTE    type;                   /* X_Reply */
+       CARD8   unused;                 /* not used */
+       CARD16  sequenceNumber B16;
+       CARD32  length B32;             /* 0 */
+       CARD8   boundingShaped;         /* window has bounding shape */
+       CARD8   clipShaped;             /* window has clip shape */
+       CARD16  unused1 B16;
+       INT16   xBoundingShape B16;     /* extents of bounding shape */
+       INT16   yBoundingShape B16;
+       CARD16  widthBoundingShape B16;
+       CARD16  heightBoundingShape B16;
+       INT16   xClipShape B16;         /* extents of clip shape */
+       INT16   yClipShape B16;
+       CARD16  widthClipShape B16;
+       CARD16  heightClipShape B16;
+       CARD32  pad1 B32;
+} xShapeQueryExtentsReply;
+#define sz_xShapeQueryExtentsReply     32
+
+typedef struct _ShapeSelectInput {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeSelectInput */
+       CARD16  length B16;
+       Window  window B32;
+       BYTE    enable;         /* xTrue -> send events */
+       BYTE    pad1;
+       CARD16  pad2 B16;
+} xShapeSelectInputReq;
+#define sz_xShapeSelectInputReq        12
+
+typedef struct _ShapeNotify {
+       BYTE    type;           /* always eventBase + ShapeNotify */
+       BYTE    kind;           /* either ShapeBounding or ShapeClip */
+       CARD16  sequenceNumber B16;
+       Window  window B32;
+       INT16   x B16;
+       INT16   y B16;          /* extents of new shape */
+       CARD16  width B16;
+       CARD16  height B16;
+       Time    time B32;       /* time of change */
+       BYTE    shaped;         /* set when a shape actual exists */
+       BYTE    pad0;
+       CARD16  pad1 B16;
+       CARD32  pad2 B32;
+       CARD32  pad3 B32;
+} xShapeNotifyEvent;
+#define sz_xShapeNotifyEvent   32
+
+typedef struct _ShapeInputSelected {
+       CARD8   reqType;        /* always ShapeReqCode */
+       CARD8   shapeReqType;   /* always X_ShapeInputSelected */
+       CARD16  length B16;
+       Window  window B32;
+} xShapeInputSelectedReq;
+#define sz_xShapeInputSelectedReq 8
+
+typedef struct {
+       BYTE    type;                   /* X_Reply */
+       CARD8   enabled;                /* current status */
+       CARD16  sequenceNumber B16;
+       CARD32  length B32;             /* 0 */
+       CARD32  pad1 B32;               /* unused */
+       CARD32  pad2 B32;
+       CARD32  pad3 B32;
+       CARD32  pad4 B32;
+       CARD32  pad5 B32;
+       CARD32  pad6 B32;
+} xShapeInputSelectedReply;
+#define sz_xShapeInputSelectedReply    32
+
+typedef struct _ShapeGetRectangles {
+    CARD8   reqType;           /* always ShapeReqCode */
+    CARD8   shapeReqType;      /* always X_ShapeGetRectangles */
+    CARD16  length B16;
+    Window  window B32;
+    CARD8   kind;              /* ShapeBounding or ShapeClip */
+    CARD8   junk1;
+    CARD16  junk2 B16;
+} xShapeGetRectanglesReq;
+#define sz_xShapeGetRectanglesReq      12
+
+typedef struct {
+       BYTE    type;                   /* X_Reply */
+       CARD8   ordering;       /* UnSorted, YSorted, YXSorted, YXBanded */
+       CARD16  sequenceNumber B16;
+       CARD32  length B32;             /* not zero */
+       CARD32  nrects B32;             /* number of rectangles */
+       CARD32 pad1 B32;
+       CARD32 pad2 B32;
+       CARD32 pad3 B32;
+       CARD32 pad4 B32;
+       CARD32 pad5 B32;
+} xShapeGetRectanglesReply;            /* followed by xRectangles */
+#define sz_xShapeGetRectanglesReply 32
+
+#undef Window
+#undef Time
+
+#endif /* _SHAPEPROTO_H_ */
diff --git a/shapestr.h b/shapestr.h
new file mode 100755 (executable)
index 0000000..20fde1d
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _SHAPESTR_H_
+#define _SHAPESTR_H_
+
+#warning "shapestr.h is obsolete and may be removed in the future."
+#warning "include <X11/extensions/shapeproto.h> for the protocol defines."
+#include <X11/extensions/shapeproto.h>
+
+#endif /* _SHAPESTR_H_ */
diff --git a/shm.h b/shm.h
new file mode 100644 (file)
index 0000000..e076402
--- /dev/null
+++ b/shm.h
@@ -0,0 +1,44 @@
+/************************************************************
+
+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.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _SHM_H_
+#define _SHM_H_
+
+#define SHMNAME "MIT-SHM"
+
+#define SHM_MAJOR_VERSION      1       /* current version numbers */
+#define SHM_MINOR_VERSION      1
+
+#define ShmCompletion                  0
+#define ShmNumberEvents                        (ShmCompletion + 1)
+
+#define BadShmSeg                      0
+#define ShmNumberErrors                        (BadShmSeg + 1)
+
+
+#endif /* _SHM_H_ */
diff --git a/shmproto.h b/shmproto.h
new file mode 100644 (file)
index 0000000..e5de377
--- /dev/null
@@ -0,0 +1,187 @@
+/************************************************************
+
+Copyright 1989, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _SHMPROTO_H_
+#define _SHMPROTO_H_
+
+#include <X11/extensions/shm.h>
+
+#define ShmSeg CARD32
+#define Drawable CARD32
+#define VisualID CARD32
+#define GContext CARD32
+#define Pixmap CARD32
+
+#define X_ShmQueryVersion              0
+#define X_ShmAttach                    1
+#define X_ShmDetach                    2
+#define X_ShmPutImage                  3
+#define X_ShmGetImage                  4
+#define X_ShmCreatePixmap              5
+
+typedef struct _ShmQueryVersion {
+    CARD8      reqType;                /* always ShmReqCode */
+    CARD8      shmReqType;             /* always X_ShmQueryVersion */
+    CARD16     length B16;
+} xShmQueryVersionReq;
+#define sz_xShmQueryVersionReq 4
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    BOOL       sharedPixmaps;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     majorVersion B16;       /* major version of SHM protocol */
+    CARD16     minorVersion B16;       /* minor version of SHM protocol */
+    CARD16     uid B16;
+    CARD16     gid B16;
+    CARD8      pixmapFormat;
+    CARD8      pad0;
+    CARD16     pad1 B16;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xShmQueryVersionReply;
+#define sz_xShmQueryVersionReply       32
+
+typedef struct _ShmAttach {
+    CARD8      reqType;        /* always ShmReqCode */
+    CARD8      shmReqType;     /* always X_ShmAttach */
+    CARD16     length B16;
+    ShmSeg     shmseg B32;
+    CARD32     shmid B32;
+    BOOL       readOnly;
+    BYTE       pad0;
+    CARD16     pad1 B16;
+} xShmAttachReq;
+#define sz_xShmAttachReq       16
+
+typedef struct _ShmDetach {
+    CARD8      reqType;        /* always ShmReqCode */
+    CARD8      shmReqType;     /* always X_ShmDetach */
+    CARD16     length B16;
+    ShmSeg     shmseg B32;
+} xShmDetachReq;
+#define sz_xShmDetachReq       8
+
+typedef struct _ShmPutImage {
+    CARD8      reqType;        /* always ShmReqCode */
+    CARD8      shmReqType;     /* always X_ShmPutImage */
+    CARD16     length B16;
+    Drawable   drawable B32;
+    GContext   gc B32;
+    CARD16     totalWidth B16;
+    CARD16     totalHeight B16;
+    CARD16     srcX B16;
+    CARD16     srcY B16;
+    CARD16     srcWidth B16;
+    CARD16     srcHeight B16;
+    INT16      dstX B16;
+    INT16      dstY B16;
+    CARD8      depth;
+    CARD8      format;
+    CARD8      sendEvent;
+    CARD8      bpad;
+    ShmSeg     shmseg B32;
+    CARD32     offset B32;
+} xShmPutImageReq;
+#define sz_xShmPutImageReq     40
+
+typedef struct _ShmGetImage {
+    CARD8      reqType;        /* always ShmReqCode */
+    CARD8      shmReqType;     /* always X_ShmGetImage */
+    CARD16     length B16;
+    Drawable   drawable B32;
+    INT16      x B16;
+    INT16      y B16;
+    CARD16     width B16;
+    CARD16     height B16;
+    CARD32     planeMask B32;
+    CARD8      format;
+    CARD8      pad0;
+    CARD8      pad1;
+    CARD8      pad2;
+    ShmSeg     shmseg B32;
+    CARD32     offset B32;
+} xShmGetImageReq;
+#define sz_xShmGetImageReq     32
+
+typedef struct _ShmGetImageReply {
+    BYTE       type;  /* X_Reply */
+    CARD8      depth;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    VisualID   visual B32;
+    CARD32     size B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+} xShmGetImageReply;
+#define sz_xShmGetImageReply   32
+
+typedef struct _ShmCreatePixmap {
+    CARD8      reqType;        /* always ShmReqCode */
+    CARD8      shmReqType;     /* always X_ShmCreatePixmap */
+    CARD16     length B16;
+    Pixmap     pid B32;
+    Drawable   drawable B32;
+    CARD16     width B16;
+    CARD16     height B16;
+    CARD8      depth;
+    CARD8      pad0;
+    CARD8      pad1;
+    CARD8      pad2;
+    ShmSeg     shmseg B32;
+    CARD32     offset B32;
+} xShmCreatePixmapReq;
+#define sz_xShmCreatePixmapReq 28
+
+typedef struct _ShmCompletion {
+    BYTE       type;           /* always eventBase + ShmCompletion */
+    BYTE       bpad0;
+    CARD16     sequenceNumber B16;
+    Drawable   drawable B32;
+    CARD16     minorEvent B16;
+    BYTE       majorEvent;
+    BYTE       bpad1;
+    ShmSeg     shmseg B32;
+    CARD32     offset B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+} xShmCompletionEvent;
+#define sz_xShmCompletionEvent 32
+
+#undef ShmSeg
+#undef Drawable
+#undef VisualID
+#undef GContext
+#undef Pixmap
+
+#endif /* _SHMPROTO_H_ */
diff --git a/shmstr.h b/shmstr.h
new file mode 100755 (executable)
index 0000000..6358860
--- /dev/null
+++ b/shmstr.h
@@ -0,0 +1,66 @@
+/* $XFree86: xc/include/extensions/shmstr.h,v 3.3 2001/12/14 19:53:29 dawes Exp $ */
+/************************************************************
+
+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.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _SHMSTR_H_
+#define _SHMSTR_H_
+
+/* $Xorg: shmstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+#include <X11/extensions/shmproto.h>
+
+#ifdef _XSHM_SERVER_
+#define XSHM_PUT_IMAGE_ARGS \
+    DrawablePtr                /* dst */, \
+    GCPtr              /* pGC */, \
+    int                        /* depth */, \
+    unsigned int       /* format */, \
+    int                        /* w */, \
+    int                        /* h */, \
+    int                        /* sx */, \
+    int                        /* sy */, \
+    int                        /* sw */, \
+    int                        /* sh */, \
+    int                        /* dx */, \
+    int                        /* dy */, \
+    char *             /* data */
+
+#define XSHM_CREATE_PIXMAP_ARGS \
+    ScreenPtr  /* pScreen */, \
+    int                /* width */, \
+    int                /* height */, \
+    int                /* depth */, \
+    char *     /* addr */
+
+typedef struct _ShmFuncs {
+    PixmapPtr  (* CreatePixmap)(XSHM_CREATE_PIXMAP_ARGS);
+    void       (* PutImage)(XSHM_PUT_IMAGE_ARGS);
+} ShmFuncs, *ShmFuncsPtr;
+#endif
+
+#endif /* _SHMSTR_H_ */
diff --git a/specs/Makefile.am b/specs/Makefile.am
new file mode 100755 (executable)
index 0000000..3e631a1
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. 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.
+#
+
+if ENABLE_SPECS
+doc_sources =          \
+       appgroup.xml    \
+       dbe.xml         \
+       dpms.xml        \
+       evi.xml         \
+       geproto.xml     \
+       multibuf.xml    \
+       security.xml    \
+       shape.xml       \
+       shm.xml         \
+       sync.xml        \
+       tog-cup.xml     \
+       xtest.xml
+
+dist_doc_DATA = $(doc_sources)
+
+if HAVE_XMLTO
+doc_DATA = $(doc_sources:.xml=.html)
+
+if HAVE_FOP
+doc_DATA += $(doc_sources:.xml=.ps) $(doc_sources:.xml=.pdf)
+endif
+
+if HAVE_XMLTO_TEXT
+doc_DATA += $(doc_sources:.xml=.txt)
+endif
+
+if HAVE_STYLESHEETS
+XMLTO_FLAGS = -m $(XSL_STYLESHEET)
+
+doc_DATA += xorg.css
+xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
+       $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+endif
+
+CLEANFILES = $(doc_DATA)
+
+SUFFIXES = .xml .ps .pdf .txt .html
+
+.xml.txt:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
+
+.xml.html:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
+
+.xml.pdf:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
+
+.xml.ps:
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop ps $<
+
+endif HAVE_XMLTO
+endif ENABLE_SPECS
diff --git a/specs/appgroup.xml b/specs/appgroup.xml
new file mode 100755 (executable)
index 0000000..eebf843
--- /dev/null
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<book id="appgroup">
+
+<bookinfo>
+   <title>Description of the Application Group Extension</title>
+   <subtitle>Implementation for the X11 Sample Server</subtitle>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Kaleb </firstname><surname>KEITHLEY</surname>
+         <affiliation><orgname>FUJITSU Limited.</orgname></affiliation>
+         <email>blah@blah.com</email>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1996</year><holder>X Consortium</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 7</productnumber>
+
+<abstract>
+<para>
+The following document explains the server side of the Application
+Group Extension.
+</para>
+</abstract>
+
+<legalnotice>
+
+
+<para>
+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:
+</para>
+
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+
+<para>
+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.
+</para>
+
+<para>
+The following document explains the server side of the Application
+Group Extension.
+</para>
+
+<para>
+WindowsNT is a trademark of Microsoft, Inc.  Macintosh and Apple
+are trademarks of Apple Computer, Inc.  X Window System is a
+trademark of X Consortium, Inc.
+</para>
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<para>
+To understand this document and the accompanying source code, you
+should know the C language, should be familiar with X server
+internals, and should also have a general knowledge of the X
+Window System.
+</para>
+
+<sect1 id="AppGroup_Server_Public_Functions">
+<title>AppGroup Server Public Functions</title>
+<para>
+The AppGroup extension adds seven new functions that are called
+from elsewhere in the server. They are: XagExtensionInit,
+XagDefaultColormap, XagRootVisual, XagLeader, XagIsControlledRoot,
+XagConnectionInfo, XagCallClientStateChange.
+</para>
+<para>
+XagExtensionInit is the extension initialization function called
+from InitExtension in mi/miinitext.c. Note that an new resource
+type, RT_APPGROUP, is created, specifying the destructor function
+XagAppGroupFree.
+</para>
+<para>
+XagDefaultColormap returns the colormap ID that was specified in
+the creation of the AppGroup. Any time CopyFromParent is specified
+for a top-level window's colormap, i.e. in a CreateWindow or
+ChangeWindowAttributes request, this function is called to see
+if there is an AppGroup specific colormap to use. If there is
+one, its ID is returned, otherwise None is returned.
+</para>
+<para>
+XagRootVisual returns the visual ID that was specified in the
+creation of the Appgroup. Like XagDefaultColormap, when CopyFromParent
+is specified for a top-level window's visual in a CreateWindow
+request, this function is called to see if there is an AppGroup
+specific visual to use. If there is one, its ID is returned,
+otherwise 0 (zero) is returned.
+</para>
+<para>
+XagLeader returns the ClientPtr of the client that is the AppGroup
+Leader. Normally when an application maps or configures a top-level
+window a MapRequest or ConfigureRequest event is delivered to the
+client, e.g. a window manager, that has selected SubstructureRedirect
+on the root window. However, when the application is part of an
+AppGroup, the MapRequest and ConfigureRequest events are delivered
+to the AppGroup Leader instead.
+</para>
+<para>
+XagIsControlledRoot returns a boolean: True if the window is a
+top-level window of a client in an AppGroup, False otherwise.
+In a combined server, i.e. one that provides both UI and printing,
+the application may create and map windows on the "printing"
+screens; thus it becomes necessary to discriminate between the
+AppGroup's root window and other root windows. If an AppGroup
+member creates and maps a [top-level] window then the window's
+parent [the root window] is tested to determine whether to send
+MapRequest or ConfigureRequest events to the AppGroup Leader to
+to some other client.
+</para>
+<para>
+In the trivial case XagIsControlledRoot returns True if the parent
+window has no parent itself, i.e. it is a root window. In the case
+where the application is embedded, indicated by the singleScreen
+attribute being True, the parent's drawable ID is compared to the
+AppGroup's root window ID, and if it is the same, True is returned.
+If neither case is true, then False is returned.
+</para>
+<para>
+XagConnectionInfo returns an abreviated version of the connection
+setup information. When an embedded AppGroup is created the server
+returns only the information about the [UI] screen that the
+application is embedded within in the connection setup in order to
+prevent the application from creating windows on other screens;
+thus attempting to guarantee that any window that should be embedded
+can be reparented into the AppGroup Leader's window hierarchy.
+</para>
+<para>
+XagCallClientStateChange is called to invoke the extension's client
+state change callback additional times as necessary -- currently
+only once, after the auth data becomes available between
+ClientStateInitial and ClientStateConnected. Client state change
+callbacks were introduced in the Record extension, which specifies
+when the callbacks are invoked. Unfortunately the points at which
+they are called are not necessarily the best as far as the AppGroup
+Extension is concerned. Adding an additional state and calling all
+the callbacks works too, however this seemed unnecessary overkill.
+</para>
+</sect1>
+
+<sect1 id="AppGroup_Server_Private_APIs">
+<title>AppGroup Server Private APIs</title>
+<para>
+The AppGroup extension adds the following functions which are
+private to the extension: ProcXagDispatch and SProcXagDispatch,
+ProcXagQueryVersion and SProcXagQueryVersion, ProcXagCreate and
+SProcXagCreate, ProcXagDestroy and SProcXagDestroy,
+ProcGetAttr and SProcGetAttr, ProcXagQuery and SProcXagQuery,
+ProcXagCreateAssoc and SProcXagCreateAssoc, ProcXagDestroyAssoc
+and SProcXagDestroyAssoc, XagResetProc, and XagAppGroupFree.
+</para>
+<para>
+The ProcXagDispatch, SProcXagDispatch, and XagResetProc functions
+should be familiar to anyone familiar with X server internals and
+I won't elaborate on them here. Similarly the wrapper functions:
+SProcXagQueryVersion, SProcXagCreate, SProcXagDestroy, SProcXagGetAttr,
+SProcXagQuery, SProcXagCreateAssoc, and SProcXagDestroyAssoc, as
+wrappers which handle swapping integer data into the host's byte
+order will not be explained in any detail.
+</para>
+<para>
+ProcXagQueryVersion returns the major and minor versions of the
+AppGroup extension supported by the server.
+</para>
+<para>
+ProcXagCreate creates an AppGroup. A new record in a linked list
+of AppGroups is allocated and initialized. The attributes from the
+request are validated and copied to the AppGroup record. If necessary
+an abbreviated version of the connection setup information is compiled
+and also stored in the AppGroup record. The first time an AppGroup
+is created a client-state-change callback is registered and a
+reference count is incremented.
+</para>
+<para>
+ProcXagDestroy destroys an AppGroup an AppGroup by calling
+FreeResource specifying the AppGroup ID. This will result in
+the destructor function XagAppGroupFree being called. The
+reference count is decremented and when it reaches zero the
+client-state-change callback is deleted.
+</para>
+<para>
+ProcXagGetAttr returns the AppGroup Attributes to the requesting
+client.
+</para>
+<para>
+ProcXagQuery returns the AppGroup ID of an arbitrary resource to
+the requesting client.
+</para>
+<para>
+ProcXagCreateAssoc creates an association between an X window ID
+and system-specific data. In native X this functionality is
+unnecessary but for various personal computers, e.g. Macintosh,
+OS/2, and MS-Windows it is necessary to associate an X window ID
+with the system's native window identifier so that when the
+AppGroup Leader issues a ReparentWindow request the personal
+computer X server can lookup the system-specific window ID and
+make the necessary function call(s) with it.
+</para>
+<para>
+ProcXagDestroyAssoc destroys the association created with
+ProcXagCreateAssoc.
+</para>
+<para>
+XagResetProc removes the client-state-change callback, sets the
+reference count to zero, and frees all the AppGroup records in
+the linked list by calling XagAppGroupFree.
+</para>
+<para>
+XagAppGroupFree calls CloseDownClient for each client in an
+AppGroup if the AppGroup has a leader, unlinks the AppGroup
+record from the linked list, frees allocated memory referenced
+by the record, and finally frees the record itself.
+</para>
+</sect1>
+
+<sect1 id="Known_Problems_in_this_release_">
+<title>Known Problems in this release.</title>
+<para>
+In a combined UI/Print server the connection setup returned to an
+embedded application will not have information about the print
+screens.
+</para>
+<para>
+The LBX proxy caches connection setup information and will return
+incorrect connection setup information to an embedded client.
+</para>
+</sect1>
+</chapter>
+</book>
diff --git a/specs/dbe.xml b/specs/dbe.xml
new file mode 100755 (executable)
index 0000000..ce7a327
--- /dev/null
@@ -0,0 +1,1061 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
+
+<!--
+by TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)
+xhtml,docbook,html,refcaption -->
+
+<book id="dbe">
+
+<bookinfo>
+  <title>Double Buffer Extension Protocol</title>
+  <subtitle>X Consortium Standard</subtitle>
+  <releaseinfo>X Version 11, Release 6.4</releaseinfo>
+  <authorgroup>
+   <author>
+     <firstname>Ian</firstname><surname>Elliott</surname>
+   </author>
+  </authorgroup>
+  <othercredit>
+   <firstname>David</firstname><surname>Wiggins</surname>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+  </othercredit>
+  <corpname>Hewlett-Packard Company</corpname>
+  <copyright>
+   <year>1989</year>
+   <holder>X Consortium, Inc and Digital Equipment Corporation</holder>
+  </copyright>
+  <copyright>
+   <year>1992</year>
+   <holder>X Consortium, Inc and Intergraph Corporation</holder>
+  </copyright>
+  <copyright>
+   <year>1993</year>
+   <holder>X Consortium, Inc and Silicon Graphics, Inc</holder>
+  </copyright>
+  <copyright>
+   <year>1994</year>
+   <holder>X Consortium, Inc and Hewlett-Packard Company</holder>
+  </copyright>
+  <releaseinfo>Version 1.0</releaseinfo>
+
+<legalnotice>
+<para>
+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. Digital Equipment
+Corporation, Intergraph Corporation, Silicon Graphics, Hewlett-Packard, and
+the X Consortium make no representations about the suitability for any purpose
+of the information in this document. This documentation is provided "as is"
+without express or implied warranty.
+</para>
+</legalnotice>
+</bookinfo>
+
+<chapter id="introduction">
+<title>Introduction</title>
+<para>The Double Buffer Extension (DBE) provides a standard way to utilize
+double-buffering within the framework of the X Window System. Double-buffering
+uses two buffers, called front and back, which hold images. The front buffer
+is visible to the user; the back buffer is not. Successive frames of an
+animation are rendered into the back buffer while the previously rendered
+frame is displayed in the front buffer. When a new frame is ready, the back
+and front buffers swap roles, making the new frame visible. Ideally, this
+exchange appears to happen instantaneously to the user and with no visual
+artifacts. Thus, only completely rendered images are presented to the user,
+and they remain visible during the entire time it takes to render a new frame.
+The result is a flicker-free animation.
+</para>
+</chapter>
+
+<chapter id="goals">
+<title>Goals</title>
+<para>This extension should enable clients to:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>Allocate and deallocate double-buffering for a window.</para>
+  </listitem>
+  <listitem>
+    <para>
+Draw to and read from the front and back buffers associated with a window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>Swap the front and back buffers associated with a window.</para>
+  </listitem>
+  <listitem>
+    <para>
+Specify a wide range of actions to be taken when a window is swapped.
+This includes explicit, simple swap actions (defined below), and more
+complex actions (for example, clearing ancillary buffers) that can be put
+together within explicit "begin" and "end" requests (defined below).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Request that the front and back buffers associated with multiple
+double-buffered windows be swapped simultaneously.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+In addition, the extension should:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Allow multiple clients to use double-buffering on the same window.</para>
+  </listitem>
+  <listitem>
+    <para>
+Support a range of implementation methods that can capitalize on existing
+hardware features.
+    </para>
+  </listitem>
+  <listitem>
+    <para>Add no new event types.</para>
+  </listitem>
+  <listitem>
+    <para>
+Be reasonably easy to integrate with a variety of direct graphics hardware
+access (DGHA) architectures.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</chapter>
+
+<chapter id="concepts">
+<title>Concepts</title>
+
+<para>
+Normal windows are created using the core <function>CreateWindow</function>
+request, which allocates a set of window attributes and, for InputOutput
+windows, a front buffer, into which an image can be drawn. The contents of
+this buffer will be displayed when the window is visible.
+</para>
+<para>
+This extension enables applications to use double-buffering with a window.
+This involves creating a second buffer, called a back buffer, and associating
+one or more back buffer names (XIDs) with the window for use when referring to
+(that is, drawing to or reading from) the window's back buffer. The back
+buffer name is a DRAWABLE of type BACKBUFFER.
+</para>
+
+<para>
+DBE provides a relative double-buffering model. One XID, the window, always
+refers to the front buffer. One or more other XIDs, the back buffer names,
+always refer to the back buffer. After a buffer swap, the window continues to
+refer to the (new) front buffer, and the back buffer name continues to refer
+to the (new) back buffer. Thus, applications and toolkits that want to just
+render to the back buffer always use the back buffer name for all drawing
+requests to the window. Portions of an application that want to render to
+the front buffer always use the window XID for all drawing requests to the
+window.
+</para>
+
+<para>
+Multiple clients and toolkits can all use double-buffering on the same
+window. DBE does not provide a request for querying whether a window has
+double-buffering support, and if so, what the back buffer name is. Given
+the asynchronous nature of the X Window System, this would cause race
+conditions. Instead, DBE allows multiple back buffer names to exist for
+the same window; they all refer to the same physical back buffer. The first
+time a back buffer name is allocated for a window, the window becomes
+double-buffered and the back buffer name is associated with the window.
+Subsequently, the window already is a double-buffered window, and nothing
+about the window changes when a new back buffer name is allocated, except
+that the new back buffer name is associated with the window. The window
+remains double-buffered until either the window is destroyed or until all of
+the back buffer names for the window are deallocated.
+</para>
+
+<para>
+In general, both the front and back buffers are treated the same. In
+particular, here are some important characteristics:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Only one buffer per window can be visible at a time (the front buffer).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Both buffers associated with a window have the same visual type, depth,
+width, height, and shape as the window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Both buffers associated with a window are "visible" (or "obscured") in
+the same way. When an Expose event is generated for a window, both
+buffers should be considered to be damaged in the exposed area. Damage
+that occurs to either buffer will result in an Expose event on the window.
+When a double-buffered window is exposed, both buffers are tiled with the
+window background, exactly as stated by the core protocol. Even though
+the back buffer is not visible, terms such as obscure apply to the back
+buffer as well as to the front buffer.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It is acceptable at any time to pass a BACKBUFFER in any
+request, notably any core or extension drawing request, that expects
+a DRAWABLE. This enables an application to draw directly into
+BACKBUFFERs in the same fashion as it would draw into any other
+DRAWABLE.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+It is an error (Window) to pass a BACKBUFFER in a core request that
+expects a Window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+A BACKBUFFER will never be sent by core X in a reply, event, or error
+where a Window is specified.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If core X11 backing-store and save-under applies to a double-buffered
+window, it applies to both buffers equally.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+If the core <function>ClearArea</function> request is executed on a
+double-buffered window, the same area in both the front and back buffers
+is cleared.
+    </para>
+  </listitem>
+</itemizedlist>
+<para>
+The effect of passing a window to a request that accepts a DRAWABLE is
+unchanged by this extension. The window and front buffer are synonomous with
+each other. This includes obeying the <function>GetImage</function> semantics
+and the subwindow-mode semantics if a core graphics context is involved.
+Regardless of whether the window was explicitly passed in a
+<function>GetImage</function> request, or implicitly referenced (that is,
+one of the windo's ancestors was passed in the request), the front (that is,
+visible) buffer is always referenced. Thus, DBE-naive screen dump clients will
+always get the front buffer. <function>GetImage</function> on a back buffer
+returns undefined image contents for any obscured regions of the back buffer
+that fall within the image.
+</para>
+
+<para>
+Drawing to a back buffer always uses the clip region that would be used to
+draw to the front buffer with a GC subwindow-mode of
+<function>ClipByChildren</function>. If an
+ancestor of a double-buffered window is drawn to with a core GC having a
+subwindow-mode of <function>IncludeInferiors</function>, the effect on the
+double-buffered window's back buffer depends on the depth of the
+double-buffered window and the ancestor. If the depths are the same, the
+contents of the back buffer of the double-buffered window are not changed.
+If the depths are different, the contents of the back buffer of the
+double-buffered window are undefined for the pixels that the
+<function>IncludeInferiors</function> drawing touched.
+</para>
+
+<para>
+DBE adds no new events. DBE does not extend the semantics of any existing
+events with the exception of adding a new DRAWABLE type called BACKBUFFER. If
+events, replies, or errors that contain a DRAWABLE (for example,
+<function>GraphicsExpose</function>) are generated in response to a request,
+the DRAWABLE returned will be the one specified in the request.
+</para>
+
+<para>
+DBE advertises which visuals support double-buffering.
+</para>
+
+<para>
+DBE does not include any timing or synchronization facilities.
+Applications that need such facilities (for example, to maintain a constant
+frame rate) should investigate the Synchronization Extension, an X
+Consortium standard.
+</para>
+
+<sect1 id="window_management_operations">
+<title>Window Management Operations</title>
+
+<para>
+The basic philosophy of DBE is that both buffers are treated the same by core
+X window management operations.
+</para>
+
+<para>
+When the core <function>DestroyWindow</function> is executed on a
+double-buffered window, both buffers associated with the window are
+destroyed, and all back buffer names associated with the window are freed.
+</para>
+
+<para>
+If the core <function>ConfigureWindow</function> request changes the size of
+a window, both buffers assume the new size. If the windo's size increases,
+the effect on the buffers depends on whether the implementation honors bit
+gravity for buffers. If bit gravity is implemented, then the contents of
+both buffers are moved in accordance with the windo's bit gravity (see the
+core <function>ConfigureWindow</function> request), and the remaining areas
+are tiled with the window background. If bit gravity is not implemented, then
+the entire unobscured region of both buffers is tiled with the window
+background. In either case, <function>Expose</function> events are generated
+for the region that is tiled with the window background.
+</para>
+
+<para>
+If the core <function>GetGeometry</function> request is executed on a
+BACKBUFFER, the returned x, y, and border-width will be zero.
+</para>
+
+<para>
+If the Shape extension <function>ShapeRectangles</function>,
+<function>ShapeMask</function>,
+<function>ShapeCombine</function>, or
+<function>ShapeOffset</function>
+request is executed on a double-buffered window, both buffers are reshaped
+to match the new window shape. The region difference is the following:
+</para>
+
+<literallayout>
+   D = newshape - oldshape
+</literallayout>
+
+<para>
+It is tiled with the window background in both buffers, and
+<function>Expose</function> events are generated for D.
+</para>
+
+</sect1>
+
+<sect1 id="complex_swap_actions">
+<title>Complex Swap Actions</title>
+<para>
+DBE has no explicit knowledge of ancillary buffers (for example, depth
+buffers or alpha buffers), and only has a limited set of defined swap
+actions. Some applications may need a richer set of swap actions than DBE
+provides. Some DBE implementations have knowledge of ancillary buffers,
+and/or can provide a rich set of swap actions. Instead of continually
+extending DBE to increase its set of swap actions, DBE provides a flexible
+"idiom" mechanism. If an application's needs are served by the defined swap
+actions, it should use them; otherwise, it should use the following method
+of expressing a complex swap action as an idiom. Following this policy will
+ensure the best possible performance across a wide variety of implementations.
+</para>
+
+<para>
+As suggested by the term "idiom," a complex swap action should be expressed
+as a group/series of requests. Taken together, this group of requests may be
+combined into an atomic operation by the implementation, in order to maximize
+performance. The set of idioms actually recognized for optimization is
+implementation dependent. To help with idiom expression and interpretation,
+an idiom must be surrounded by two protocol requests:
+<function>DBEBeginIdiom</function> and
+<function>DBEEndIdiom</function>. Unless this begin-end pair
+surrounds the idiom, it may not be recognized by a given implementation, and
+performance will suffer.
+</para>
+
+<para>
+For example, if an application wants to swap buffers for two windows, and
+use core X to clear only certain planes of the back buffers, the application
+would issue the following protocol requests as a group, and in the following
+order:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>DBEBeginIdiom request.</para>
+  </listitem>
+  <listitem>
+    <para>
+<function>DBESwapBuffers</function> request with XIDs for two windows, each of which uses
+a swap action of Untouched.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Core X PolyFillRectangle request to the back buffer of one window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Core X PolyFillRectangle request to the back buffer of the other window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>DBEEndIdiom request.</para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The <function>DBEBeginIdiom</function> and <function>DBEEndIdiom</function>
+requests do not perform any actions themselves. They are treated as markers
+by implementations that can combine certain groups/series of requests as
+idioms, and are ignored by other implementations or for nonrecognized
+groups/series of requests. If these requests are sent out of order, or are
+mismatched, no errors are sent, and the requests are executed as usual,
+though performance may suffer.
+</para>
+
+<para>
+An idiom need not include a <function>DBESwapBuffers</function> request. For
+example, if a swap action of Copied is desired, but only some of the planes
+should be copied, a core X
+<function>CopyArea</function> request may be used instead of
+<function>DBESwapBuffers</function>.
+If <function>DBESwapBuffers</function> is included in an idiom, it should
+immediately follow the <function>DBEBeginIdiom</function> request. Also, when
+the <function>DBESwapBuffers</function> is included in an idiom, that
+request's swap action will still be valid, and if the swap action might
+overlap with another request, then the final result of the idiom must be as if
+the separate requests were executed serially. For example, if the specified
+swap action is Untouched, and if a <function>PolyFillRectangle</function>
+using a client clip rectangle is done to the windo's back buffer after the
+<function>DBESwapBuffers</function> request, then the contents of the new
+back buffer (after the idiom) will be the same as if the idiom was not
+recognized by the implementation.
+</para>
+
+<para>
+It is highly recommended that Application Programming Interface (API)
+providers define, and application developers use, "convenience" functions
+that allow client applications to call one procedure that encapsulates
+common idioms. These functions will generate the
+<function>DBEBeginIdiom</function> request, the idiom requests, and
+<function>DBEEndIdiom</function> request. Usage of these functions will
+ensure best possible performance across a wide variety of implementations.
+</para>
+
+</sect1>
+</chapter>
+
+<chapter id="requests">
+<title>Requests</title>
+<para>The DBE defines the following requests.</para>
+
+<sect1 id="dbegetversion">
+<title>DBEGetVersion</title>
+<para>
+This request returns the major and minor version numbers of this extension.
+</para>
+
+<para>DBEGetVersion</para>
+<informaltable>
+  <tgroup cols="2">
+    <colspec colname="c1"/>
+    <colspec colname="c2" />
+    <tbody>
+      <row>
+        <entry align="left">client-major-version</entry>
+        <entry align="left">CARD8</entry>
+      </row>
+      <row>
+        <entry align="left">client-minor-version </entry>
+        <entry align="left">CARD8</entry>
+      </row>
+      <row>
+        <entry align="left">=></entry>
+        <entry align="left"></entry>
+      </row>
+      <row>
+        <entry align="left">server-major-version </entry>
+        <entry align="left">CARD8</entry>
+      </row>
+      <row>
+        <entry align="left">server-minor-version </entry>
+        <entry align="left">CARD8</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The client-major-version and client-minor-version numbers indicate what
+version of the protocol the client wants the server to implement. The
+server-major-version and the server-minor-version numbers returned indicate
+the protocol this extension actually supports. This might not equal the
+version sent by the client. An implementation can (but need not) support
+more than one version simultaneously.  The server-major-version and
+server-minor-version allow the creation of future revisions of the DBE
+protocol that may be necessary. In general, the major version
+would increment for incompatible changes, and the minor version would increment
+for small, upward-compatible changes. Servers that support the protocol
+defined in this document will return a server-major-version of one (1), and a
+server-minor-version of zero (0).
+</para>
+
+<para>
+The DBE client must issue a DBEGetVersion request before any other double
+buffering request in order to negotiate a compatible protocol version;
+otherwise, the client will get undefined behavior (DBE may or may not work).
+</para>
+
+</sect1>
+
+<sect1 id="dbegetvisualinfo">
+<title>DBEGetVisualInfo</title>
+<para>
+This request returns information about which visuals support double buffering.
+</para>
+
+<para>DBEGetVisualInfo</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <colspec colname="c1"/>
+    <colspec colname="c2"/>
+    <tbody>
+      <row>
+        <entry align="left">screen-specifiers</entry>
+        <entry align="left">LISTofDRAWABLE</entry>
+      </row>
+      <row>
+        <entry align="left">=></entry>
+        <entry align="left"></entry>
+      </row>
+      <row>
+        <entry align="left">visinfo</entry>
+        <entry align="left">LISTofSCREENVISINFO</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+<para>where:</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <colspec colname="c1"/>
+    <colspec colname="c2"/>
+    <tbody>
+      <row>
+        <entry align="left">SCREENVISINFO</entry>
+        <entry align="left">LISTofVISINFO</entry>
+      </row>
+      <row>
+        <entry align="left">VISINFO</entry>
+        <entry align="left">[ visual: VISUALID</entry>
+      </row>
+      <row>
+        <entry align="left"></entry>
+        <entry align="left">depth: CARD8</entry>
+      </row>
+      <row>
+        <entry align="left"></entry>
+        <entry align="left">perflevel: CARD8 ]</entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Errors: Drawable</para>
+
+<para>
+All of the values passed in screen-specifiers must be valid DRAWABLEs (or a
+<function>Drawable</function> error results). For each drawable in
+screen-specifiers, the reply will contain a list of VISINFO structures for
+visuals that support double-buffering on the screen on which the drawable
+resides. The visual member specifies the VISUALID. The depth member specifies
+the depth in bits for the visual. The perflevel is a performance hint. The
+only operation defined on a perflevel is comparison to a perflevel of another
+visual on the same screen. The visual having the higher perflevel is likely
+to have better double-buffer graphics performance than the visual having the
+lower perflevel. Nothing can be deduced from any of the following: the
+magnitude of the difference of two perflevels, a perflevel value in isolation,
+or comparing perflevels from different servers.
+</para>
+
+<para>
+If the list of screen-specifiers is empty, information for all screens is
+returned, starting with screen zero.
+</para>
+
+</sect1>
+
+<sect1 id="dbeallocatebackbuffername">
+<title>DBEAllocateBackBufferName</title>
+
+<para>
+This request allocates a drawable ID used to refer to the back buffer of a
+window.
+</para>
+
+<para>DBEAllocateBackBufferName</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <colspec colname="c1"/>
+    <colspec colname="c2"/>
+    <tbody>
+      <row>
+        <entry align="left">window</entry>
+        <entry align="left">WINDOW</entry>
+      </row>
+      <row>
+        <entry align="left">back-buffer-name</entry>
+        <entry align="left">BACKBUFFER</entry>
+      </row>
+      <row>
+        <entry align="left">swap-action-hint</entry>
+        <entry align="left">SWAPACTION </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Errors: Alloc, Value, IDChoice, Match, Window
+</para>
+
+<para>
+If the window is not already a double-buffered window, the window becomes
+double-buffered, and the back-buffer-name is associated with the window. The
+swap-action-hint tells the server which swap action is most likely to be
+used with the window in subsequent <function>DBESwapBuffers</function>
+requests. The swap-action-hint must have one of the values specified for type
+SWAPACTION (or a Value error results). See the description of the
+<function>DBESwapBuffers</function> request for a complete discussion of
+swap actions and the SWAPACTION type.
+</para>
+
+<para>
+If the window already is a double-buffered window, nothing about the window
+changes, except that an additional back-buffer-name is associated with the
+window.  The window remains double-buffered until either the window is
+destroyed, or until all of the back buffer names for the window are
+deallocated.
+</para>
+
+<para>
+The window passed into the request must be a valid WINDOW (or a Window error
+results). The window passed into the request must be an InputOutput window (or
+a Match error results). The visual of the window must be in the list returned
+by <function>DBEGetVisualInfo</function> (or a Match error results). The
+back-buffer-name must be in the range assigned to the client, and must not
+already be in use (or an IDChoice error results). If the server cannot
+allocate all resources associated with turning on double-buffering for the
+window, an Alloc error results, the windo's double-buffer status (whether it
+is already double-buffered or not) remains unchanged, and the
+back-buffer-name is freed.
+</para>
+</sect1>
+
+<sect1 id="dbedeallocatebackbuffername">
+<title>DBEDeallocateBackBufferName</title>
+<para>
+This request frees a drawable ID that was obtained by
+<function>DBEAllocateBackBufferName</function>.
+</para>
+
+<para>DBEDeallocateBackBufferName</para>
+
+<informaltable>
+  <tgroup cols="2">
+  <colspec colname="c1"/>
+  <colspec colname="c2"/>
+  <tbody>
+    <row>
+      <entry align="left">back-buffer-name</entry>
+      <entry align="left">BACKBUFFER</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Errors: Buffer</para>
+
+<para>
+The back-buffer-name passed in the request is freed and no longer associated
+with the window. If this is the last back-buffer-name associated with the
+window, then the back buffer is no longer accessible to clients, and all
+double-buffering resources associated with the window may be freed. The
+window's current front buffer remains the front buffer.
+</para>
+
+<para>
+The back-buffer-name must be a valid BACKBUFFER associated with a window (or
+a Buffer error results).
+</para>
+</sect1>
+
+<sect1 id="dbeswapbuffers">
+<title>DBESwapBuffers</title>
+<para>
+This request swaps the buffers for all windows listed, applying the
+appropriate swap action for each window.
+</para>
+
+<para><function>DBESwapBuffers</function></para>
+
+<informaltable>
+  <tgroup cols="2">
+  <colspec colname="c1" /><colspec colname="c2"/>
+  <tbody>
+    <row>
+      <entry align="left">windows</entry>
+      <entry align="left">LISTofSWAPINFO</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+<para>where:</para>
+<informaltable>
+  <tgroup cols="2">
+  <colspec colname="c1" /><colspec colname="c2"/>
+  <tbody>
+    <row>
+      <entry align="left">SWAPINFO</entry>
+      <entry align="left">[ window: WINDOW</entry>
+    </row>
+    <row>
+      <entry align="left"></entry>
+      <entry align="left">swap-action: SWAPACTION ]</entry>
+    </row>
+    <row>
+      <entry align="left">SWAPACTION</entry>
+      <entry align="left">{ Undefined, Background, Untouched, Copied }</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>Errors: Match, Window, Value</para>
+
+<para>
+Each window passed into the request must be a valid WINDOW (or a
+<function>Window</function> error results). Each window passed into the
+request must be a double-buffered window (or a <function>Match</function>
+error results). Each window passed into the request must only be listed
+once (or a <function>Match</function> error results). Each swap-action in
+the list must have one of the values specified for type SWAPACTION (or a
+<function>Value</function> error results). If an error results, none of
+the valid double-buffered windows will have their buffers swapped.
+</para>
+
+<para>
+The swap-action determines what will happen to the new back buffer of the
+window it is paired with in the list in addition to making the old back
+buffer become visible.  The defined actions are as follows:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>Undefined</term>
+      <listitem><para>
+The contents of the new back buffer become undefined. This may be the
+most efficient action since it allows the implementation to discard the
+contents of the buffer if it needs to.
+      </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Background</term>
+    <listitem><para>
+The unobscured region of the new back buffer will be tiled with the window
+background. The background action allows devices to use a fast clear
+capability during a swap.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Untouched</term>
+    <listitem><para>
+The unobscured region of the new back buffer will be unmodified by the swap.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Copied</term>
+    <listitem><para>
+The unobscured region of the new back buffer will be the contents of the
+old back buffer.
+    </para></listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+If <function>DBESwapBuffers</function> is included in a "swap and clear"
+type of idiom, it must immediately follow the
+<function>DBEBeginIdiom</function> request.
+</para>
+</sect1>
+
+<sect1 id="dbebeginidiom">
+<title>DBEBeginIdiom</title>
+<para>
+This request informs the server that a complex swap will immediately follow
+this request.
+</para>
+
+<para><function>DBEBeginIdiom</function></para>
+
+<para>
+As previously discussed, a complex swap action is a group/series of
+requests that, taken together, may be combined into an atomic operation by
+the implementation.  The sole function of this request is to serve as a
+"marker" that the server can use to aid in idiom processing. The server is
+free to implement this request as a no-op.
+</para>
+</sect1>
+
+<sect1 id="dbeendidiom">
+<title>DBEEndIdiom</title>
+
+
+<para>
+This request informs the server that a complex swap has concluded.
+</para>
+
+<para><function>DBEEndIdiom</function></para>
+
+<para>
+The sole function of this request is to serve as a "marker" that the server
+can use to aid in idiom processing. The server is free to implement this
+request as a no-op.
+</para>
+
+</sect1>
+
+<sect1 id="dbegetbackbufferattributes">
+<title>DBEGetBackBufferAttributes</title>
+
+<para>This request returns information about a back buffer.</para>
+
+<para><function>DBEGetBackBufferAttributes</function></para>
+
+<informaltable>
+  <tgroup cols="2">
+  <colspec colname="c1"/>
+  <colspec colname="c2"/>
+  <tbody>
+    <row>
+      <entry align="left">back-buffer-name</entry>
+      <entry align="left">BACKBUFFER</entry>
+    </row>
+    <row>
+      <entry align="left">=></entry>
+      <entry align="left"></entry>
+    </row>
+    <row>
+      <entry align="left">attributes</entry>
+      <entry align="left">BUFFER_ATTRIBUTES</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>where:</para>
+
+<para>BUFFER_ATTRIBUTES: [ window: WINDOW ]</para>
+
+<para>
+If back-buffer-name is a valid BACKBUFFER, the window field of the
+attributes in the reply will be the window which has the back buffer that
+back-buffer-name refers to. If back-buffer-name is not a valid BACKBUFFER,
+the window field of the attributes in the reply will be None.
+</para>
+
+</sect1>
+</chapter>
+
+<chapter id="encoding">
+<title>Encoding</title>
+<para>
+Please refer to the X11 Protocol Encoding document as this section uses
+syntactic conventions and data types established there.
+</para>
+
+<para>The name of this extension is "DOUBLE-BUFFER".</para>
+
+<sect1 id="type">
+<title>Type</title>
+<para>The following new types are used by the extension.
+</para>
+
+<para>BACKBUFFER: XID</para>
+<para>SWAPACTION</para>
+<literallayout class="monospaced">
+#x00  Undefined
+#x01  Background
+#x02  Untouched
+#x03  Copied
+</literallayout>
+
+<para>SWAPINFO</para>
+<literallayout class="monospaced">
+4     WINDOW                 window
+1     SWAPACTION             swap action
+3                            unused
+</literallayout>
+
+<literallayout class="monospaced">
+VISINFO
+4     VISUALID                visual
+1     CARD8                   depth
+1     CARD8                   perflevel
+2                             unused
+
+SCREENVISINFO
+4     CARD32                  n, number in list
+8n    LISTofVISINFO           n VISINFOs
+
+BUFFER_ATTRIBUTES
+4     WINDOW                 window
+</literallayout>
+</sect1>
+
+<sect1 id="error">
+<title>Error</title>
+<para><function>Buffer</function></para>
+<literallayout class="monospaced">
+1     0                       error
+1     error base + 0          code
+2     CARD16                  sequence number
+4     CARD32                  bad buffer
+2     CARD16                  minor-opcode
+1     CARD8                   major-opcode
+21                            unused
+</literallayout>
+</sect1>
+
+<sect1 id="request">
+<title>Request</title>
+
+<literallayout class="monospaced">
+DBEGetVersion
+1     CARD8                  major-opcode
+1     0                      minor-opcode
+2     2                      request length
+1     CARD8                  client-major-version
+1     CARD8                  client-minor-version
+2                            unused
+=>
+1                            unused
+2     CARD16                 sequence number
+4     0                      reply length
+1     CARD8                  server-major-version
+1     CARD8                  server-minor-version
+22                           unused
+</literallayout>
+
+<para><function>DBEAllocateBackBufferName</function></para>
+<literallayout class="monospaced">
+1     CARD8                  major-opcode
+1     1                      minor-opcode
+2     4                      request length
+4     WINDOW                 window
+4     BACKBUFFER             back buffer name
+1     SWAPACTION             swap action hint
+3                            unused
+</literallayout>
+
+<para><function>DBEDeallocateBackBufferName</function></para>
+<literallayout class="monospaced">
+1     CARD8                  major-opcode
+1     2                      minor-opcode
+2     2                      request length
+4     BACKBUFFER             back buffer name
+</literallayout>
+
+
+<para><function>DBESwapBuffers</function></para>
+<literallayout class="monospaced">
+1     CARD8                   major-opcode
+1     3                       minor-opcode
+2     2+2n                    request length
+4     CARD32                  n, number of window/swap action pairs in list
+8n    LISTofSWAPINFO          window/swap action pairs
+</literallayout>
+
+
+<para><function>DBEBeginIdiom</function></para>
+<literallayout class="monospaced">
+1     CARD8                   major-opcode
+1     4                       minor-opcode
+2     1                       request length
+</literallayout>
+
+<para><function>DBEEndIdiom</function></para>
+<literallayout class="monospaced">
+1     CARD8                   major-opcode
+1     5                       minor-opcode
+2     1                       request length
+</literallayout>
+
+<para><function>DBEGetVisualInfo</function></para>
+<literallayout class="monospaced">
+1     CARD8                   major-opcode
+1     6                       minor-opcode
+2     2+n                     request length
+4     CARD32                  n, number of screen specifiers in list
+4n    LISTofDRAWABLE          n screen specifiers
+=>
+1     1                       Reply
+1                             unused
+2     CARD16                  sequence number
+4     CARD32                  reply length
+4     CARD32                  m, number of SCREENVISINFOs in list
+20                            unused
+4j    LISTofSCREENVISINFO     m SCREENVISINFOs
+</literallayout>
+
+<para><function>DBEGetBackBufferAttributes</function></para>
+<literallayout class="monospaced">
+1     CARD8                   major-opcode
+1     7                       minor-opcode
+2     2                       request length
+4     BACKBUFFER              back-buffer-name
+=>
+1                             unused
+2     CARD16                  sequence number
+4     0                       reply length
+4     BUFFER_ATTRIBUTES       attributes
+20                            unused
+</literallayout>
+</sect1>
+
+</chapter>
+
+<chapter id="acknowledgements">
+<title>Acknowledgements</title>
+<para>
+We wish to thank the following individuals who have contributed their time
+and talent toward shaping the DBE specification:
+</para>
+<para>T. Alex Chen, IBM; Peter Daifuku, Silicon Graphics, Inc.;
+Ian Elliott, Hewlett-Packard Company; Stephen Gildea, X Consortium, Inc.;
+Jim Graham, Sun; Larry Hare, AGE Logic; Jay Hersh, X Consortium, Inc.;
+Daryl Huff, Sun; Deron Dann Johnson, Sun; Louis Khouw, Sun;
+Mark Kilgard, Silicon Graphics, Inc.; Rob
+Lembree, Digital Equipment Corporation; Alan Ricker, Metheus; Michael
+Rosenblum, Digital Equipment Corporation; Bob Scheifler, X Consortium, Inc.;
+Larry Seiler, Digital Equipment Corporation; Jeanne Sparlin Smith, IBM;
+Jeff Stevenson, Hewlett-Packard Company; Walter Strand, Metheus; Ken
+Tidwell, Hewlett-Packard Company; and David P. Wiggins, X Consortium, Inc.
+</para>
+
+<para>
+Mark provided the impetus to start the DBE project. Ian wrote the first
+draft of the specification. David served as architect.
+</para>
+</chapter>
+
+<chapter id="references">
+<title>References</title>
+<para>
+Jeffrey Friedberg, Larry Seiler, and Jeff Vroom, "Multi-buffering Extension
+Specification Version 3.3."
+</para>
+<para>Tim Glauert, Dave Carver, Jim Gettys, and David P. Wiggins,
+"X Synchronization Extension Version 3.0."
+</para>
+</chapter>
+</book>
diff --git a/specs/dpms.xml b/specs/dpms.xml
new file mode 100755 (executable)
index 0000000..d5323b1
--- /dev/null
@@ -0,0 +1,563 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<book id="dpms">
+
+<bookinfo>
+   <title>X Display Power Management Signaling (DPMS) Extension Protocol Specification</title>
+   <subtitle>X Project Team Standard</subtitle>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Rob </firstname><surname>Lembree</surname>
+         <affiliation><orgname>Digital Equipment Corporation</orgname></affiliation>
+         <email>lembree@zk3.dec.com</email>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1996</year><holder>Digital Equipment Corporation</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+
+<legalnotice>
+<para>
+Permission to use, copy, modify, distribute, and sell this
+documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice and this permission
+notice appear in all copies.  Digital Equipment Corporation
+makes no representations about the suitability for any purpose
+of the information in this document.  This documentation is
+provided "as is" without express or implied warranty.
+</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<sect1 id="Overview">
+<title>Overview</title>
+<para>
+This extension provides X Protocol control over the VESA Display
+Power Management Signaling (DPMS) characteristics of video boards
+under control of the X Window System.<footnote>
+<para>
+<emphasis remap='I'>X Window System</emphasis> is a trademark of The Open Group.
+</para>
+</footnote>
+</para>
+
+
+<para>
+<!-- .LP -->
+Traditionally, the X Window System has provided for both blanking and
+non-blanking screen savers.  Timeouts associated with these built-in
+screen saver mechanisms are limited to idle (dwell) time, and a change
+timeout that specifies the change interval for non-blanking screen savers.
+</para>
+<para>
+<!-- .LP -->
+The United States' Environmental Protection Agency (EPA) Energy Star program
+requires that monitors power down after some idle time by default.
+While it is possible to simply overload the existing screen saver timeouts,
+this solution leaves the non-privileged user little to no control over
+the DPMS characteristics of his or her system.  For example, disabling
+DPMS would require some unintended side effect in the core screen saver,
+such as disabling the changing of a non-blanking screen saver.  Providing
+clients with this control requires an extension to the core X Window System
+Protocol, and this extension seeks to fill this gap.
+</para>
+<para>
+<!-- .LP -->
+The design goal of the DPMS extension is to be a logical extension to
+the traditional screen saver.  The protocol and sample implementation is
+designed to use the same date types and time units as the screen saver.
+The sample implementation works independently from the screen saver so that
+policy as it pertains to the interaction between screen saver and DPMS can
+be deferred to the user or screen saver application. The extension has
+been tested with and shown to work correctly with both the internal blanking
+and non-blanking screen savers, as well as with screen saver extension
+clients.
+</para>
+<para>
+The DPMS extension is designed to be simple, yet export sufficient
+VESA DPMS information to enable full function clients to be written.
+Included is the ability to sense DPMS capability, set and get DPMS timeouts,
+enable and disable individual DPMS modes, enable and disable DPMS (without
+destroying timeout values), and sense current DPMS on/off state and
+power level.
+</para>
+<para>
+There are four power levels specified by the Video Electronics Standards
+Association (VESA) Display Power Management Signaling (DPMS) standard.
+These are:
+</para>
+
+<literallayout class="monospaced">
+<function>DPMS Extension Power Levels</function>
+     0     DPMSModeOn          In use
+     1     DPMSModeStandby     Blanked, low power
+     2     DPMSModeSuspend     Blanked, lower power
+     3     DPMSModeOff         Shut off, awaiting activity
+</literallayout>
+
+<para>
+It is logical to assume that successive DPMS modes be chronologically
+at the same time or later than one another, and the protocol is designed
+to enforce this rule.
+</para>
+
+<para>
+Note however that a concious decision is made to decouple the timeouts
+associated with screen saver from the DPMS timeouts.  While it might be
+considered logical to require that the first non-zero DPMS timeout be
+greater than or equal to the screen saver timeout, this is intentionally
+omitted, leaving this policy decision to the user or the screen saver
+application.  In the case of a laptop where power may be scarce, the
+importance of power savings should supersede the screen saver.  If the
+laptop user plugs the unit in and power is no longer a scarce commodity,
+it may be decided to make DPMS less aggressive, or disable it completely.
+</para>
+</sect1>
+
+<sect1 id="Requests">
+<title>Requests</title>
+<para>
+<function>DPMSGetVersion</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>client_major_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>client_minor_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>server_major_version</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>server_minor_version</emphasis>: CARD16
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If supplied, the <emphasis remap='I'>client_major_version</emphasis> and
+<emphasis remap='I'>client_minor_version</emphasis> indicate what version
+of the protocol the
+client wants the server to implement.  The server version numbers
+returned indicate the protocol this extension actually supports.  This
+might not equal the version sent by the client.  An implementation can
+(but need not) support more than one version simultaneously.  The
+<emphasis remap='I'>server_major_version</emphasis> and the
+<emphasis remap='I'>server_minor_version</emphasis> are a
+mechanism to support future revisions of the Display Power Management
+Signaling protocol which may be necessary.  In general, the major version
+would increment for incompatible changes, and the minor version would
+increment for small, upward-compatible changes.  Servers that support the
+protocol defined in this document will return a
+<emphasis remap='I'>server_major_version</emphasis>
+of one (1), and a <emphasis remap='I'>server_minor_version</emphasis>
+of one (1).
+</para>
+
+<para>
+<function>DPMSCapable</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>capable</emphasis>: BOOL
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request is used to determine whether or not the currently running
+server's devices are capable of DPMS operations.  The truth value of this
+request is implementation defined, but is generally based on the capabilities
+of the graphic card and monitor combination.  Also, the return value in the
+case of heterogeneous multi-head servers is implementation defined.
+</para>
+
+<para>
+<function>DPMSGetTimeouts</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>standby_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>suspend_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>off_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request returns the current values of the DPMS timeout values.  All
+values are in units of seconds.
+</para>
+
+<para>
+<emphasis remap='I'>standby_timeout</emphasis> is the amount of time
+of inactivity before standby
+mode is invoked. The actual effects of this mode are implementation defined,
+but in the case of DPMS compliant hardware, it is implemented by shutting off
+the horizontal sync signal, and pulsing the vertical sync signal. Standby
+mode provides the quickest monitor recovery time.  Note also that many
+monitors implement this mode identically to suspend mode.  A value of
+zero indicates that this mode is disabled.
+</para>
+
+<para>
+<emphasis remap='I'>suspend_timeout</emphasis> is the amount of time
+of inactivity before the second
+level of power savings is invoked. Suspend mode's physical and electrical
+characteristics are implementation defined, but in DPMS compliant hardware,
+results in the pulsing of the horizontal sync signal, and shutting off of
+the vertical sync signal.  Suspend mode recovery is considered to be slower
+than standby mode, but faster than off mode, however this is monitor
+dependent.  As noted above, many monitors implement this mode identically to
+standby mode.  A value of zero indicates that this mode is disabled.
+</para>
+
+<para>
+<emphasis remap='I'>off_timeout</emphasis> is the amount of time of
+inactivity before the third and
+final level of power savings is invoked. Off mode's physical and electrical
+characteristics are implementation defined, but in DPMS compliant hardware,
+is implemented by shutting off both horizontal and vertical sync signals,
+resulting in the power-down of the monitor.  Recovery time is implementation
+dependant, but frequently is similar to the power-up time of the monitor. A
+value of zero indicates that this mode is disabled.
+</para>
+
+<para>
+<function>DPMSSetTimeouts</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>standby_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>suspend_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>off_timeout</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+
+<para>
+All values are in units of seconds.
+<emphasis remap='I'>standby_timeout</emphasis> is the amount of
+time of inactivity before standby mode will be invoked. This is the
+lightest level of power savings, and the monitor is generally immediately
+ready upon detection of user activity.  This is most often implemented by
+shutting off the horizontal sync signal to the monitor.
+A value of zero disables this mode.
+</para>
+
+<para>
+The <emphasis remap='I'>suspend_timeout</emphasis> specifies the amount
+of time of inactivity
+before the screen is placed into suspend mode.  Suspend mode is the
+middle level of power savings, resulting in a slightly longer recovery
+upon detection of activity.  Suspend mode is most often implemented by
+pulsing the horizontal sync signal, and removing the vertical sync
+signal. A value of zero disables this mode.
+</para>
+
+<para>
+The <emphasis remap='I'>off_timeout</emphasis> specifies the amount of
+time of inactivity before
+the monitor is shut off.  Off mode is the deepest level of power management,
+resulting in the greatest power savings and the longest recovery time.
+Off mode is most often implemented by removing both the horizontal and
+vertical signals. A value of zero disables this mode.
+</para>
+<para>
+The values of successive power levels must be greater than or equal
+to the value of the previous (non-zero) level.  A BadValue error is generated
+if an illegal combination is detected.
+</para>
+<para>
+<function>DPMSEnable</function>
+</para>
+<para>
+=&gt;
+</para>
+
+<para>
+This request enables the DPMS characteristics of the server, using the
+server's currently stored timeouts.  If DPMS is already enabled, no change is
+effected.
+</para>
+
+<para>
+<function>DPMSDisable</function>
+</para>
+<para>
+=&gt;
+</para>
+
+<para>
+This request disables the DPMS characteristics of the server.  It does
+not affect the core or extension screen savers.  If DPMS is already
+disabled, no change is effected.  This request is provided so that DPMS
+may be disabled without damaging the server's stored timeout values.
+</para>
+
+<para>
+<function>DPMSForceLevel</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>power_level</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request forces a specific DPMS level on the server.  If DPMS is
+disabled, a BadMatch error is generated.  If an erroneous power level
+is specified, a BadValue error is returned, and the error value contains
+the bad value.  If the power level specified is already in effect, no
+changes occur.  Power Level must be one of DPMSModeOn, DPMSModeStandby,
+DPMSModeSuspend or DPMSModeOff.
+</para>
+
+<para>
+<function>DPMSInfo</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>=&gt;</entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>power_level</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>state</emphasis>: BOOL
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request returns information about the current DPMS state of the
+display.  <emphasis remap='I'>state</emphasis> is one of DPMSEnabled
+or DPMSDisabled.
+If <emphasis remap='I'>state</emphasis> is DPMSEnabled,
+<emphasis remap='I'>power_level</emphasis> is returned as one
+of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise
+it is undefined.
+</para>
+
+</sect1>
+
+<sect1 id="Events_and_Errors">
+<title>Events and Errors</title>
+<para>
+No new events or errors are defined by this extension.
+</para>
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+<para>
+Please refer to the X11 Protocol Encoding document as this document uses
+conventions established there.
+</para>
+
+<para>
+The name of this extension is "DPMS".
+</para>
+
+<literallayout class="monospaced">
+<function>DPMSGetVersion</function>
+     1     CARD8         opcode
+     1     0             DPMS opcode
+     2     2             request length
+     2     CARD16        client_major_version
+     2     CARD16        client_minor_version
+=&gt;
+     1     1             Reply
+     1                   unused
+     2     CARD16        sequence number
+     4     0             length
+     2     CARD16        server_major_version
+     2     CARD16        server_minor_version
+     20                  unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSCapable</function>
+     1     CARD8         opcode
+     1     1             DPMS opcode
+     2     1             request length
+=&gt;
+     1     1             Reply
+     1                   unused
+     2     CARD16        sequence number
+     4     0             length
+     1     BOOL          capable
+     23                  unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSGetTimeouts</function>
+     1     CARD8         opcode
+     1     2             DPMS opcode
+     2     1             request length
+=&gt;
+     1     1             Reply
+     1                   unused
+     2     CARD16        sequence number
+     4     0             length
+     2     CARD16        standby_timeout
+     2     CARD16        suspend_timeout
+     2     CARD16        off_timeout
+     18                  unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSSetTimeouts</function>
+     1     CARD8         opcode
+     1     3             DPMS opcode
+     2     3             request length
+     2     CARD16        standby_timeout
+     2     CARD16        suspend_timeout
+     2     CARD16        off_timeout
+     2                   unused
+=&gt;
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSEnable</function>
+     1     CARD8         opcode
+     1     4             DPMS opcode
+     2     1             request length
+ =&gt;
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSDisable</function>
+     1     CARD8         opcode
+     1     5             DPMS opcode
+     2     1             request length
+ =&gt;
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSForceLevel</function>
+     1     CARD8         opcode
+     1     6             DPMS opcode
+     2     2             request length
+     2                   power_level
+          0     DPMSModeOn
+          1     DPMSModeStandby
+          2     DPMSModeSuspend
+          3     DPMSModeOff
+     2                   unused
+=&gt;
+</literallayout>
+
+<literallayout class="monospaced">
+<function>DPMSInfo</function>
+     1     CARD8         opcode
+     1     7             DPMS opcode
+     2     1             request length
+=&gt;
+     1     1             Reply
+     1                   unused
+     2     CARD16        sequence number
+     4     0             length
+     2                   power_level
+           0     DPMSModeOn
+           1     DPMSModeStandby
+           2     DPMSModeSuspend
+           3     DPMSModeOff
+     1     BOOL          state
+     21                  unused
+
+</literallayout>
+</sect1>
+</chapter>
+</book>
diff --git a/specs/evi.xml b/specs/evi.xml
new file mode 100755 (executable)
index 0000000..1136278
--- /dev/null
@@ -0,0 +1,518 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<book id="evi">
+
+<bookinfo>
+   <title>Extended Visual Information Extension</title>
+   <subtitle>X Project Team Standard</subtitle>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Peter</firstname><surname>Daifuku</surname>
+         <affiliation><orgname>Silicon Graphics, Inc.</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1986-97</year><holder>The Open Group</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+
+<legalnotice>
+
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this
+software and associated documentation files (the Software), to use the
+Software without restriction, including, without limitation, the rights to
+copy, modify, merge, publish, distribute and sublicense the Software,
+to make, have made, license and distribute derivative works thereof, and
+to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+</para>
+
+<para>
+The above copyright notice and the following permission notice shall be
+included in all copies of the Software:
+</para>
+
+<para>
+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 THE OPEN GROUP BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER USEABILITIY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
+CONNNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN
+THE SOFTWARE.
+</para>
+
+<para>
+Except as contained in this notice, the name of The Open Group shall not
+be used in advertising or otherwise to promote the use or other dealings
+in this Software without prior written authorization from The Open Group.
+</para>
+
+<para>
+X Window System is a trademark of The Open Group.
+</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<sect1 id="Introduction">
+<title>Introduction</title>
+<para>
+EVI (Extended Visual Information extension) allows a client to determine
+information about core X visuals beyond what the core protocol provides.
+</para>
+</sect1>
+
+<sect1 id="Goals">
+<title>Goals</title>
+<para>
+As the X Window System has evolved, it has become clear that the information
+returned by the core X protocol regarding Visuals is often insufficient for a
+client to determine which is the most appropriate visual for its needs. This
+extension allows clients to query the X server for additional visual
+information, specifically as regards colormaps and framebuffer levels.
+</para>
+
+<para>
+This extension is meant to address the needs of pure X clients only. It is
+specifically and purposefully not designed to address the needs of X
+extensions. Extensions that have an impact on visual information should provide
+their own mechanisms for delivering that information. For example, the Double
+Buffering Extension (DBE) provides its own mechanism for determining which
+visuals support double-buffering.
+</para>
+</sect1>
+
+<sect1 id="Requests">
+<title>Requests</title>
+<para>
+<function>GetVersion</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>client_major_version</emphasis>: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>client_minor_version</emphasis>: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>server_major_version</emphasis>: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>server_minor_version</emphasis>: CARD8
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+
+
+<para>
+If supplied, the client_major_version and client_minor_version indicate
+what version of the protocol the client wants the server to implement.
+The server version numbers returned indicate the protocol this extension
+actually supports. This might not equal the version sent by the client.
+An implementation can (but need not) support more than one version
+simultaneously. The server_major_version and the server_minor_version
+are a mechanism to support future revisions of the EVI protocol that
+may be necessary. In general, the major version would increment for
+incompatible changes, and the minor version would increment for small
+upward-compatible changes. Servers that support the protocol defined in
+this document will return a server_major_version of one (1), and a
+server_minor_version of zero (0).
+</para>
+
+<para>
+<function>  GetVisualInfo</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>visual_list</emphasis>: LISTofVISUALID
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>per_visual_info</emphasis>: LISTofVISUALINFO
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+where:
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+VISUALINFO: [core_visual_id: VISUALID
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+screen: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+level: INT8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+transparency_type: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+unused: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+transparency_value: CARD32
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+min_hw_colormaps: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+max_hw_colormaps: CARD8
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+num_colormap_conflicts: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+colormap_conflicts: LISTofVISUALID]
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<itemizedlist>
+  <listitem>
+    <para>
+level is 0 for normal planes, &gt; 0 for overlays, &lt; 0 for underlays.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+transparency_type is 0 for none, 1 for transparent pixel, 2 for
+transparent mask.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+transparency_value: value to get transparent pixel if transparency
+supported.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+min_hw_colormaps: minimum number of hardware colormaps backing up the
+visual.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+max_hw_colormaps: maximum number of hardware colormaps backing up the
+visual.
+    </para>
+    <para>
+    (architectures with static colormap allocation/reallocation would have min
+= max)
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+num_colormap_conflicts: number of elements in colormap_conflicts.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+colormap_conflicts: list of visuals that may conflict with this one. For
+example, if a 12-bit colormap is overloaded to support 8-bit visuals, the
+8-bit visuals would conflict with the 12-bit visuals.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</sect1>
+<sect1 id="Events_and_Errors">
+<title>Events and Errors</title>
+<para>
+No new events or errors are defined by this extension.
+</para>
+</sect1>
+
+<sect1 id="Changes_to_existing_protocol_">
+<title>Changes to existing protocol.</title>
+<para>
+None.
+</para>
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+<para>
+The name of this extension is "Extended-Visual-Information".
+</para>
+
+<para>
+The conventions used here are the same as those for the core X11
+Protocol Encoding.
+</para>
+
+<literallayout class="monospaced">
+<function>GetVersion</function>
+     1     CARD8               opcode
+     1     0                   EVI opcode
+     2     2                   request length
+     2     CARD16              client_major_version
+     2     CARD16              client_minor_version
+=&gt;
+     1     1                   reply
+     1                         unused
+     2     CARD16              sequence number
+     4     0                   length
+     2     CARD16              server_major_version
+     2     CARD16              server_minor_version
+     20                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>GetVisualInfo</function>
+     1     CARD8               opcode
+     1     1                   EVI opcode
+     2     2+n                 request length
+     4     CARD32              n_visual
+     4n    CARD32              visual_ids
+=&gt;
+     1     1                   reply
+     1                         unused
+     2     CARD16              sequence number
+     4     n                   length
+     4     CARD32              n_info
+     4     CARD32              n_conflicts
+     16                        unused
+     16n   LISTofVISUALINFO    items
+</literallayout>
+
+<literallayout class="monospaced">
+VISUALINFO
+     4     VisualID            core_visual_id
+     1     INT8                screen
+     1     INT8                level
+     1     CARD8               transparency_type
+     1     CARD8               unused
+     4     CARD32              transparency_value
+     1     CARD8               min_hw_colormaps
+     1     CARD8               max_hw_colormaps
+     2     CARD16              num_colormap_conflicts
+</literallayout>
+</sect1>
+
+<sect1 id="C_Language_Binding">
+<title>C Language Binding</title>
+<para>
+<!-- .LP -->
+The C functions provide direct access to the protocol and add no additional
+semantics.  For complete details on the effects of these functions, refer
+to the appropriate protocol request, which can be derived by deleting Xevi
+at the start of the function. All functions that have return type Status
+will return nonzero for success and zero for failure.
+</para>
+
+<para>
+The include file for this extension is:
+<function>&lt; X11/extensions/XEVI.h&gt;</function>.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function> XeviQueryVersion</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>int<parameter> *major_version_return</parameter></paramdef>
+  <paramdef>int<parameter> *minor_version_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>major_version_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the major version supported by the server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>minor_version_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the minor version supported by the server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+XeviQueryVersion sets major_version_return and minor_version_return to
+the major and minor EVI protocol version supported by the server.  If
+the EVI library is compatible with the version returned by the server,
+it returns nonzero.  If dpy does not support the EVI extension, or if
+there was an error during communication with the server, or if the server
+and library protocol versions are incompatible, it returns zero.  No other
+Xevi functions may be called before this function. If a client violates
+this rule, the effects of all subsequent Xevi calls that it makes are
+undefined.
+</para>
+
+<para>
+To get the extended information for any subset of visuals use
+XeviGetVisualInfo.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function> XeviGetVisualInfo</function></funcdef>
+  <paramdef>Display<parameter> *display</parameter></paramdef>
+  <paramdef>VisualID<parameter> *visual</parameter></paramdef>
+  <paramdef>int<parameter> n_visual</parameter></paramdef>
+  <paramdef>ExtendedVisualInfo<parameter> **evi_return</parameter></paramdef>
+  <paramdef>int<parameter> *n_info_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+If NULL, then information for all visuals of all
+screens is returned. Otherwise, a pointer to a list of visuals for which
+extended visual information is desired.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>n_visual</emphasis>
+    </term>
+    <listitem>
+      <para>
+If 0, then information for all visuals of all screens is returned. Otherwise,
+the number of elements in the array <emphasis remap='I'>visual</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>evi_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns a pointer to a list of <emphasis remap='I'>ExtendedVisualInfo</emphasis>. When done, the client
+should free the list using <emphasis remap='I'>XFree</emphasis>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>n_info_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of elements in the list of
+<emphasis remap='I'>ExtendedVisualInfo</emphasis>.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+XeviGetVisualInfo returns a list of ExtendedVisualInfo structures that describe
+visual information beyond that supported by the core protocol. This includes
+layer information relevant for systems supporting overlays and/or underlay
+planes, and information that allows applications better to determine the level
+of hardware support for multiple colormaps. XeviGetVisualInfo returns Success
+if successful, or an X error otherwise.
+</para>
+
+</sect1>
+</chapter>
+</book>
diff --git a/specs/geproto.xml b/specs/geproto.xml
new file mode 100755 (executable)
index 0000000..7bba357
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<book>
+  <bookinfo>
+    <title>X Generic Event Extension</title>
+
+    <author>
+      <firstname>Peter</firstname>
+
+      <surname>Hutterer</surname>
+
+      <affiliation>
+        <orgname>peter.hutterer@who-t.net</orgname>
+      </affiliation>
+    </author>
+  </bookinfo>
+
+  <chapter>
+    <title>Introduction</title>
+
+    <para>X was designed to provide 64 event opcodes for all extensions. These
+    events are limited to 32 bytes.</para>
+
+    <para>The Generic Event Extension provides a template event for extensions
+    to re-use a single event opcode. GE only provide headers and the most
+    basic functionality, leaving the extensions to interpret the events in
+    their specific context.</para>
+
+    <para>GenericEvents may be longer than 32 bytes. If so, the number of 4
+    byte units following the initial 32 bytes must be specified in the length
+    field of the event.</para>
+  </chapter>
+
+  <chapter>
+    <title>Extension Initialization</title>
+
+    <para>The name of this extension is "Generic Event Extension"</para>
+
+    <programlisting>GEQueryVersion
+    client-major-version: CARD16
+    client-minor-version: CARD16
+==&gt;
+    major-version:        CARD16
+    minor-version:        CARD16</programlisting>
+
+    <para>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.</para>
+
+    <para>As of version 1.0, no other requests are provided by this extension.
+    </para>
+  </chapter>
+
+  <chapter>
+    <title>Events</title>
+
+    <para>GE defines a single event, to be used by all extensions. The event's
+    structure is similar to a reply. This is a core protocol event, ID 35, and
+    is not itself an extension event.</para>
+
+    <programlisting>GenericEvent
+    type:           BYTE       always GenericEvent (35)
+    extension:      CARD8      extension offset
+    sequenceNumber: CARD16     low 16 bits of request seq. number
+    length:         CARD32     length
+    evtype:         CARD16     event type</programlisting>
+
+    <para>The field 'extension' is to be set to the major opcode of the
+    extension. The 'evtype' field is the actual opcode of the event. The
+    length field specifies the number of 4-byte blocks after the initial 32
+    bytes. If length is 0, the event is 32 bytes long.</para>
+  </chapter>
+
+  <chapter>
+    <title>Notes</title>
+
+    <para>Although the wire event is of arbitrary length, the actual size of
+    an XEvent is restricted to sizeof(XEvent) [96 bytes, see Xlib.h]. If an
+    extension converts a wire event to an XEvent &gt; 96 bytes, it will
+    overwrite the space allocated for the event. See struct _XSQEvent in
+    Xlibint.h for details.</para>
+
+    <para>Extensions need to malloc additional data and fill the XEvent
+    structure with pointers to the malloc'd data. The client then needs to
+    free the data, only the XEvent structure will be released by Xlib.</para>
+
+    <para>The server must not send GenericEvents longer than 32 bytes until it
+    has verified that the client is able to interpret these events. If a long
+    event is sent to a client unable to process GenericEvents, future
+    interpretation of replies and events by this client will fail.</para>
+  </chapter>
+</book>
diff --git a/specs/multibuf.xml b/specs/multibuf.xml
new file mode 100755 (executable)
index 0000000..263d580
--- /dev/null
@@ -0,0 +1,1628 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="buffer">
+
+<bookinfo>
+   <title>Extending X for Double-Buffering, Multi-Buffering, and Stereo</title>
+   <releaseinfo>X Version 11, Release 6.4</releaseinfo>
+
+   <authorgroup>
+      <othercredit>
+         <firstname>Jeffrey</firstname><surname>Friedberg</surname>
+      </othercredit>
+      <othercredit>
+         <firstname>Larry</firstname><surname>Seiler</surname>
+      </othercredit>
+      <othercredit>
+         <firstname>Jeff</firstname><surname>Vroom</surname>
+      </othercredit>
+   </authorgroup>
+   <copyright><year>1989</year><holder>Digital Equipment Corporation</holder></copyright>
+   <copyright><year>1989</year><holder>X Consortium</holder></copyright>
+   <copyright><year>1994</year><holder>X Consortium</holder></copyright>
+   <releaseinfo>Version 3.3</releaseinfo>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+
+<legalnotice>
+<para>
+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.
+Digital Equipment Corporation makes no representations
+about the suitability for any purpose of the information in
+this document.  This documentation is provided "as is"
+without express or implied warranty.  This document
+is subject to change.
+</para>
+<para>
+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:
+</para>
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+<para>
+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.
+</para>
+<para>
+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.
+</para>
+<para>
+<emphasis remap='I'>X Window System</emphasis> is a trademark of X Consortium, Inc.
+</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<warning><para>
+The <emphasis remap='I'>Multi-Buffering</emphasis> extension described here
+was a draft standard of the X Consortium prior to Release 6.1.  It has been
+superseded by the Double Buffer
+Extension (DBE).  DBE is an X Consortium Standard as of Release 6.1.
+</para></warning>
+
+<sect1 id="introduction">
+<title>Introduction</title>
+
+<para>
+Several proposals have been written that address some of the
+issues surrounding the support of double-buffered, multi-buffered,
+and stereo windows in the X Window System:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+<emphasis remap='I'>Extending X for Double-Buffering,</emphasis>
+Jeffrey Friedberg, Larry Seiler, Randi Rost.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<emphasis remap='I'>(Proposal for) Double-Buffering Extensions</emphasis>,
+Jeff Vroom.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<emphasis remap='I'>An Extension to X.11 for Displays with Multiple Buffers,</emphasis>
+David S.H. Rosenthal.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<emphasis remap='I'>A Multiple Buffering/Stereo Proposal</emphasis>,
+Mark Patrick.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+The authors of this proposal have tried to unify the above documents
+to yield a proposal that incorporates support for double-buffering,
+multi-buffering, and stereo in a way that is acceptable to all concerned.
+</para>
+</sect1>
+
+<sect1 id="goals">
+<title>Goals</title>
+
+<para>
+Clients should be able to:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Associate multiple buffers with a window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Paint in any buffer associated with a window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Display any buffer associated with a window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Display a series of buffers in a window in rapid succession
+to achieve a <emphasis remap='I'>smooth</emphasis> animation.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Request simultaneous display of different buffers in different windows.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+In addition, the extension should:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Allow existing X applications to run unchanged.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Support a range of implementation methods that can capitalize on
+existing hardware features.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</sect1>
+
+<sect1 id="image_buffers">
+<title>Image Buffers</title>
+
+<para>
+Normal windows are created using the standard
+<function>CreateWindow</function> request:
+</para>
+
+<literallayout class="monospaced">
+CreateWindow
+     parent          : WINDOW
+     w_id            : WINDOW
+     depth           : CARD8
+     visual          : VISUALID or CopyFromParent
+     x, y            : INT16
+     width, height   : INT16
+     border_width    : INT16
+     value_mask      : BITMASK
+     value_list      : LISTofVALUE
+</literallayout>
+
+<para>
+This request allocates a set of window attributes and
+a buffer into which an image can be drawn.
+The contents of this <emphasis remap='I'>image buffer</emphasis> will
+be displayed when the window is mapped to the screen.
+</para>
+
+<para>
+To support double-buffering and multi-buffering,
+we introduce the notion that additional image buffers can
+be created and bound together to form groups.
+The following rules will apply:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+All image buffers in a group will have the same
+visual type, depth, and geometry (ie: width and height).
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Only one image buffer per group can be displayed
+at a time.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Draw operations can occur to any image buffer at
+any time.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Window management requests (<function>MapWindow</function>, <function>DestroyWindow</function>,
+<function>ConfigureWindow</function>, etc...)
+affect all image buffers associated with a window.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Appropriate resize and exposure events will be generated
+for every image buffer that is affected by a window
+management operation.
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+By allowing draw operations to occur on any image buffer at any time,
+a client could, on a multi-threaded multi-processor server,
+simultaneously build up images for display.
+To support this, each buffer must have its own resource ID.
+Since buffers are different than windows and pixmaps
+(buffers are not hierarchical and pixmaps cannot be displayed)
+a new resource, <function>Buffer</function>, is introduced.
+Furthermore, a <function>Buffer</function> is also a <function>Drawable</function>, thus
+draw operations may also be performed on buffers simply
+by passing a buffer ID to the existing pixmap/window
+interface.
+</para>
+
+<para>
+To allow existing X applications to work unchanged, we assume
+a window ID passed in a draw request, for a multi-buffered
+window, will be an <emphasis remap='I'>alias</emphasis> for the ID of the currently
+displayed image buffer.  Any draw requests (eq: <function>GetImage</function>) on
+the window will be relative to the displayed image buffer.
+</para>
+
+<para>
+In window management requests, only a window ID will be
+accepted.  Requests like <function>QueryTree</function>, will continue to
+return only window ID's.  Most events will return
+just the window ID.  Some new events, described in a subsequent
+section, will return a buffer ID.
+</para>
+
+<para>
+When a window has backing store the contents of the window
+are saved off-screen.  Likewise, when the contents of an image
+buffer of a multi-buffer window is saved off-screen, it is
+said to have backing store.  This applies to all image buffers,
+whether or not they are selected for display.
+</para>
+
+<para>
+In some multi-buffer implementations, undisplayed buffers might be
+implemented using pixmaps.  Since the contents of pixmaps exist
+off-screen and are not affected by occlusion, these image buffers
+in effect have backing store.
+</para>
+
+<para>
+On the other hand, both the displayed and undisplayed image buffers
+might be implemented using a subset of the on-screen pixels.
+In this case, unless the contents of an image buffer are saved
+off-screen, these image buffers in effect do not have backing store.
+</para>
+
+<para>
+Output to any image buffer of an unmapped multi-buffered window
+that does not have backing store is discarded.  Output to any
+image buffer of a mapped multi-buffer window will be performed;
+however, portions of an image buffer may be occluded or clipped.
+</para>
+
+<para>
+When an unmapped multi-buffered window becomes mapped, the contents
+of any image buffer buffer that did not have backing store is
+tiled with the background and zero or more exposure events are
+generated.  If no background is defined for the window, then
+the screen contents are not altered and the contents of any
+undisplayed image buffers are undefined.  If backing store was
+maintained for an image buffer, then no exposure events are generated.
+</para>
+</sect1>
+
+<sect1 id="new_requests">
+<title>New Requests</title>
+
+<para>
+The new request, <function>CreateImageBuffers</function>, creates a group of
+image buffers and associates them with a normal X window:
+</para>
+
+<literallayout class="monospaced">
+CreateImageBuffers
+     w_id           : WINDOW
+     buffers        : LISTofBUFFER
+     update_action  : {Undefined,Background,Untouched,Copied}
+     update_hint    : {Frequent,Intermittent,Static}
+     =&gt;
+     number_buffers : CARD16
+
+     (Errors: Window, IDChoice, Value)
+</literallayout>
+
+<para>
+One image buffer will be associated with each ID passed in
+<emphasis remap='I'>buffers</emphasis>.
+The first buffer of the list is referred to as buffer[0], the next
+buffer[1], and so on.  Each buffer will have the same visual type
+and geometry as the window.
+Buffer[0] will refer to the image buffer already associated
+with the window ID and its contents will not be modified.
+The displayed image buffer attribute is set to buffer[0].
+</para>
+
+<para>
+Image buffers for the remaining ID's (buffer[1],...) are allocated.
+If the window is mapped, or if these image buffers have backing
+store, their contents will be tiled with the window background
+(if no background is defined, the buffer contents are undefined),
+and zero or more expose events will be generated for each of these
+buffers.  The contents of an image buffer is undefined when
+the window is unmapped and the buffer does not have backing store.
+</para>
+
+<para>
+If the window already has a group of image buffers
+associated with it (ie: from a previous <function>CreateImageBuffers</function> request)
+the actions described for <function>DestroyImageBuffers</function> are performed first
+(this will delete the association of the previous buffer ID's and
+their buffers as well as de-allocate all buffers except for the
+one already associated with the window ID).
+</para>
+
+<para>
+To allow a server implementation to efficiently allocate the
+buffers, the total number of buffers required and
+the update action (how they will behave during an update)
+is specified "up front" in the request.
+If the server cannot allocate all the buffers requested, the
+total number of buffers actually allocated will be returned.
+No <function>Alloc</function> errors will be generated \- buffer[0] can
+always be associated with the existing displayed image buffer.
+</para>
+
+<para>
+For example, an application that wants to animate a short movie
+loop may request 64 image buffers.  The server may only be able to
+support 16 image buffers of this type, size, and depth.
+The application can then decide 16 buffers is sufficient and may
+truncate the movie loop, or it may decide it really needs
+64 and will free the buffers and complain to the user.
+</para>
+
+<para>
+One might be tempted to provide a request that inquires whether
+<emphasis remap='I'>n</emphasis>
+buffers of a particular type, size, and depth
+<emphasis remap='I'>could</emphasis> be allocated.
+But if the query is decoupled from the actual allocation,
+another client could sneak in and take the buffers before the
+original client has allocated them.
+</para>
+
+<para>
+While any buffer of a group can be selected for display,
+some applications may display buffers in a predictable order
+(ie: the movie loop application).  The
+<emphasis remap='I'>list order</emphasis>
+(buffer[0], buffer[1], ...) will be used as a hint by the
+server as to which buffer will be displayed next.
+A client displaying buffers in this order may see a
+performance improvement.
+</para>
+
+<para>
+<emphasis remap='I'>update_action</emphasis> indicates what should happen to a previously
+displayed buffer when a different buffer becomes displayed.
+Possible actions are:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>Undefined</term>
+    <listitem>
+      <para>
+The contents of the buffer that was
+last displayed will become undefined after the update.  This
+is the most efficient action since it allows the implementation
+to trash the contents of the buffer if it needs to.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Background</term>
+    <listitem>
+      <para>
+The contents of the buffer that was
+last displayed will be set to the background of the window after the update.
+The background action allows devices to use a fast clear
+capability during an update.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Untouched</term>
+    <listitem>
+      <para>
+The contents of the buffer that was
+last displayed will be untouched after the update.  Used
+primarily when cycling through images that have already
+been drawn.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Copied</term>
+    <listitem>
+      <para>
+The contents of the buffer that was
+last displayed will become the same as those that are being
+displayed after the update.  This is useful when incrementally
+adding to an image.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+
+
+<para>
+<emphasis remap='I'>update_hint</emphasis> indicates how often the client will
+request a different buffer to be displayed.
+This hint will allow smart server implementations to choose the
+most efficient means to support a multi-buffered window based
+on the current need of the application (dumb implementations
+may choose to ignore this hint).  Possible hints are:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>Frequent</term>
+    <listitem>
+      <para>
+An animation or movie loop is
+being attempted and the fastest, most efficient means for
+multi-buffering should be employed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Intermittent</term>
+    <listitem>
+      <para>
+The displayed image will be
+changed every so often.  This is common for images that are
+displayed at a rate slower than a second.  For example, a
+clock that is updated only once a minute.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Static</term>
+    <listitem>
+      <para>
+The displayed image buffer will
+not be changed any time soon.  Typically set by an application
+whenever there is a pause in the animation.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+To display an image buffer the following request can be used:
+</para>
+
+<literallayout class="monospaced">
+DisplayImageBuffers
+     buffers         : LISTofBUFFER
+     min_delay       : CARD16
+     max_delay       : CARD16
+
+     (Errors: Buffer, Match)
+</literallayout>
+
+<para>
+The image buffers listed will become displayed as simultaneously
+as possible and the update action, bound at
+<function>CreateImageBuffers</function>
+time, will be performed.
+</para>
+
+<para>
+A list of buffers is specified to
+allow the server to efficiently change the display of more than one
+window at a time (ie: when a global screen swap method is used).
+Attempting to simultaneously display
+multiple image buffers from the same window is an error
+(<function>Match</function>) since it violates the rule that only one
+image buffer per group can be displayed at a time.
+</para>
+
+<para>
+If a specified buffer is already displayed,
+any delays and update action will still be
+performed for that buffer.  In this instance,
+only the update action of <emphasis remap='I'>Background</emphasis>
+(and possibly
+<emphasis remap='I'>Undefined</emphasis>) will have any affect on the
+contents of the displayed buffer.  These semantics allow
+an animation application to successfully execute
+even when there is only a single buffer available
+for a window.
+</para>
+<para>
+<!-- .LP -->
+When a <function>DisplayImageBuffers</function> request is made to an unmapped
+multi-buffered window, the effect of the update action depends
+on whether the image buffers involved have backing store.
+When the target of the update action is an image buffer that
+does not have backing store, output is discarded.  When the
+target image buffer does have backing store, the update is performed;
+however, when the source of the update is an image buffer does not
+have backing store (as in the case of update action
+<emphasis remap='I'>Copied</emphasis>), the
+contents of target image buffer will become undefined.
+</para>
+<para>
+<!-- .LP -->
+<emphasis remap='I'>min_delay</emphasis> and
+<emphasis remap='I'>max_delay</emphasis> put a bound on how long the
+server should wait before processing the display request.
+For each of the windows to be updated by this request, at least
+<emphasis remap='I'>min_delay</emphasis> milli-seconds should elapse since
+the last
+time any of the windows were updated; conversely, no window
+should have to wait more than <emphasis remap='I'>max_delay</emphasis>
+milli-seconds before being updated.
+</para>
+
+<para>
+<emphasis remap='I'>min_delay</emphasis> allows an application to
+<emphasis remap='I'>slow down</emphasis> an animation or movie loop so that
+it appears
+synchronized at a rate the server can support given the current load.
+For example, a <emphasis remap='I'>min_delay</emphasis> of 100 indicates the
+server should
+wait at least 1/10 of a second since the last time any of the
+windows were updated.  A <emphasis remap='I'>min_delay</emphasis> of zero
+indicates no waiting is necessary.
+</para>
+
+<para>
+<emphasis remap='I'>max_delay</emphasis> can be thought of as an additional
+delay beyond <emphasis remap='I'>min_delay</emphasis> the server is allowed
+to wait
+to facilitate such things as efficient update of multiple windows.
+If <emphasis remap='I'>max_delay</emphasis> would require an update before
+<emphasis remap='I'>min_delay</emphasis>
+is satisfied, then the server should process the display request as
+soon as the <emphasis remap='I'>min_delay</emphasis> requirement is met.  A
+typical value for <emphasis remap='I'>max_delay</emphasis> is zero.
+</para>
+
+<para>
+To implement the above functionality, the time since the last
+update by a <function>DisplayImageBuffers</function> request for each
+multi-buffered
+window needs to be saved as state by the server.
+The server may delay execution of the <function>DisplayImageBuffers</function>
+request until the appropriate time (e.g. by requeuing the
+request after computing the timeout);
+however, the entire request must be processed in one operation.
+Request execution indivisibility must be maintained.  When
+a server is implemented with internal concurrency, the
+extension must adhere to the same concurrency semantics
+as those defined for the core protocol.
+</para>
+
+<para>
+To explicitly clear a rectangular area of an image buffer to
+the window background, the following request can be used:
+</para>
+
+<literallayout class="monospaced">
+ClearImageBufferArea
+     buffer          : BUFFER
+     x, y            : INT16
+     w, h            : CARD16
+     exposures       : BOOL
+
+     (Errors: Buffer, Value)
+</literallayout>
+
+<para>
+Like the X <function>ClearArea</function> request,
+<emphasis remap='I'>x</emphasis> and <emphasis remap='I'>y</emphasis>
+are relative to
+the window's origin and specify the upper-left corner of the rectangle.
+If <emphasis remap='I'>width</emphasis> is zero, it is replaced with the
+current window width
+minus <emphasis remap='I'>x</emphasis>.  If
+<emphasis remap='I'>height</emphasis> is zero it is replaced with the current
+window height minus <emphasis remap='I'>y</emphasis>.  If the window has a
+defined background tile, the rectangle is tiled with a plane mask of all ones,
+a function of <emphasis remap='I'>Copy</emphasis>, and a subwindow-mode of
+<emphasis remap='I'>ClipByChildren</emphasis>.
+If the window has background <emphasis remap='I'>None</emphasis>, the
+contents of the buffer
+are not changed.  In either case, if
+<emphasis remap='I'>exposures</emphasis> is true, then one or
+more exposure events are generated for regions of the rectangle that are
+either visible or are being retained in backing store.
+</para>
+
+<para>
+<!-- .LP -->
+The group of image buffers allocated by a
+<function>CreateImageBuffers</function>
+request can be destroyed with the following request:
+</para>
+
+<literallayout class="monospaced">
+DestroyImageBuffers
+     w_id          : WINDOW
+
+     (Error: Window)
+</literallayout>
+
+<para>
+The association between the buffer ID's and their corresponding
+image buffers are deleted.  Any image buffers not selected for
+display are de-allocated.  If the window is not multi-buffered,
+the request is ignored.
+</para>
+
+</sect1>
+
+<sect1 id="attributes">
+<title>Attributes</title>
+
+<para>
+The following attributes will be associated with each window that
+is multi-buffered:
+</para>
+
+<literallayout class="monospaced">
+     displayed_buffer : CARD16
+     update_action    : {Undefined,Background,Untouched,Copied}
+     update_hint      : {Frequent,Intermittent,Static}
+     window_mode      : {Mono,Stereo}
+     buffers          : LISTofBUFFER
+</literallayout>
+
+<para>
+<emphasis remap='I'>displayed_buffer</emphasis> is set to the
+<emphasis remap='I'>index</emphasis> of the currently
+displayed image buffer (for stereo windows, this will be
+the index of the left buffer \- the index of the right buffer
+is simply <emphasis remap='I'>index</emphasis>+1).
+<emphasis remap='I'>window_mode</emphasis> indicates whether this window is
+<emphasis remap='I'>Mono</emphasis> or <emphasis remap='I'>Stereo</emphasis>.
+The ID for each buffer associated with the window is recorded
+in the <emphasis remap='I'>buffers</emphasis> list.
+The above attributes can be queried with the following request:
+</para>
+
+<literallayout class="monospaced">
+GetMultiBufferAttributes
+     w_id             : WINDOW
+     =&gt;
+     displayed_buffer : CARD16
+     update_action    : {Undefined,Background,Untouched,Copied}
+     update_hint      : {Frequent,Intermittent,Static}
+     window_mode      : {Mono,Stereo}
+     buffers          : LISTofBUFFER
+
+     (Errors: Window, Access, Value)
+</literallayout>
+
+<para>
+If the window is not multi-buffered, a <function>Access</function> error
+will be generated.
+The only multi-buffer attribute that can be explicitly set
+is <emphasis remap='I'>update_hint</emphasis>.  Rather than have a specific
+request to set this attribute, a generic set request is provided to
+allow for future expansion:
+</para>
+
+<literallayout class="monospaced">
+SetMultiBufferAttributes
+     w_id            : WINDOW
+     value_mask      : BITMASK
+     value_list      : LISTofVALUE
+
+     (Errors: Window, Match, Value)
+</literallayout>
+
+<para>
+If the window is not multi-buffered, a <function>Match</function> error
+will be generated.
+The following attributes are maintained for each buffer of a
+multi-buffered window:
+</para>
+
+<literallayout class="monospaced">
+     window           : WINDOW
+     event_mask       : SETofEVENT
+     index            : CARD16
+     side             : {Mono,Left,Right}
+</literallayout>
+
+<para>
+<emphasis remap='I'>window</emphasis> indicates the window this buffer is
+associated with.
+<emphasis remap='I'>event_mask</emphasis> specifies which events, relevant to
+buffers, will be sent back to the client via the associated buffer ID
+(initially no events are selected).
+<emphasis remap='I'>index</emphasis> is the list position (0, 1, ...) of the
+buffer.
+<emphasis remap='I'>side</emphasis> indicates whether this buffer is
+associated with
+the left side or right side of a stereo window.
+For non-stereo windows, this attribute will be set to
+<emphasis remap='I'>Mono</emphasis>.
+These attributes can be queried with the following request:
+</para>
+
+<literallayout class="monospaced">
+GetBufferAttributes
+     buffer          : BUFFER
+     =&gt;
+     window           : WINDOW
+     event_mask       : SETofEVENT
+     index            : CARD16
+     side             : {Mono,Left,Right}
+
+     (Errors: Buffer, Value)
+</literallayout>
+
+<para>
+The only buffer attribute that can be explicitly set
+is <emphasis remap='I'>event_mask</emphasis>.
+The only events that are valid are
+<function>Expose</function> and the new
+<function>ClobberNotify</function> and <function>UpdateNotify</function>
+event (see Events section below). <!-- xref -->
+A <function>Value</function> error will be generated if an event not
+selectable for a buffer is specified in an event mask.
+Rather than have a specific request
+to set this attribute, a generic set request is provided to
+allow for future expansion:
+</para>
+
+<literallayout class="monospaced">
+SetBufferAttributes
+     buffer          : BUFFER
+     value_mask      : BITMASK
+     value_list      : LISTofVALUE
+
+     (Errors: Buffer, Value)
+</literallayout>
+
+<para>
+Clients may want to query the server about basic multi-buffer
+and stereo capability on a per screen basis.  The following request
+returns a large list of information
+that would most likely be read once by Xlib for each screen, and used as a
+data base for other Xlib queries:
+</para>
+
+<literallayout class="monospaced">
+GetBufferInfo
+     root            : WINDOW
+     =&gt;
+     info            : LISTofSCREEN_INFO
+</literallayout>
+
+<para>
+Where <function>SCREEN_INFO</function> and
+<function>BUFFER_INFO</function> are defined as:
+</para>
+
+<literallayout class="monospaced">
+     SCREEN_INFO     : [ normal_info : LISTofBUFFER_INFO,
+                         stereo_info : LISTofBUFFER_INFO ]
+
+     BUFFER_INFO     : [ visual      : VISUALID,
+                         max_buffers : CARD16,
+                         depth       : CARD8 ]
+</literallayout>
+
+<para>
+Information regarding multi-buffering of normal (mono) windows
+is returned in the <emphasis remap='I'>normal_info</emphasis> list.
+The <emphasis remap='I'>stereo_info</emphasis>
+list contains information about stereo windows.
+If the <emphasis remap='I'>stereo_info</emphasis> list is empty, stereo
+windows are
+not supported on the screen.  If
+<emphasis remap='I'>max_buffers</emphasis> is zero,
+the maximum number of buffers for the depth and visual is
+a function of the size of the created window and current
+memory limitations.
+</para>
+
+<para>
+The following request returns the major and minor version numbers
+of this extension:
+</para>
+
+<literallayout class="monospaced">
+GetBufferVersion
+     =&gt;
+     major_number    : CARD8
+     minor_number    : CARD8
+</literallayout>
+
+<para>
+The version numbers are an escape hatch in case future revisions of
+the protocol are necessary.  In general, the major version would
+increment for incompatible changes, and the minor version would
+increment for small upward compatible changes.  Barring changes, the
+major version will be 1, and the minor version will be 1.
+</para>
+</sect1>
+
+<sect1 id="events">
+<title>Events</title>
+
+<para>
+All events normally generated for single-buffered
+windows are also generated for multi-buffered windows.
+Most of these events (ie: <function>ConfigureNotify</function>) will
+only be generated for the window and not for each buffer.
+These events will return a window ID.
+</para>
+
+<para>
+<function>Expose</function> events will be generated for both the window
+and any buffer affected.  When this event is generated for
+a buffer, the same event structure will be used
+but a buffer ID is returned instead of a window ID.
+Clients, when processing these events, will know whether an
+ID returned in an event structure is for a window or a buffer
+by comparing the returned ID to the ones returned when the
+window and buffer were created.
+</para>
+
+<para>
+<function>GraphicsExposure</function> and
+<function>NoExposure</function> are generated
+using whatever ID is specified in the graphics operation.
+If a window ID is specified, the event will contain the
+window ID.  If a buffer ID is specified, the event will
+contain the buffer ID.
+</para>
+<para>
+In some implementations, moving a window
+over a multi-buffered window may cause one or more of its buffers
+to get overwritten or become unwritable.  To allow a
+client drawing into one of these buffers the opportunity
+to stop drawing until some portion of the buffer is
+writable, the following event is added:
+</para>
+
+<literallayout class="monospaced">
+ClobberNotify
+     buffer         :  BUFFER
+     state          : {Unclobbered,PartiallyClobbered,FullyClobbered}
+</literallayout>
+
+<para>
+The <function>ClobberNotify</function> event is reported to clients selecting
+<emphasis remap='I'>ClobberNotify</emphasis> on a buffer.  When a buffer
+that was fully
+or partially clobbered becomes unclobbered, an event with
+<emphasis remap='I'>Unclobbered</emphasis>
+is generated.  When a buffer that was unclobbered becomes
+partially clobbered, an event with
+<emphasis remap='I'>PartiallyClobbered</emphasis>
+is generated.  When a buffer that was unclobbered or
+partially clobbered becomes fully clobbered, an event with
+<emphasis remap='I'>FullyClobbered</emphasis> is generated.
+</para>
+
+<para>
+<function>ClobberNotify</function> events on a given buffer are
+generated before any <function>Expose</function> events on that buffer,
+but it is not required that all <function>ClobberNotify</function>
+events on all buffers be generated before all
+<function>Expose</function> events on all buffers.
+</para>
+
+<para>
+The ordering of <function>ClobberNotify</function> events with respect
+to <function>VisibilityNotify</function> events is not constrained.
+</para>
+
+<para>
+If multiple buffers were used as an image FIFO between an image
+server and the X display server, then the FIFO manager would like
+to know when a buffer that was previously displayed, has been
+undisplayed and updated, as the side effect of a
+<function>DisplayImageBuffers</function>
+request.  This allows the FIFO manager to load up a future frame as
+soon as a buffer becomes available.  To support this,
+the following event is added:
+</para>
+
+<literallayout class="monospaced">
+UpdateNotify
+     buffer         :  BUFFER
+</literallayout>
+
+<para>
+The <function>UpdateNotify</function> event is reported to clients selecting
+<emphasis remap='I'>UpdateNotify</emphasis> on a buffer.  Whenever a buffer
+becomes <emphasis remap='I'>updated</emphasis>
+(e.g. its update action is performed as part of a
+<function>DisplayImageBuffers</function>
+request), an <function>UpdateNotify</function> event is generated.
+</para>
+</sect1>
+
+<sect1 id="errors">
+<title>Errors</title>
+
+<para>
+The following error type has been added to support
+this extension:
+</para>
+
+<sect2 id="buffer_2">
+<title>Buffer</title>
+<para>
+A value for a BUFFER argument does not name a defined BUFFER.
+</para>
+</sect2>
+
+<sect2 id="double_buffering_normal_windows">
+<title>Double-Buffering Normal Windows</title>
+
+<para>
+The following pseudo-code fragment illustrates how to create and display
+a double-buffered image:
+</para>
+
+<literallayout class="monospaced">
+/*
+ * Create a normal window
+ */
+CreateWindow( W, ... )
+
+/*
+ * Create two image buffers.  Assume after display, buffer
+ * contents become "undefined".  Assume we will "frequently"
+ * update the display.  Abort if we don't get two buffers,
+ */
+n = CreateImageBuffers( W, [B0,B1], Undefined, Frequent )
+if (n != 2) &lt;abort&gt;
+
+/*
+ * Map window to the screen
+ */
+MapWindow( W )
+
+/*
+ * Draw images using alternate buffers, display every
+ * 1/10 of a second.  Note we draw B1 first so it will
+ * "pop" on the screen
+ */
+while animating
+{
+     &lt;draw picture using B1&gt;
+     DisplayImageBuffers( [B1], 100, 0 )
+
+     &lt;draw picture using B0&gt;
+     DisplayImageBuffers( [B0], 100, 0 )
+}
+
+/*
+ * Strip image buffers and leave window with
+ * contents of last displayed image buffer.
+ */
+DestroyImageBuffers( W )
+</literallayout>
+
+</sect2>
+
+<sect2 id="multi_buffering_normal_windows">
+<title>Multi-Buffering Normal Windows</title>
+
+<para>
+Multi-buffered images are also supported by these requests.
+The following pseudo-code fragment illustrates how to create a
+a multi-buffered image and cycle through the images to
+simulate a movie loop:
+</para>
+
+<literallayout class="monospaced">
+/*
+ * Create a normal window
+ */
+CreateWindow( W, ... )
+
+/*
+ * Create 'N' image buffers.  Assume after display, buffer
+ * contents are "untouched".  Assume we will "frequently"
+ * update the display.  Abort if we don't get all the buffers.
+ */
+n = CreateImageBuffers( W, [B0,B1,...,B(N-1)], Untouched, Frequent )
+if (n != N) &lt;abort&gt;
+
+/*
+ * Map window to screen
+ */
+MapWindow( W )
+
+/*
+ * Draw each frame of movie one per buffer
+ */
+foreach frame
+     &lt;draw frame using B(i)&gt;
+
+/*
+ * Cycle through frames, one frame every 1/10 of a second.
+ */
+while animating
+{
+     foreach frame
+          DisplayImageBuffers( [B(i)], 100, 0 )
+}
+</literallayout>
+
+</sect2>
+
+<sect2 id="stereo_windows">
+<title>Stereo Windows</title>
+<para>
+<emphasis remap='I'>How</emphasis> stereo windows are supported on a server
+is implementation
+dependent.  A server may contain specialized hardware that allows
+left and right images to be toggled at field or frame rates.  The
+stereo affect may only be perceived with the aid of special
+viewing glasses.  The <emphasis remap='I'>display</emphasis> of a
+stereo picture should
+be independent of how often the contents of the picture are
+<emphasis remap='I'>updated</emphasis> by an application.  Double and
+multi-buffering
+of images should be possible regardless of whether the image
+is displayed normally or in stereo.
+</para>
+
+<para>
+To achieve this goal, a simple extension to normal windows
+is suggested.  Stereo windows are just like normal windows
+except the displayed image is made up of a left image
+buffer and a right image buffer.  To create a stereo window,
+a client makes the following request:
+</para>
+
+<literallayout class="monospaced">
+CreateStereoWindow
+     parent          : WINDOW
+     w_id            : WINDOW
+     left, right     : BUFFER
+     depth           : CARD8
+     visual          : VISUALID or CopyFromParent
+     x, y            : INT16
+     width, height   : INT16
+     border_width    : INT16
+     value_mask      : BITMASK
+     value_list      : LISTofVALUE
+
+     (Errors: Alloc, Color, Cursor, Match,
+              Pixmap, Value, Window)
+</literallayout>
+
+<para>
+This request, modeled after the <function>CreateWindow</function> request,
+adds just two new parameters: <emphasis remap='I'>left</emphasis> and
+<emphasis remap='I'>right</emphasis>.
+For stereo, it is essential that one can distinguish whether
+a draw operation is to occur on the left image or right image.
+While an internal mode could have been added to achieve this,
+using two buffer ID's allows clients to simultaneously build up
+the left and right components of a stereo image.  These
+ID's always refer to (are an alias for) the left and right
+image buffers that are currently <emphasis remap='I'>displayed</emphasis>.
+</para>
+
+<para>
+Like normal windows, the window ID is used whenever a window
+management operation is to be performed.  Window queries would
+also return this window ID (eg: <function>QueryTree</function>) as would most
+events.  Like the window ID, the left and right buffer ID's
+each have their own event mask.  They can be set and queried
+using the <function>Set/GetBufferAttributes</function> requests.
+</para>
+
+<para>
+Using the window ID of a stereo window in a draw request
+(eg: <function>GetImage</function>) results in pixels that are
+<emphasis remap='I'>undefined</emphasis>.
+Possible semantics are that both left and right images get
+drawn, or just a single side is operated on (existing applications
+will have to be re-written to explicitly use the left and right
+buffer ID's in order to successfully create, fetch, and store
+stereo images).
+</para>
+
+<para>
+Having an explicit <function>CreateStereoWindow</function> request is helpful
+in that a server implementation will know from the onset whether
+a stereo window is desired and can return appropriate status
+to the client if it cannot support this functionality.
+</para>
+
+<para>
+Some hardware may support separate stereo and non-stereo modes,
+perhaps with different vertical resolutions.  For example, the
+vertical resolution in stereo mode may be half that of non-stereo
+mode.  Selecting one mode or the other must be done through some
+means outside of this extension (eg: by providing a separate
+screen for each hardware display mode).  The screen attributes
+(ie: x/y resolution) for a screen that supports normal windows,
+may differ from a screen that supports stereo windows;
+however, all windows, regardless of type, displayed on the
+same screen must have the same screen attributes
+(ie: pixel aspect ratio).
+</para>
+
+<para>
+If a screen that supports stereo windows also supports
+normal windows, then the images presented to the left and
+right eyes for normal windows should be the same
+(ie: have no stereo offset).
+</para>
+
+</sect2>
+
+<sect2 id="single_buffered_stereo_windows">
+<title>Single-Buffered Stereo Windows</title>
+
+<para>
+The following shows how to create and display a single-buffered
+stereo image:
+</para>
+<literallayout class="monospaced">
+/*
+ * Create the stereo window, map it the screen,
+ * and draw the left and right images
+ */
+CreateStereoWindow( W, L, R, ... )
+
+MapWindow( W )
+
+&lt;draw picture using L,R&gt;
+</literallayout>
+</sect2>
+
+<sect2 id="double_buffering_stereo_windows">
+<title>Double-Buffering Stereo Windows</title>
+
+<para>
+Additional image buffers may be added to a stereo window
+to allow double or multi-buffering of stereo images.
+Simply use the the <function>CreateImageBuffers</function> request.
+Even numbered buffers (0,2,...) will be left buffers.
+Odd numbered buffers (1,3,...) will be right buffers.
+Displayable stereo images are formed by consecutive
+left/right pairs of image buffers.  For example,
+(buffer[0],buffer[1]) form the first displayable
+stereo image; (buffer[2],buffer[3]) the next;
+and so on.
+</para>
+
+<para>
+The <function>CreateImageBuffers</function> request will only create
+pairs of left and right image buffers for stereo windows.
+By always pairing left and right image
+buffers together, implementations might be able to
+perform some type of optimization.  If an odd number
+of buffers is specified, a <function>Value</function> error is generated.
+All the rules mentioned at the start of this proposal
+still apply to the image buffers supported by a stereo window.
+</para>
+
+<para>
+To display a image buffer pair of a multi-buffered stereo image,
+either the left buffer ID or right buffer ID may be specified in a
+<function>DisplayImageBuffers</function> request, but not both.
+</para>
+
+<para>
+To double-buffer a stereo window:
+</para>
+
+<literallayout class="monospaced">
+/*
+ * Create stereo window and map it to the screen
+ */
+CreateStereoWindow( W, L, R, ... )
+
+/*
+ * Create two pairs of image buffers.  Assume after display,
+ * buffer contents become "undefined".  Assume we will "frequently"
+ * update the display.  Abort if we did get all the buffers.
+ */
+n = CreateImageBuffers( W, [L0,R0,L1,R1], Undefined, Frequently )
+if (n != 4) &lt;abort&gt;
+
+/*
+ * Map window to the screen
+ */
+MapWindow( W )
+
+/*
+ * Draw images using alternate buffers,
+ * display every 1/10 of a second.
+ */
+while animating
+{
+     &lt;draw picture using L1,R1&gt;
+     DisplayImageBuffers( [L1], 100, 0 )
+
+     &lt;draw picture using L0,R0&gt;
+     DisplayImageBuffers( [L0], 100, 0 )
+}
+</literallayout>
+
+</sect2>
+
+<sect2 id="multi_buffering_stereo_windows">
+<title>Multi-Buffering Stereo Windows</title>
+
+<para>
+To cycle through <emphasis remap='I'>N</emphasis> stereo images:
+</para>
+
+<literallayout class="monospaced">
+/*
+ * Create stereo window
+ */
+CreateStereoWindow( W, L, R, ... )
+
+/*
+ * Create N pairs of image buffers.  Assume after display,
+ * buffer contents are "untouched".  Assume we will "frequently"
+ * update the display.  Abort if we don't get all the buffers.
+ */
+n = CreateImageBuffers( W, [L0,R0,...,L(N-1),R(N-1)], Untouched, Frequently )
+if (n != N*2) &lt;abort&gt;
+
+/*
+ * Map window to screen
+ */
+MapWindow( W )
+
+/*
+ * Draw the left and right halves of each image
+ */
+foreach stereo image
+     &lt;draw picture using L(i),R(i)&gt;
+
+/*
+ * Cycle through images every 1/10 of a second
+ */
+while animating
+{
+     foreach stereo image
+          DisplayImageBuffers( [L(i)], 100, 0 )
+}
+</literallayout>
+</sect2>
+
+<sect2 id="protocol_encoding">
+<title>Protocol Encoding</title>
+
+<para>
+The official name of this extension is "Multi-Buffering".
+When this string passed to <function>QueryExtension</function> the
+information returned should be interpreted as follows:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>major-opcode</term>
+    <listitem>
+      <para>
+Specifies the major opcode of this extension.
+The first byte of each extension request should
+specify this value.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>first-event</term>
+    <listitem>
+      <para>
+Specifies the code that will be returned when
+<function>ClobberNotify</function> events are generated.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>first-error</term>
+    <listitem>
+      <para>
+Specifies the code that will be returned when
+<function>Buffer</function> errors are generated.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The following sections describe the protocol
+encoding for this extension.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="type">
+<title>TYPES</title>
+
+<literallayout class="monospaced">
+BUFFER_INFO
+
+4       VISUALID     visual
+2       CARD16       max-buffers
+1       CARD8        depth
+1                    unused
+</literallayout>
+
+<literallayout class="monospaced">
+SETofBUFFER_EVENT
+
+        #x00008000   Exposure
+        #x02000000   ClobberNotify
+        #x04000000   UpdateNotify
+</literallayout>
+
+</sect1>
+
+<sect1 id="events_2">
+<title>EVENTS</title>
+
+<literallayout class="monospaced">
+<function>ClobberNotify</function>
+1       see <emphasis remap='I'>first-event</emphasis> code
+1                                unused
+2       CARD16                   sequence number
+4       BUFFER                   buffer
+1                                state
+        0 Unclobbered
+        1 PartiallyClobbered
+        2 FullyClobbered
+23                                unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>UpdateNotify</function>
+1 <emphasis remap='I'>first-event</emphasis>+1 code
+1                       unused
+2      CARD16           sequence number
+4      BUFFER           buffer
+24                      unused
+</literallayout>
+
+</sect1>
+<sect1 id="errors_2">
+<title>ERRORS</title>
+
+<literallayout class="monospaced">
+<function>Buffer</function>
+1     0                 Error
+1     see <emphasis remap='I'>first-error</emphasis> code
+2     CARD16                 sequence number
+4     CARD32                 bad resource id
+2     CARD16                 minor-opcode
+1     CARD8                  major-opcode
+21                           unused
+</literallayout>
+
+</sect1>
+
+<sect1 id="requests">
+<title>REQUESTS</title>
+
+<literallayout class="monospaced">
+<function>GetBufferVersion</function>
+1       see <emphasis remap='I'>major-opcode</emphasis>         major-opcode
+1       0                  minor-opcode
+2       1                  request length
+-&gt;
+1       1                  Reply
+1                          unused
+2       CARD16             sequencenumber
+4       0                  reply length
+1       CARD8              majorversion number
+1       CARD8              minorversion number
+22                         unused
+
+
+<function>CreateImageBuffers</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        1                 minor-opcode
+2        3+n               requestlength
+4        WINDOW            wid
+1                          update-action
+         0 Undefined
+         1 Background
+         2 Untouched
+         3 Copied
+1                          update-hint
+         0 Frequent
+         1 Intermittent
+         2 Static
+2                          unused
+4n     LISTofBUFFER        buffer-list
+-&gt;
+1        1                 Reply
+1                          unused
+2      CARD16              sequencenumber
+4      0                   reply length
+2      CARD16              number-buffers
+22                         unused
+
+
+<function>DestroyImageBuffers</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1       2                  minor-opcode
+2       2                  request length
+4       WINDOW             wid
+
+
+<function>DisplayImageBuffers</function>
+
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+2        2+n               requestlength
+2        CARD16            min-delay
+2        CARD16            max-delay
+4n       LISTofBUFFER      buffer-list
+
+
+<function>SetMultiBufferAttributes</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        4                 minor-opcode
+2        3+n               requestlength
+4        WINDOW            wid
+4        BITMASK           value-mask (has n bits set to 1)
+         #x00000001        update-hint
+4n        LISTofVALUE      value-list
+VALUEs
+1                          update-hint
+         0 Frequent
+         1 Intermittent
+         2 Static
+
+
+<function>GetMultiBufferAttributes</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        5                 minor-opcode
+2        2                 request length
+4        WINDOW            wid
+®
+1        1                 Reply
+1                          unused
+2        CARD16            sequencenumber
+4        n                 reply length
+2        CARD16            displayed-buffer
+1                          update-action
+         0 Undefined
+         1 Background
+         2 Untouched
+         3 Copied
+1                          update-hint
+         0 Frequent
+         1 Intermittent
+         2 Static
+1                          window-mode
+         0 Mono
+         1 Stereo
+19                         unused
+4n       LISTofBUFFER      buffer list
+
+
+<function>SetBufferAttributes</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        6                 minor-opcode
+2        3+n               requestlength
+4        BUFFER            buffer
+4        BITMASK           value-mask (has n bits set to 1)
+         #x00000001        event-mask
+4n       LISTofVALUE       value-list
+VALUEs
+4        SETofBUFFER_EVENT event-mask
+
+<function>GetBufferAttributes</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        7                 minor-opcode
+2        2                 request length
+4        BUFFER            buffer
+-&gt;
+1        1                 Reply
+1                          unused
+2        CARD16            sequencenumber
+4        0                 reply length
+4        WINDOW            wid
+4        SETofBUFFER_EVENT event-mask
+2        CARD16            index
+         1 side
+         0 Mono
+         1 Left
+         2 Right
+13                         unused
+
+<function>GetBufferInfo</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        8                   minor-opcode
+2        2                   request length
+4        WINDOW              root
+®
+1        1                   Reply
+1                            unused
+2        CARD16              sequencenumber
+4        2(n+m)              replylength
+2        n                   number BUFFER_INFO in normal-info
+2        m                   number BUFFER_INFO in stereo-info
+20                           unused
+8n       LISTofBUFFER_INFO   normal-info
+8m       LISTofBUFFER_INFO   stereo-info
+
+<function>CreateStereoWindow</function>
+
+1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
+1        9 minor-opcode
+2        11+n                    requestlength
+3                                unused
+1        CARD8                   depth
+4        WINDOW                  wid
+4        WINDOW                  parent
+4        BUFFER                  left
+4        BUFFER                  right
+2        INT16                   x
+2        INT16                   y
+2        CARD16                  width
+2        CARD16                  height
+2        CARD16                  border-width
+2                                class
+         0 CopyFromParent
+         1 InputOutput
+         2 InputOnly
+4        VISUALID                visual
+         0 CopyFromParent
+4        BITMASK                 value-mask (has n bits set to 1)
+         encodings are the same
+         as for CreateWindow
+4n       LISTofVALUE             value-list
+         encodings are the same
+         as for CreateWindow
+
+
+<function>ClearImageBufferArea</function>
+
+1 see major-opcode major-opcode
+1        10                      minor-opcode
+2        5                       request length
+4        WINDOW                  buffer
+2        INT16                   x
+2        INT16                   y
+2        CARD16                  width
+2        CARD16                  height
+3                                unused
+1        BOOL                    exposures
+
+</literallayout>
+
+</sect1>
+</chapter>
+</book>
diff --git a/specs/security.xml b/specs/security.xml
new file mode 100755 (executable)
index 0000000..bcf0153
--- /dev/null
@@ -0,0 +1,1532 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<!--translated from security.tex, on 2010-06-27 15:29:00,
+by TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)
+xhtml,docbook,html,refcaption -->
+
+<book id="security">
+
+<bookinfo>
+   <title>Security Extension Specification</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release 6.8</releaseinfo>
+   <date>November 15, 1996</date>
+   <authorgroup>
+      <author>
+         <firstname>David</firstname><surname>Wiggins</surname>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1996</year><holder>X Consortium</holder></copyright>
+   <releaseinfo>Version 7.1</releaseinfo>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+
+<legalnotice>
+
+<para>THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, 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.</para>
+
+<para>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.</para>
+
+</legalnotice>
+
+</bookinfo>
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<para>
+The Security extension contains new protocol needed to provide enhanced X
+server security. The Security extension should not be exposed to untrusted
+clients (defined below).
+</para>
+
+</chapter>
+
+<chapter id="requests">
+<title>Requests</title>
+
+<sect1 id="securityqueryversion">
+<title>SecurityQueryVersion</title>
+<para>
+This request returns the major and minor version numbers of this extension.
+</para>
+
+<para>SecurityQueryVersion</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row>
+        <entry align="left">
+          <para>client-major-version</para>
+        </entry>
+        <entry align="left">
+          <para>CARD16</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>client-minor-version</para>
+        </entry>
+        <entry align="left">
+          <para>CARD16</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>=&gt;</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>server-major-version</para>
+        </entry>
+        <entry align="left">
+          <para>CARD16</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>server-minor-version</para>
+        </entry>
+        <entry align="left">
+          <para>CARD16</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The client-major-version and client-minor-version numbers indicate what
+version of the protocol the client wants the server to implement. The
+server-major-version and the server-minor-version numbers returned
+indicate the protocol this extension actually supports. This might not
+equal the version sent by the client. An implementation can (but need not)
+support more than one version simultaneously.  The server-major-version
+and server-minor-version allow the creation of future revisions of the
+Security protocol that may be necessary. In general, the major version
+would increment for incompatible changes, and the minor version would
+increment for small, upward-compatible changes. Servers that support
+the protocol defined in this document will return a server-major-version
+of one (1), and a server-minor-version of zero (0).
+</para>
+
+<para>
+Clients using the Security extension must issue a SecurityQueryVersion
+request before any other Security request in order to negotiate a compatible
+protocol version; otherwise, the client will get undefined behavior
+(Security may or may not work).
+</para>
+</sect1>
+
+<sect1 id="securitygenerateauthentication">
+<title>SecurityGenerateAuthorization</title>
+
+<para>
+This request causes the server to create and return a new authorization with
+specific characteristics. Clients can subsequently connect using the new
+authorization and will inherit some of the characteristics of the
+authorization.
+</para>
+
+<para>
+SecurityGenerateAuthorization
+</para>
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row>
+        <entry align="left">
+          <para>authorization-protocol-name</para>
+        </entry>
+        <entry align="left">
+          <para>STRING8</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>authorization-protocol-data</para>
+        </entry>
+        <entry align="left">
+          <para>STRING8</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>value-mask</para>
+        </entry>
+        <entry align="left">
+          <para>BITMASK</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>value-list</para>
+        </entry>
+        <entry align="left">
+          <para>LISTofVALUE</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>=></para>
+        </entry>
+        <entry>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>authorization-id</para>
+        </entry>
+        <entry align="left">
+          <para>AUTHID</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>authorization-data-return</para>
+        </entry>
+        <entry align="left">
+          <para>STRING8</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+        <entry>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Errors: <function>AuthorizationProtocol</function>, <function>Value</function>, <function>Alloc</function>
+</para>
+
+<para>
+authorization-protocol-name is the name of the authorization method for
+which the server should generate a new authorization that subsequent
+clients can use to connect to the server. If the authorization-protocol-name
+is not one that the server supports, or if authorization-protocol-data
+does not make sense for the given authorization-protocol-name, an
+AuthorizationProtocol error results.
+</para>
+
+<para>
+authorization-protocol-data is authorization-method specific data that can
+be used in some way to generate the authorization.
+</para>
+
+<note><para>
+In this version of the extension, the only authorization method
+required to be supported is "MIT-MAGIC-COOKIE-1" with any amount
+of authorization-protocol-data (including none). The server may use the
+authorization-protocol-data as an additional source of randomness used
+to generate the authorization. Other authorization methods can supply
+their own interpretation of authorization-protocol-data.
+</para></note>
+
+<para>
+The value-mask and value-list specify attributes of the authorization
+that are to be explicitly initialized. The possible values are:
+</para>
+
+<informaltable>
+  <tgroup cols="3">
+    <tbody>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>Attribute</para>
+        </entry>
+        <entry align="left">
+          <para>Type</para>
+        </entry>
+        <entry align="left">
+          <para>Default</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>timeout</para>
+        </entry>
+        <entry align="left">
+          <para>CARD32</para>
+        </entry>
+        <entry align="left">
+          <para>60</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>group</para>
+        </entry>
+        <entry align="left">
+          <para>XID or None</para>
+        </entry>
+        <entry align="left">
+          <para>None</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>trust-level</para>
+        </entry>
+        <entry align="left">
+          <para>{SecurityClientTrusted,</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+        <entry align="left">
+          <para>SecurityClientUntrusted}</para>
+        </entry>
+        <entry align="left">
+          <para>SecurityClientUntrusted</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>event-mask</para>
+        </entry>
+        <entry align="left">
+          <para>SecurityAuthorizationRevoked,</para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+        <entry align="left">
+          <para>or None</para>
+        </entry>
+        <entry align="left">
+          <para>None</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+timeout is the timeout period in seconds for this authorization. A
+timeout value of zero means this authorization will never expire. For
+non-zero timeout values, when timeout seconds have elapsed since the
+last time that the authorization entered the state of having no
+connections authorized by it, and if no new connections used the
+authorization during that time, the authorization is automatically purged.
+(Note that when an authorization is created, it enters the state of having no
+connections authorized by it.) Subsequent connection attempts using that
+authorization will fail. This is to facilitate "fire and forget" launching of
+applications.
+</para>
+
+<para>
+group is an application group ID as defined by the Application Group
+extension, or None. Any other values will cause a Value error. When a
+group is destroyed, all authorizations specifying that group are revoked
+as described under the SecurityRevokeAuthorization request. The Application
+Group extension attaches additional semantics to the group.
+</para>
+
+<para>
+trust-level tells whether clients using the authorization are trusted or
+untrusted. If trust-level is not one of the constants SecurityClientTrusted
+or SecurityClientUntrusted, a Value error results.
+</para>
+
+<para>
+event-mask defines which events the client is interested in for this
+authorization.  When the authorization expires or is revoked if event-mask
+contains SecurityAuthorizationRevoked a SecurityAuthorizationRevoked event
+is reported to the client.
+</para>
+
+<para>
+The SecurityAuthorizationRevoked event contains the following field:
+</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>Field</para>
+        </entry>
+        <entry align="left">
+          <para>Type</para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>authorization-id</para>
+        </entry>
+        <entry align="left">
+          <para>AUTHID</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+where authorization-id is the identification of the authorization that was
+revoked.
+</para>
+<para>
+If an invalid value-mask is specified, a Value error occurs.
+</para>
+
+<para>
+The returned authorization-id is a non-zero value that uniquely identifies
+this authorization for use in other requests. The value space for type
+AUTHID is not required to be disjoint from values spaces of other core
+X types, e.g. resource ids, atoms, visual ids, and keysyms. Thus, a given
+numeric value might be both a valid AUTHID and a valid atom, for example.
+</para>
+
+<para>
+authorization-data-return is the data that a client should use in some
+authorization-method-specific way to make a connection with this
+authorization. For "MIT-MAGIC-COOKIE-1," authorization-data-return should
+be sent as the authorization-protocol-data in the connection setup message.
+It is not required that other authorization methods use
+authorization-data-return this way.
+</para>
+
+</sect1>
+
+<sect1 id="securityrevokeauthorization">
+<title>SecurityRevokeAuthorization</title>
+
+<para>
+This request deletes an authorization created by SecurityGenerateAuthorization.
+</para>
+
+<para>
+SecurityRevokeAuthorization
+</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row>
+        <entry align="left">
+          <para><emphasis remap='I'>authorization-id</emphasis></para>
+        </entry>
+        <entry align="left">
+          <para>AUTHID</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Errors: <function>Authorization</function>
+</para>
+
+<para>
+If authorization-id does not name a valid authorization, an Authorization
+error occurs. Otherwise, this request kills all clients currently connected
+using the authorization specified by authorization-id. The authorization is
+deleted from the server's database, so future attempts by clients to connect
+with this authorization will fail.
+</para>
+
+</sect1>
+</chapter>
+
+<chapter id="changes_to_core_requests">
+<title>Changes to Core Requests</title>
+
+<para>
+A server supporting this extension modifies the handling of some core
+requests in the following ways.
+</para>
+<sect1 id="resource_id_usage">
+<title>Resource ID Usage</title>
+
+<para>
+If an untrusted client makes a request that specifies a resource ID that is
+not owned by another untrusted client, a protocol error is sent to the
+requesting client indicating that the specified resource does not exist.
+The following exceptions apply. An untrusted client can:
+</para>
+
+<orderedlist>
+  <listitem>
+    <para>
+use  the  QueryTree,  GetGeometry,  and  TranslateCoordinates  requests
+without restriction.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+use colormap IDs that are returned in the default-colormap field of its
+connection setup information in any colormap requests.
+    </para>
+  </listitem>
+  <listitem>
+     <para>specify a root window as:</para>
+     <orderedlist>
+       <listitem>
+         <para>
+the drawable field of CreatePixmap, CreateGC, and QueryBestSize.
+         </para>
+       </listitem>
+       <listitem>
+         <para>the parent field of CreateWindow.</para>
+       </listitem>
+       <listitem>
+         <para>
+the window field of CreateColormap, ListProperties, and GetWindowAttributes.
+         </para>
+       </listitem>
+       <listitem>
+         <para>the grab-window or confine-to fields of GrabPointer.
+         </para>
+       </listitem>
+       <listitem>
+         <para>the grab-window field of UngrabButton.</para>
+       </listitem>
+       <listitem>
+         <para>
+the destination of SendEvent, but only if all of the following are true.
+(These conditions cover all the events that the ICCCM specifies with
+a root window destination.)
+         </para>
+         <orderedlist>
+           <listitem>
+             <para>The propogate field of SendEvent is False.</para>
+           </listitem>
+           <listitem>
+             <para>
+The   event-mask   field   of   SendEvent   is   ColormapChange,
+StructureNotify, or the logical OR of SubstructureRedirect with
+SubstructureNotify.
+             </para>
+           </listitem>
+           <listitem>
+             <para>
+The event type being sent is UnmapNotify, ConfigureRequest, or
+ClientMessage.
+             </para>
+           </listitem>
+         </orderedlist>
+       </listitem>
+       <listitem>
+         <para>
+the window field of ChangeWindowAttributes, but only if the value-mask
+contains only event-mask and the corresponding value is StructureNotify,
+PropertyChange, or the logical OR of both.
+         </para>
+       </listitem>
+    </orderedlist>
+  </listitem>
+</orderedlist>
+
+<note>
+<para>
+ISSUE: are root window exceptions needed for these? WarpPointer, ReparentWindow
+(parent), CirculateWindow, QueryPointer (emacs does this), GetMotionEvents.
+</para>
+</note>
+
+</sect1>
+<sect1 id="extension_security">
+<title>Extension Security</title>
+
+<para>
+This extension introduces the notion of secure and insecure extensions. A
+secure extension is believed to be safe to use by untrusted clients; that
+is, there are no significant security concerns known that an untrusted
+client could use to destroy, modify, or steal data of trusted clients. This
+belief may be founded on a careful analysis of the extension protocol,
+its implementation, and measures taken to "harden" the extension to close
+security weaknesses. All extensions not considered secure are called
+insecure. The implementation details of how an extension is identified as
+secure or insecure are beyond the scope of this specification.
+</para>
+
+<para>
+<function>ListExtensions</function> will only return names of secure
+extensions to untrusted clients.
+</para>
+
+<para>
+If an untrusted client uses <function>QueryExtension</function> on an
+insecure extension that the server supports, the reply will have the
+present field set to False and the major-opcode field set to zero to
+indicate that the extension is not supported.
+</para>
+
+<para>
+If an untrusted client successfully guesses the major opcode of an
+insecure extension, attempts by it to execute requests with that major
+opcode will fail with a Request error.
+</para>
+
+</sect1>
+
+<sect1 id="keyboard_security">
+<title>Keyboard Security</title>
+
+
+<para>
+The protocol interpretation changes in this section are intended to prevent
+untrusted applications from stealing keyboard input that was meant for
+trusted clients and to prevent them from interfering with the use of the
+keyboard.
+</para>
+
+<para>
+The behavior of some keyboard-related requests and events is modified when
+the client is untrusted depending on certain server state at the time of
+request execution or event generation. Specifically, if a hypothetical
+keyboard event were generated given the current input focus, pointer
+position, keyboard grab state, and window event selections, and if that
+keyboard event would not be delivered to any untrusted client, the
+following changes apply:
+</para>
+
+<orderedlist>
+  <listitem>
+    <para>
+The bit vector representing the up/down state of the keys returned by
+<function>QueryKeymap</function> and
+<function>KeymapNotify</function> is all zeroes.
+    </para>
+  </listitem>
+  <listitem>
+    <para>GrabKeyboard returns a status of AlreadyGrabbed.</para>
+  </listitem>
+  <listitem>
+    <para>
+<function>SetInputFocus</function> does nothing. Note that this means the
+Globally Active
+Input and WM_TAKE_FOCUS mechanisms specified in the ICCCM will
+not work with untrusted clients.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Passive grabs established by GrabKey that would otherwise have activated
+do not activate.
+    </para>
+  </listitem>
+</orderedlist>
+
+<para>
+If an untrusted client attempts to use any of the following requests, the
+only effect is that the client receives an Access error: SetModifierMapping,
+ChangeKeyboardMapping, ChangeKeyboardControl.
+</para>
+
+<para>
+If an InputOnly window owned by an untrusted client has a parent owned by a
+trusted client, all attempts to map the window will be ignored. This includes
+mapping attempts resulting from MapWindow, MapSubwindows, ReparentWindow,
+and save-set processing.
+</para>
+<para>
+However, if the parent of an InputOnly window owned by an untrusted client
+is the root window, attempts to map that window will be performed as
+expected. This is in line with the root window exceptions above.
+</para>
+</sect1>
+
+<sect1 id="image_security">
+<title>Image Security</title>
+
+<para>
+It should be impossible for an untrusted client to retrieve the image
+contents of a trusted window unless a trusted client takes action to allow
+this. We introduce the following defenses in support of this requirement.
+</para>
+
+<para>
+The restrictions on resource ID usage listed above prevent untrusted clients
+from using GetImage directly on windows not belonging to trusted clients.
+</para>
+
+<para>
+If an untrusted client tries to set the background-pixmap attribute of an
+untrusted window to None, the server will instead use a server-dependent
+background which must be different than None.
+</para>
+
+<para>
+The X protocol description of <function>GetImage</function> states that the
+returned contents of regions of a window obscured by noninferior windows are
+undefined if the window has no backing store. Some implementations return the
+contents of the obscuring windows in these regions. When an untrusted client
+uses <function>GetImage</function>, this behavior is forbidden; the server must
+fill the obscured regions in the returned image with a server-dependent pattern.
+</para>
+
+<para>
+If an untrusted window has trusted inferiors, their contents are vulnerable
+to theft via <function>GetImage</function> on the untrusted parent, as well
+as being vulnerable to destruction via drawing with subwindow-mode
+IncludeInferiors on the untrusted parent. An untrusted window having trusted
+inferiors can only occur at the request of a trusted client. It is expected
+to be an unusual configuration.
+</para>
+
+</sect1>
+
+<sect1 id="property_security">
+
+<title>Property Security</title>
+
+<para>
+Unlike the other security provisions described in this document, security for
+property access is not amenable to a fixed policy because properties are
+used for inter-client communication in diverse ways and may contain data of
+varying degrees of sensitivity. Therefore, we only list the possible
+restrictions the server may decide to impose on use of properties on trusted
+windows by untrusted clients. How the server chooses which restrictions from
+this list to apply to a particular property access is implementation dependent
+  <footnote><para>
+In the X Consortium server implementation, property access is controlled by
+a configuration file; see the -sp option in the Xserver(1) manual page.
+  </para></footnote>.
+</para>
+
+<para>The X Protocol property requests are
+<function>ChangeProperty</function>,
+<function>GetProperty</function>,
+<function>DeleteProperty</function>,
+<function>RotateProperties</function>, and
+<function>ListProperties</function>. For these requests, the server can
+allow the request to execute normally (as if it had been issued by a
+trusted client), ignore the request completely (as if it were a NoOperation),
+or ignore the request except to send an Atom error to the client. Ignoring
+a <function>ListProperties</function> request means replying that
+the window has no properties. <function>ListProperties</function> may also
+reply with a subset of the existing properties if the server is doing
+property hiding; see below. An ignored <function>GetProperty</function>
+request may reply that the property does not exist, or that it exists but
+contains no data.
+</para>
+
+<para>
+The server may decide to hide certain properties on certain windows from
+untrusted clients
+  <footnote><para>
+The X Consortium server implementation does not currently provide a way to
+hide properties.
+  </para></footnote>.
+If a property is to be hidden, it must be done consistently to avoid
+confusing clients.  This means that for untrusted clients:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+That property should not be returned by
+<function>ListProperties</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>PropertyNotify</function> events should not be sent for that
+property.</para>
+    </listitem>
+  <listitem>
+    <para>
+<function>GetProperty</function> on that property should reply that the
+property does not exist (the return type is None, the format and
+bytes-after are zero, and the value is empty).
+    </para>
+  </listitem>
+</itemizedlist>
+
+<para>
+For a property that the server is protecting but not hiding, consistency
+must also be maintained:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+That property should be returned by <function>ListProperties</function>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>PropertyNotify</function> events should be sent for that property.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+<function>GetProperty</function> on that property should reply that the
+property exists (if it really does) but the value is empty
+(return type and format are their real values, and the "length of value"
+field in the reply is zero).
+    </para>
+  </listitem>
+</itemizedlist>
+
+</sect1>
+
+<sect1 id="miscellaneous_security">
+<title>Miscellaneous Security</title>
+
+<para>
+If an untrusted client attempts to use
+<function>ChangeHosts</function>,
+<function>ListHosts</function>, or
+<function>SetAccessControl</function>,
+the only effect is that the client receives an Access error.
+</para>
+
+<para>
+If an untrusted client attempts to use <function>ConvertSelection</function>
+on a selection with a trusted selection owner window, the server generates
+a SelectionNotify event to the requestor with property None.
+</para>
+</sect1>
+</chapter>
+
+<chapter id="new_authorization_method">
+<title>New Authorization Method</title>
+
+<para>
+This extension includes a new authorization method named
+"XC-QUERY-SECURITY-1".  Its purpose is to allow an external agent such as
+the X firewall proxy to probe an X server to determine whether that server
+meets certain security criteria without requiring the agent to have its
+own authorization for that server. The agent may use the returned information
+to make a decision. For example, the X firewall proxy may choose not to
+forward client connections to servers that do not meet the criteria.
+</para>
+
+<para>
+To use this authorization method, the client (or proxy) sends
+"XC-QUERY-SECURITY-1" as the authorization-protocol-name in the initial
+connection setup message. The authorization-protocol-data may be empty or
+may contain additional security criteria desribed below. If the success
+field of the server's reply is Authenticate, the server supports the
+security extension, and the server meets all specified additional security
+criteria. In this case, the client should resend the initial connection
+setup message substituting the authorization protocol name and data
+that should be used to authorize the connection. If the success field of the
+server's reply is anything other than Authenticate, either the server does not
+support the security extension, does not meet (or cannot determine if it
+meets) all of the additional security criteria, or chooses for internal reasons
+not to answer with Authenticate. In this case, the client should close the
+connection.
+</para>
+
+<para>
+If the authorization-protocol-data sent with "XC-QUERY-SECURITY-1" is not
+empty, it specifies additional security criteria for the server to check, as
+follows.
+</para>
+
+<para>
+<function>authorization-protocol-data</function>
+</para>
+
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row>
+        <entry align="left">
+          <para>policy-mask</para>
+        </entry>
+        <entry align="left">
+          <para>BITMASK</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>policies</para>
+        </entry>
+        <entry align="left">
+          <para>LISTofSECURITYPOLICY</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The policy-mask field is any logical-OR combination of the constants
+Extensions and SitePolicies. For each bit set in policy-mask, there is a
+SECURITYPOLICY element in policies. The nth element in policies corresponds
+to the nth 1-bit in policy-mask, counting upward from bit 0.
+</para>
+
+<para><function>SECURITYPOLICY</function></para>
+
+<informaltable>
+  <tgroup cols="2">
+    <tbody>
+      <row>
+        <entry align="left">
+          <para>policy-type</para>
+        </entry>
+        <entry align="left">
+          <para>{Disallow, Permit}</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>names</para>
+        </entry>
+        <entry align="left">
+          <para>LISTofSTR</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+For a SECURITYPOLICY corresponding to policy-mask Extensions, if
+policy-type is Disallow the server is required to consider as insecure
+all extensions given in names.  No policy is specified for extensions
+not listed in names. If policy-type is Permit the server may consider
+only those extensions given in names to be secure; all other extensions
+must be treated as insecure. If these constraints are not met, the server
+should not return Authenticate in the success field of the reply.
+Servers can but need not dynamically configure themselves in response
+to an Extensions SECURITYPOLICY; a conforming server might simply compare
+the policy with a compiled-in table of extensions and their security status.
+</para>
+
+<para>
+For a SECURITYPOLICY corresponding to policy-mask SitePolicies, policy-type
+Disallow means the server must not have been configured with any of the site
+policies given in names. Policy-type Permit means the server must have
+been configured with at least one of the site policies given in names. If
+these constraints are not met, the server should not return Authenticate in
+the success field of the reply.
+</para>
+
+<para>
+SitePolicies provide a way to express new forms of security-relevant
+information that could not be anticipated at the time of this writing.
+For example, suppose the server is found to have a critical security defect.
+When a fix is developed, a site policy string could be associated with the
+fix. Servers with the fix would advertise that site policy, and the X
+firewall proxy would specify that site policy in a SECURITYPOLICY with
+policy-type Permit.
+</para>
+
+</chapter>
+
+<chapter id="encoding">
+<title>Encoding</title>
+
+<para>
+Please refer to the X11 Protocol Encoding document as this section
+uses syntactic conventions and data types established there.
+</para>
+
+<para>
+The name of this extension is "SECURITY".
+</para>
+
+<sect1 id="types">
+<title>Types</title>
+<para>
+AUTHID: CARD32
+</para>
+</sect1>
+
+<sect1 id="request_encoding">
+<title>Request Encoding</title>
+
+<para>
+SecurityQueryVersion
+</para>
+<literallayout remap='FD'>
+1         CARD8         major-opcode
+1         0                minor-opcode
+2         2              request length
+2         CARD16        client-major-version
+2         CARD16        client-minor-version
+=>
+1         1     Reply
+1               unused
+2         CARD16    sequence number
+4         0     reply length
+2         CARD16    server-major-version
+2         CARD16    server-minor-version
+20                            unused
+</literallayout>
+
+<para>
+<function>SecurityRevokeAuthorization</function>
+</para>
+
+<literallayout remap='FD'>
+1         CARD8          major-opcode
+1         2                  minor-opcode
+2         2                  request length
+4         AUTHID         authorization-id
+</literallayout>
+
+<para>
+SecurityGenerateAuthorization
+</para>
+
+<literallayout remap='FD'>
+1         CARD8              major-opcode
+1         1                      minor-opcode
+2         3 + (m+n+3)/4 + s  request length
+2         CARD16             m, number of bytes in authorization protocol name
+2         CARD16             n, number of bytes in authorization data
+m        STRING8             authorization protocol name
+n         STRING8            authorization protocol data
+p                                  unused, p=pad(m+n)
+4         BITMASK          value-mask (has s bits set to 1)
+       #x00000001          timeout
+       #x00000002          trust-level
+       #x00000004          group
+       #x00000008          event-mask
+4s        LISTofVALUE       value-list
+</literallayout>
+
+<para>
+VALUES
+</para>
+<literallayout remap='FD'>
+4      CARD32        timeout
+4                          trust-level
+       0                   SecurityClientTrusted
+       1                   SecurityClientUntrusted
+4      XID              group
+0                          None
+4      CARD32           event-mask
+       #x00000001       SecurityAuthorizationRevoked
+=>
+1         1               Reply
+1                         unused
+2         CARD16     sequence number
+4         (q+3)/4        reply length
+4         AUTHID       authorization-id
+2         CARD16       data-length
+18                        unused
+q         STRING8      authorization-data-return
+r                         unused, r=pad(q)
+</literallayout>
+
+</sect1>
+
+<sect1 id="event_encoding">
+<title>Event Encoding</title>
+<para>
+<function>SecurityAuthorizationRevoked</function>
+</para>
+
+<literallayout remap='FD'>
+1         0+extension event base        code
+1                                                 unused
+2         CARD16                             sequence number
+4         AUTHID                             authorization id
+24                                                unused
+</literallayout>
+
+</sect1>
+
+<sect1 id="authorization_method_encoding">
+<title>Authorization Method Encoding</title>
+
+<para>
+For authorization-protocol-name "XC-QUERY-SECURITY-1", the
+authorization-protocol-data is interpreted as follows:
+</para>
+
+<para>
+<function>authorization-protocol-data</function>
+</para>
+<literallayout remap='FD'>
+1         BITMASK                              policy-mask
+          #x00000001            Extensions
+          #x00000002            SitePolicies
+m        LISTofSECURITYPOLICY                  policies
+</literallayout>
+
+<para>
+<function>SECURITYPOLICY</function>
+</para>
+
+<literallayout remap='FD'>
+1                                                             policy-type
+          0                         Permit
+          1                         Disallow
+1         CARD8                                          number of STRs in names
+n         LISTofSTR                                      names
+</literallayout>
+
+<para>
+LISTofSTR has the same encoding as in the X protocol: each STR is a single
+byte length, followed by that many characters, and there is no padding or
+termination between STRs.
+</para>
+</sect1>
+
+</chapter>
+<chapter id="c_language_binding">
+<title>C Language Binding</title>
+
+<para>
+The header for this extension is &lt;X11/extensions/security.h&gt;. All
+identifier names provided by this header begin with XSecurity.
+</para>
+
+<para>
+All functions that have return type Status will return nonzero for
+success and zero for failure.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function>XSecurityQueryExtension</function></funcdef>
+    <paramdef>Display <parameter> *dpy</parameter></paramdef>
+    <paramdef>int <parameter> *major_version_return</parameter></paramdef>
+    <paramdef>int <parameter> *minor_version_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XSecurityQueryExtension</function> sets major_version_return and
+minor_version_return to the major and minor Security protocol version
+supported by the server. If the Security library is compatible with the
+version returned by the server, it returns nonzero. If dpy does not support
+the Security extension, or if there was an error during communication with
+the server, or if the server and library protocol versions are incompatible,
+it returns zero. No other XSecurity functions may be called before this
+function. If a client violates this rule, the effects of all subsequent
+XSecurity calls that it makes are undefined.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Xauth *<function>XSecurityAllocXauth</function></funcdef>
+    <paramdef><parameter>void</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<para>
+In order to provide for future evolution, Xauth structures are used to
+pass and return authorization data, and the library provides ways to
+allocate and deallocate them.
+</para>
+
+<para>
+<function>XSecurityAllocXauth</function> must be used to allocate the
+Xauth structure that is passed to
+<function>XSecurityGenerateAuthorization</function>.
+</para>
+
+<para>
+For the purposes of the Security extension, the Xauth structure has
+the following fields:
+</para>
+
+<informaltable>
+  <tgroup cols="3">
+    <tbody>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>Type</para>
+        </entry>
+        <entry align="left">
+          <para>Field name</para>
+        </entry>
+        <entry align="left">
+          <para>Description</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>unsigned short</para>
+        </entry>
+        <entry align="left">
+          <para>name_length</para>
+        </entry>
+        <entry align="left">
+          <para>number of bytes in name</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>char *</para>
+        </entry>
+        <entry align="left">
+          <para>name</para>
+        </entry>
+        <entry align="left">
+          <para>authorization protocol name</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>unsigned short</para>
+        </entry>
+        <entry align="left">
+          <para>data_length</para>
+        </entry>
+        <entry align="left">
+          <para>number of bytes in data</para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>char *</para>
+        </entry>
+        <entry align="left">
+           <para>data</para>
+        </entry>
+        <entry align="left">
+          <para>authorization protocol data</para>
+        </entry>
+     </row>
+     <row>
+       <entry align="left">
+         <para></para>
+       </entry>
+     </row>
+     <row>
+       <entry align="left">
+         <para></para>
+       </entry>
+     </row>
+   </tbody>
+  </tgroup>
+</informaltable>
+<para>
+The Xauth structure returned by this function is initialized as follows:
+name_length and data_length are zero, and name and data are NULL.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>void <function>XSecurityFreeXauth</function></funcdef>
+    <paramdef>Xauth<parameter> *auth</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XSecurityFreeXauth</function> must be used to free Xauth
+structures allocated by
+<function>XSecurityAllocXauth</function> or returned by
+<function>XSecurityGenerateAuthorization</function>. It is the
+caller's responsibility to fill in the name and data fields of Xauth structures
+allocated with <function>XSecurityAllocXauth</function>, so this function
+will not attempt to free them. In contrast, all storage associated with
+Xauth structures returned from
+<function>XSecurityGenerateAuthorization</function> will be freed by this
+function, including the name and data fields.
+</para>
+
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Bool <function>XSecurityRevokeAuthorization</function></funcdef>
+    <paramdef>Display<parameter> *dpy</parameter></paramdef>
+    <paramdef>XSecurityAuthorization<parameter> auth_id</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XSecurityRevokeAuthorization</function> deletes the authorization
+specified by auth_id, which must be a value returned in the auth_id_return
+parameter of <function>XSecurityGenerateAuthorization</function>. All
+clients that connected with that authorization are be killed. Subsequently,
+clients that attempt to connect using that authorization will be refused.
+</para>
+
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Xauth *<function>XSecurityGenerateAuthorization</function></funcdef>
+    <paramdef>Display<parameter> *dpy</parameter></paramdef>
+    <paramdef>Xauth<parameter> *auth_in</parameter></paramdef>
+    <paramdef>unsigned long<parameter> valuemask</parameter></paramdef>
+    <paramdef>XSecurityAutorizationAttributes <parameter> *attributes</parameter></paramdef>
+    <paramdef>XSecurityAutorization<parameter> *auth_id_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+<function>XSecurityGenerateAuthorization</function> creates a new
+authorization with the specified attributes. The auth_in argument must be
+allocated by <function>XSecurityAllocXauth</function>. The
+name and name_length fields of auth_in should be initialized to the
+authorization protocol name and its length in characters respectively.
+If there is authorization data, the data and data_length fields of
+auth_in should be initialized to the data and its length in characters
+respectivley. The library does not assume that name and data are
+null-terminated strings. The auth_in argument must be freed with
+<function>XSecurityFreeXauth</function>.
+</para>
+
+<para>
+The XSecurityAuthorizationAttributes structure has the following fields:
+</para>
+
+<informaltable>
+  <tgroup cols="3">
+    <tbody>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>Type</para>
+        </entry>
+        <entry align="left">
+          <para>Field name</para>
+        </entry>
+        <entry align="left">
+          <para>Mask</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>unsigned int</para>
+        </entry>
+        <entry align="left">
+          <para>trust_level</para>
+        </entry>
+        <entry align="left">
+          <para>XSecurityTrustLevel</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>unsigned int</para>
+        </entry>
+        <entry align="left">
+          <para>timeout</para>
+        </entry>
+        <entry align="left">
+          <para>XSecurityTimeout</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>XID</para>
+        </entry>
+        <entry align="left">
+          <para>group</para>
+        </entry>
+        <entry align="left">
+          <para>XSecurityGroup</para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>long</para>
+        </entry>
+        <entry align="left">
+          <para>event_mask</para>
+        </entry>
+        <entry align="left">
+          <para>XSecurityEventMask</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+These correspond to the trust-level, timeout, group, and event-mask
+described in the SecurityGenerateAuthorization protocol request. The
+caller can fill in values for any subset of these attributes. The valuemask
+argument must be the bitwise OR of the symbols listed in the Mask column
+for all supplied attributes. The event_mask attribute can be None,
+XSecurityAuthorizationRevokedMask, or XSecurityAllEventMasks. In this
+revision of the protocol specification XSecurityAllEventMasks is equivalent
+to XSecurityAuthorizationRevokedMask. If the caller does not need to
+specify any attributes, the attributes argument can be NULL, and the
+valuemask argument must be zero.
+</para>
+<para>
+If the function fails, NULL is returned and auth_id_return is filled in
+with zero.  Otherwise, a pointer to an Xauth structure is returned. The name
+and name_length fields of the returned Xauth structure will be copies of the
+name that was passed in, and the data and data_length fields will be set to
+the authorization data returned by the server. The caller should not assume
+that name and data are null-terminated strings. If no authorization data was
+returned by the server, the data and data_length fields will be set to NULL
+and zero repectively. The returned Xauth structure must be freed with
+<function>XSecurityFreeXauth</function>; the caller should not use any other
+means free the structure or any of its components. The auth_id_return
+argument will be filled in with the non-zero authorization id of the created
+authorization.
+</para>
+
+<para>
+The XSecurityAuthorizationRevokedEvent structure has the following fields:
+</para>
+
+<informaltable>
+  <tgroup cols="3">
+    <tbody>
+      <row rowsep="1">
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>Type</para>
+        </entry>
+        <entry align="left">
+          <para>Field name</para>
+        </entry>
+        <entry align="left">
+          <para>Description</para>
+        </entry>
+
+      </row>
+      <row>
+        <entry align="left">
+          <para>int</para>
+        </entry>
+        <entry align="left">
+          <para>type</para>
+        </entry>
+        <entry align="left">
+          <para>event base + XSecurityAuthorizationRevoked</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>unsigned long</para>
+        </entry>
+        <entry align="left">
+          <para>serial</para>
+        </entry>
+        <entry align="left">
+          <para># of last request processed by server</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>Bool</para>
+        </entry>
+        <entry align="left">
+          <para>send_event</para>
+        </entry>
+        <entry align="left">
+          <para>true if this came from SendEvent</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para>Display*</para>
+        </entry>
+        <entry align="left">
+          <para>display</para>
+        </entry>
+        <entry align="left">
+          <para>Display the event was read from</para>
+        </entry>
+      </row>
+      <row rowsep="1">
+        <entry align="left">
+          <para>XSecurityAuthorization</para>
+        </entry>
+        <entry align="left">
+          <para>auth_id</para>
+        </entry>
+        <entry align="left">
+          <para>revoked authorization id</para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+      <row>
+        <entry align="left">
+          <para></para>
+        </entry>
+      </row>
+    </tbody>
+  </tgroup>
+</informaltable>
+</chapter>
+</book>
diff --git a/specs/shape.xml b/specs/shape.xml
new file mode 100755 (executable)
index 0000000..7e5f2f7
--- /dev/null
@@ -0,0 +1,1236 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="shape">
+
+<bookinfo>
+   <title>X Nonrectangular Window Shape Extension Protocol</title>
+   <subtitle>X.Org Standard</subtitle>
+   <releaseinfo>Version 1.1</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Keith</firstname><surname>Packard</surname>
+<affiliation><orgname>MIT X Consortium Intel Corporation</orgname></affiliation>
+      </author>
+      <othercredit>
+         <firstname>Hideki</firstname><surname>Hiura</surname>
+         <affiliation><orgname>SunSoft, Inc.</orgname></affiliation>
+      </othercredit>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1989</year><holder>The Open Group</holder></copyright>
+   <copyright><year>2004</year><holder>The Open Group</holder></copyright>
+   <copyright><year>2006</year><holder>Keith Packard</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 7</productnumber>
+
+<legalnotice>
+
+<para>
+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:
+</para>
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+<para>
+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
+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.
+</para>
+<para>
+Except as contained in this notice, the name of the copyright holders
+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
+copyright holders.
+</para>
+</legalnotice>
+</bookinfo>
+
+<chapter><title>TITLE</title>
+<sect1 id="Overview">
+<title>Overview</title>
+<para>
+<!-- .LP -->
+This extension provides arbitrary window and border shapes within the X11
+protocol.
+</para>
+<para>
+<!-- .LP -->
+The restriction of rectangular windows within the X protocol is a significant
+limitation in the implementation of many styles of user interface.  For
+example, many transient windows would like to display a "drop shadow'' to
+give the illusion of 3 dimensions.  As another example, some user interface
+style guides call for buttons with rounded corners; the full simulation of a
+nonrectangular shape, particularly with respect to event distribution and
+cursor shape, is not possible within the core X protocol.  As a final
+example, round clocks and nonrectangular icons are desirable visual addition
+to the desktop.
+</para>
+<para>
+<!-- .LP -->
+This extension provides mechanisms for changing both the visible and interactive shape of a
+window to arbitrary, possibly disjoint, nonrectangular forms.  The intent
+of the extension is to supplement the existing semantics, not replace them.
+In particular, it is desirable for clients that are unaware of the
+extension to still be able to cope reasonably with shaped windows.  For
+example, window managers should still be able to negotiate screen
+real estate in rectangular pieces.  Toward this end, any shape specified for
+a window is clipped by the bounding rectangle for the window as specified by
+the window's geometry in the core protocol.  An expected convention would be
+that client programs expand their shape to fill the area offered by the
+window manager.
+</para>
+</sect1>
+
+<sect1 id="Description">
+<title>Description</title>
+<para>
+Each window (even with no shapes specified) is defined by three regions:  the
+<emphasis remap='I'>bounding region</emphasis>, the <emphasis remap='I'>clip
+region</emphasis> and the <emphasis remap='I'>input region</emphasis>.  The
+bounding region is the area of the
+parent window that the window will occupy (including border). The clip region
+is the subset of the bounding region that is available for subwindows and
+graphics.  The area between the bounding region and the clip region is defined
+to be the border of the window. The input region is the subset of the
+bounding region that can "contain" the pointer.
+</para>
+
+<para>
+A nonshaped window will have a bounding region that is a rectangle
+spanning the window, including its border; the clip region will be a rectangle
+filling the inside dimensions (not including the border); the input
+region will match the bounding region.  In this document,
+these areas are referred to as the
+<emphasis remap='I'>default bounding region</emphasis>, the
+<emphasis remap='I'>default clip region</emphasis> and the
+<emphasis remap='I'>default input region</emphasis>.  For a window with inside
+size of <emphasis remap='I'>width</emphasis> by
+<emphasis remap='I'>height</emphasis> and border width
+<emphasis remap='I'>bwidth</emphasis>, the default bounding, clip
+and input regions are the rectangles (relative to the window origin):
+</para>
+
+<literallayout class="monospaced">
+bounding.x = -<emphasis remap='I'>bwidth</emphasis>
+bounding.y = -<emphasis remap='I'>bwidth</emphasis>
+bounding.width = <emphasis remap='I'>width</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
+bounding.height = <emphasis remap='I'>height</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
+
+clip.x = 0
+clip.y = 0
+clip.width = <emphasis remap='I'>width</emphasis>
+clip.height = <emphasis remap='I'>height</emphasis>
+
+input.x = -<emphasis remap='I'>bwidth</emphasis>
+input.y = -<emphasis remap='I'>bwidth</emphasis>
+input.width = <emphasis remap='I'>width</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
+input.height = <emphasis remap='I'>height</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
+</literallayout>
+
+<para>
+This extension allows a client to modify any combination of the bounding,
+clip or input regions by specifying new regions that combine with the default
+regions.  These new regions are called the
+<emphasis remap='I'>client bounding region</emphasis>,
+the <emphasis remap='I'>client clip region</emphasis> and the
+<emphasis remap='I'>client input region</emphasis>.  They are specified
+relative to the origin of
+the window and are always defined by offsets relative to the window origin
+(that is, region adjustments are not required when the window is moved).
+Three mechanisms for specifying regions are provided:  a list of rectangles,
+a bitmap, and an existing bounding or clip region from a window.  This is
+modeled on the specification of regions in graphics contexts in the core
+protocol and allows a variety of different uses of the extension.
+</para>
+
+<para>
+When using an existing window shape as an operand in specifying a new shape,
+the client region is used, unless none has been set, in which case the
+default region is used instead.
+</para>
+
+<para>
+The <emphasis remap='I'>effective bounding region</emphasis> of a window
+is defined to be the intersection of
+the client bounding region with the default bounding region.  Any portion of
+the client bounding region that is not included in the default bounding
+region will not be included in the effective bounding region on the screen.
+This means that window managers (or other geometry managers) used to dealing
+with rectangular client windows will be able to constrain the client to a
+rectangular area of the screen.
+</para>
+
+<para>
+Construction of the effective bounding region is dynamic; the client bounding
+region is not mutated to obtain the effective bounding region.  If a client
+bounding region is specified that extends beyond the current default bounding
+region, and the window is later enlarged, the effective bounding region will
+be enlarged to include more of the client bounding region.
+</para>
+
+<para>
+The <emphasis remap='I'>effective clip region</emphasis> of a window is defined to be the intersection of the
+client clip region with both the default clip region and the client bounding
+region.  Any portion of the client clip region that is not included in both
+the default clip region and the client bounding region will not be included in
+the effective clip region on the screen.
+</para>
+
+<para>
+Construction of the effective clip region is dynamic; the client clip region is
+not mutated to obtain the effective clip region.  If a client clip region is
+specified that extends beyond the current default clip region and the
+window or its bounding region is later enlarged, the effective clip region will
+be enlarged to include more of the client clip region if it is included in
+the effective bounding region.
+</para>
+
+<para>
+The border of a window is defined to be the difference between the effective
+bounding region and the effective clip region.  If this region is empty, no
+border is displayed.  If this region is nonempty, the border is filled
+using the border-tile or border-pixel of the window as specified in the core
+protocol.  Note that a window with a nonzero border width will never be able
+to draw beyond the default clip region of the window.  Also note that a zero
+border width does not prevent a window from having a border, since the clip
+shape can still be made smaller than the bounding shape.
+</para>
+
+<para>
+All output to the window and visible regions of any subwindows will be
+clipped to the effective clip region.  The server must not retain window
+contents beyond the effective bounding region with backing store.  The window's
+origin (for graphics operations, background tiling, and subwindow placement)
+is not affected by the existence of a bounding region or clip region.
+</para>
+
+<para>
+The <emphasis remap='I'>effective input region</emphasis> of a window is
+defined to be the intersection of the
+client input region with both the default input region and the client bounding
+region.  Any portion of the client input region that is not included in both
+the default input region and the client bounding region will not be included in
+the effective input region on the screen.
+</para>
+<para>
+<!-- .LP -->
+Construction of the effective input region is dynamic; the client input region is
+not mutated to obtain the effective input region.  If a client input region is
+specified that extends beyond the current default input region and the
+window or its bounding region is later enlarged, the effective input region will
+be enlarged to include more of the client input region if it is included in
+the effective bounding region.
+</para>
+<para>
+<!-- .LP  -->
+Areas that are inside the default bounding region but outside the effective
+bounding region are not part of the window; these areas of the screen will
+be occupied by other windows.  Input events that occur within the default
+bounding region but outside the effective bounding region will be delivered as
+if the window was not occluding the event position.  Events that occur in
+a nonrectangular border of a window will be delivered to that window, just
+as for events that occur in a normal rectangular border.
+</para>
+<para>
+<!-- .LP -->
+An
+<function>InputOnly</function>
+window can have its bounding or input region set, but it is a
+<function>Match</function>
+error to attempt to set a clip region on an
+<function>InputOnly</function>
+window or to specify its clip region as a source to a request
+in this extension.
+</para>
+<para>
+<!-- .LP -->
+The server must accept changes to the clip and input regions of a root window, but
+the server is permitted to ignore requested changes to the bounding region
+of a root window.  If the server accepts bounding region changes, the contents
+of the screen outside the bounding region are implementation dependent.
+</para>
+</sect1>
+
+<sect1 id="Types">
+<title>Types</title>
+<para>
+<!-- .LP -->
+The following types are used in the request and event definitions in
+subsequent sections.
+</para>
+
+<para>
+SHAPE_KIND:
+{ <function>Bounding</function>,
+<function>Clip</function>,
+<function>Input</function> }
+</para>
+
+<para>
+SHAPE_OP:
+{ <function>Set</function>,
+<function>Union</function>,
+<function>Intersect</function>,
+<function>Subtract</function>,
+<function>Invert</function> }
+</para>
+
+<para>
+<function>Set</function>
+indicates that the region specified as an explicit source in the request is
+stored unaltered as the new destination client region.
+<function>Union</function>
+indicates that the source and destination regions are unioned together to
+produce the new destination client region.
+<function>Intersect</function>
+indicates that the source and destination regions are intersected together to
+produce the new destination client region.
+<function>Subtract</function>
+indicates that the source region is subtracted from the destination region to
+produce the new destination region.
+<function>Invert</function>
+indicates that the destination region is subtracted from the source region to
+produce the new destination region.
+</para>
+</sect1>
+
+<sect1 id="Requests">
+<title>Requests</title>
+<para>
+<function>ShapeQueryVersion</function>
+</para>
+
+<para>
+   =&gt;
+</para>
+
+<para>
+majorVersion: CARD16
+</para>
+<para>
+minorVersion: CARD16
+</para>
+
+<para>
+This request can be used to ensure that the server version of the SHAPE
+extension is usable by the client.  This document defines major version one
+(1), minor version one (1).
+</para>
+
+<para>
+<function>ShapeRectangles</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>dest</emphasis>: WINDOW</entry>
+    </row>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>destKind</emphasis>: SHAPE_KIND</entry>
+    </row>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>op</emphasis>: SHAPE_OP</entry>
+    </row>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>xOff, yOff</emphasis>: INT16</entry>
+    </row>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>rectangles</emphasis>: LISTofRECTANGLES</entry>
+    </row>
+    <row rowsep="0">
+      <entry><emphasis remap='I'>ordering</emphasis>:
+{ <function>UnSorted</function>,
+<function>YSorted</function>,
+<function>YXSorted</function>,
+<function>YXBanded</function> }
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Length</function>,
+<function>Match</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request specifies an array of rectangles, relative to the origin of the
+window plus the specified offset (xOff and yOff) that together
+define a region.  This region is combined (as specified by the operator
+op) with the existing client region (specified by destKind) of the
+destination window, and the result is stored as the specified client region of
+the destination window.  Note that the list of rectangles can be empty,
+specifying an empty region; this is not the same as passing
+<function>None</function> to
+<function>ShapeMask</function>,
+</para>
+
+<para>
+If known by the client,
+ordering relations on the rectangles can be specified with the ordering
+argument.
+This may provide faster operation by the server.
+The meanings of the ordering values are the same as in the core protocol
+<function>SetClipRectangles</function>
+request.
+If an incorrect ordering is specified,
+the server may generate a
+<function>Match </function>
+error, but it is not required to do so.
+If no error is generated,
+the graphics results are undefined.
+Except for
+<function>UnSorted ,</function>
+the rectangles should be nonintersecting, or the resulting region will
+be undefined.
+<function>UnSorted </function>
+means that the rectangles are in arbitrary order.
+<function>YSorted </function>
+means that the rectangles are nondecreasing in their Y origin.
+<function>YXSorted </function>
+additionally constrains
+<function>YSorted </function>
+order in that all rectangles with an equal Y origin are
+nondecreasing in their X origin.
+<function>YXBanded </function>
+additionally constrains
+<function>YXSorted </function>
+by requiring that, for every possible Y scanline,
+all rectangles that include that scanline have identical Y origins and Y
+extents.
+</para>
+
+<para>
+<function>ShapeMask</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>dest</emphasis>: WINDOW
+<emphasis remap='I'>destKind</emphasis>: SHAPE_KIND
+<emphasis remap='I'>op</emphasis>: SHAPE_OP
+<emphasis remap='I'>xOff, yOff</emphasis>: INT16
+<emphasis remap='I'>source</emphasis>: PIXMAP or
+<function>None</function>
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Pixmap</function>,
+<function>Match</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The source in this request is a 1-bit deep pixmap, or
+<function>None .</function>
+If source is
+<function>None ,</function>
+the specified client region is removed from the window, causing the effective
+region to revert to the default region.  The
+<function>ShapeNotify</function>
+event generated by this request and subsequent
+<function>ShapeQueryExtents</function>
+will report that a client shape has not been specified.
+If a valid pixmap is specified, it is converted
+to a region, with bits set to one included in the region and bits set to
+zero excluded, and an offset from the window origin as specified by
+xOff and yOff.  The resulting region is then combined (as
+specified by the operator op) with the existing client region
+(indicated by destKind) of the destination window, and the result is
+stored as the specified client region of the destination window.  The source
+pixmap and destination window must have been created on the same screen,
+or else a
+<function>Match</function>
+error results.
+</para>
+
+<para>
+<function>ShapeCombine</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>dest</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>destKind</emphasis>: SHAPE_KIND
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>op</emphasis>: SHAPE_OP
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>xOff, yOff</emphasis>: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>source</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>sourceKind</emphasis>: SHAPE_KIND
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Match</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The client region, indicated by sourceKind, of the source window is
+offset from the window origin by xOff and yOff and combined with
+the client region, indicated by destKind, of the destination window.
+The result is stored as the specified client region of the destination
+window.
+The source and destination windows must be on the same screen, or else a
+<function>Match</function>
+error results.
+</para>
+
+<para>
+<function>ShapeOffset</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>dest</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>destKind</emphasis>: SHAPE_KIND
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>xOff, yOff</emphasis>: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Match</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The client region, indicated by destKind, is moved relative to its
+current position by the amounts xOff and yOff.
+</para>
+
+<para>
+<function>ShapeQueryExtents</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>dest</emphasis>: WINDOW
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+   =&gt;
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+boundingShaped: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+clipShaped: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+xBoundingShape: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+yBoundingShape: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+widthBoundingShape: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+heightBoundingShape: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+xClipShape: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+yClipShape: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+widthClipShape: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+heightClipShape: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+The boundingShaped and clipShaped results are
+<function>True</function>
+if the corresponding client regions have been specified, else they are
+<function>False .</function>
+The x, y, width, and height values define the extents of the client regions,
+when a client region has not been specified, the extents of the
+corresponding default region are reported.
+</para>
+
+<para>
+<function>ShapeSelectInput</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>enable</emphasis>: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Specifying enable as
+<function>True</function>
+causes the server to send the requesting client a
+<function>ShapeNotify</function>
+event whenever the bounding, clip or input region of the specified window is
+altered by any client.
+Specifying enable as
+<function>False</function>
+causes the server to stop sending such events.
+</para>
+
+<para>
+<function>ShapeInputSelected</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+enable: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If enable is
+<function>True</function>, then
+<function>ShapeNotify</function>
+events for the window are generated for this client.
+</para>
+
+<para>
+<function>ShapeGetRectangles</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>kind</emphasis>: SHAPE_KIND
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+   =&gt;
+rectangles: LISTofRECTANGLE
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+ordering:
+{ <function>UnSorted</function>,
+<function>YSorted</function>,
+<function>YXSorted</function>,
+<function>YXBanded</function> }
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window,</function>
+<function>Match</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+A list of rectangles describing the region indicated by kind, and the
+ordering of those rectangles, is returned.  The meaning of the ordering
+values is the same as in the
+<function>ShapeRectangles</function>
+request.
+</para>
+</sect1>
+
+<sect1 id="Events">
+<title>Events</title>
+<para>
+<function>ShapeNotify</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>kind</emphasis>: SHAPE_KIND
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>shaped</emphasis>: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>x, y</emphasis>: INT16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>width</emphasis>,
+<emphasis remap='I'>height</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>time</emphasis>: TIMESTAMP
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Whenever the client bounding, clip or input shape of a window is modified, a
+<function>ShapeNotify</function>
+event is sent to each client that has used
+<function>ShapeSelectInput</function>
+to request it.
+</para>
+
+<para>
+Kind indicates which client region (bounding or clip) has been modified;
+shaped is
+<function>True</function>
+when the window has a client shape of type kind, and is
+<function>False</function>
+when the window no longer has a client shape of this type.
+The x, y, width, and height indicate the extents of the
+current shape.  When shaped is
+<function>False</function>
+these will indicate the extents of the default region.  The timestamp
+indicates the server time when the shape was changed.
+</para>
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+<para>
+Please refer to the X11 Protocol Encoding document as this document uses
+conventions established there.
+</para>
+
+<para>
+The name of this extension is "SHAPE".
+</para>
+
+<sect2 id="New_Types">
+<title>New Types</title>
+
+<literallayout class="monospaced">
+SHAPE_KIND
+     0     Bounding
+     1     Clip
+     2     Input
+</literallayout>
+
+<literallayout class="monospaced">
+SHAPE_OP
+     0     Set
+     1     Union
+     2     Intersect
+     3     Subtract
+     4     Invert
+</literallayout>
+</sect2>
+
+<sect2 id="Requests_2">
+<title>Requests</title>
+<literallayout class="monospaced">
+<function>ShapeQueryVersion</function>
+     1     CARD8              opcode
+     1     0                  shape opcode
+     2     1                  request length
+
+=&gt;
+     1     1                  Reply
+     1                        unused
+     2     CARD16             sequence number
+     4     0                  length
+     2     CARD16             major version
+     2     CARD16             minor version
+     20                       unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeRectangles</function>
+     1     CARD8              opcode
+     1     1                  shape opcode
+     2     4+2n               request length
+     1     SHAPE_OP           operation
+     1     SHAPE_KIND         destination kind
+     1                        ordering
+           0     UnSorted
+           1     YSorted
+           2     YXSorted
+           3     YXBanded
+     1                        unused
+     4     WINDOW             destination window
+     2     INT16              x offset
+     2     INT16              y offset
+     8n    LISTofRECTANGLE    rectangles
+</literallayout>
+
+
+<literallayout class="monospaced">
+<function>ShapeMask</function>
+     1     CARD8              opcode
+     1     2                  shape opcode
+     2     5                  request length
+     1     SHAPE_OP           operation
+     1     SHAPE_KIND         destination kind
+     2                        unused
+     4     WINDOW             destination window
+     2     INT16              x offset
+     2     INT16              y offset
+     4     PIXMAP             source bitmap
+           0     None
+</literallayout>
+
+
+<literallayout class="monospaced">
+<function>ShapeCombine</function>
+     1     CARD8              opcode
+     1     3                  shape opcode
+     2     5                  request length
+     1     SHAPE_OP           operation
+     1     SHAPE_KIND         destination kind
+     1     SHAPE_KIND         source kind
+     1                        unused
+     4     WINDOW             destination window
+     2     INT16              x offset
+     2     INT16              y offset
+     4     WINDOW             source window
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeOffset</function>
+     1     CARD8              opcode
+     1     4                  shape opcode
+     2     4                  request length
+     1     SHAPE_KIND         destination kind
+     3                        unused
+     4     WINDOW             destination window
+     2     INT16              x offset
+     2     INT16              y offset
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeQueryExtents</function>
+     1     CARD8              opcode
+     1     5                  shape opcode
+     2     2                  request length
+     4     WINDOW             destination window
+
+ =&gt;
+     1     1                  Reply
+     1                        unused
+     2     CARD16             sequence number
+     4     0                  reply length
+     1     BOOL               bounding shaped
+     1     BOOL               clip shaped
+     2                        unused
+     2     INT16              bounding shape extents x
+     2     INT16              bounding shape extents y
+     2     CARD16             bounding shape extents width
+     2     CARD16             bounding shape extents height
+     2     INT16              clip shape extents x
+     2     INT16              clip shape extents y
+     2     CARD16             clip shape extents width
+     2     CARD16             clip shape extents height
+     4                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeSelectInput</function>
+     1     CARD8              opcode
+     1     6                  shape opcode
+     2     3                  request length
+     4     WINDOW             destination window
+     1     BOOL               enable
+     3                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeInputSelected</function>
+     1     CARD8              opcode
+     1     7                  shape opcode
+     2     2                  request length
+     4     WINDOW             destination window
+ =&gt;
+     1     1                  Reply
+     1     BOOL               enabled
+     2     CARD16             sequence number
+     4     0                  reply length
+     24                       unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>ShapeGetRectangles</function>
+     1     CARD8              opcode
+     1     8                  shape opcode
+     2     3                  request length
+     4     WINDOW             window
+     1     SHAPE_KIND         source kind
+     3                        unused
+ =&gt;
+     1     1                  Reply
+     1                        ordering
+           0     UnSorted
+           1     YSorted
+           2     YXSorted
+           3     YXBanded
+     2     CARD16             sequence number
+     4     2n                 reply length
+     4     CARD32             nrects
+     20                       unused
+     8n    LISTofRECTANGLE    rectangles
+</literallayout>
+</sect2>
+
+<sect2 id="Events_2">
+<title>Events</title>
+<literallayout class="monospaced">
+<function>ShapeNotify</function>
+     1     CARD8               type (0 + extension event base)
+     1     SHAPE_KIND          shape kind
+     2     CARD16              sequence number
+     4     WINDOW              affected window
+     2     INT16               x value of extents
+     2     INT16               y value of extents
+     2     CARD16              width of extents
+     2     CARD16              height of extents
+     4     TIMESTAMP           server time
+     1     BOOL                shaped
+     11                        unused
+</literallayout>
+</sect2>
+</sect1>
+</chapter>
+
+<glossary id="glossary">
+<title>Glossary</title>
+<glossentry>
+  <glossterm>bounding region</glossterm>
+  <glossdef>
+<para>
+The area of the parent window that this window will occupy.  This area is
+divided into two parts:  the border and the interior.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>clip region</glossterm>
+  <glossdef>
+<para>
+The interior of the window, as a subset of the bounding region.  This
+region describes the area that will be painted with the window background
+when the window is cleared, will contain all graphics output to the window,
+and will clip any subwindows.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>input region</glossterm>
+  <glossdef>
+<para>
+The subset of the bounding region which can ``contain'' the
+pointer.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>default bounding region</glossterm>
+  <glossdef>
+<para>
+The rectangular area, as described by the core protocol window size, that
+covers the interior of the window and its border.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>default clip region</glossterm>
+  <glossdef>
+<para>
+The rectangular area, as described by the core protocol window size, that
+covers the interior of the window and excludes the border.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>default input region</glossterm>
+  <glossdef>
+<para>
+The rectangular area, as described by the core protocol window size, that
+covers the interior of the window and its border.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>client bounding region</glossterm>
+  <glossdef>
+<para>
+The region associated with a window that is directly modified via this
+extension when specified by
+<function> ShapeBounding .</function>
+This region is used in conjunction with the default bounding region
+to produce the effective bounding region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>client clip region</glossterm>
+  <glossdef>
+<para>
+The region associated with a window that is directly modified via this
+extension when specified by
+<function> ShapeClip . </function>
+This region is used in conjunction with the default clip region
+and the client bounding region to produce the effective clip region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>client input region</glossterm>
+  <glossdef>
+<para>
+The region associated with a window that is directly modified via this
+extension when specified by
+<function> ShapeInput . </function>
+This region is used in conjunction with the default input region
+and the client bounding region to produce the effective input region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>effective bounding region</glossterm>
+  <glossdef>
+<para>
+The actual shape of the window on the screen, including border and interior
+(but excluding the effects of overlapping windows).  When a window has a client
+bounding region, the effective bounding region is the intersection of the
+default bounding region and the client bounding region.  Otherwise, the
+effective bounding region is the same as the default bounding region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>effective clip region</glossterm>
+  <glossdef>
+<para>
+The actual shape of the interior of the window on the screen (excluding the
+effects of overlapping windows).  When a window has a client clip region or
+a client bounding region, the effective clip region is the intersection of
+the default clip region, the client clip region (if any) and the client
+bounding region (if any).  Otherwise, the effective clip region is the
+same as the default clip region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<glossentry>
+  <glossterm>effective input region</glossterm>
+  <glossdef>
+<para>
+The actual shape of the window on the screen (excluding the
+effects of overlapping windows) which can ``contain'' the pointer.
+When a window has a client input region or
+a client bounding region, the effective input region is the intersection of
+the default input region, the client input region (if any) and the client
+bounding region (if any).  Otherwise, the effective input region is the
+same as the default input region.
+<!-- .KE -->
+    </para>
+  </glossdef>
+</glossentry>
+<!--
+Revision History
+.LP
+1.0 - 1989 - Original Revision
+.LP
+1.0.1 - March 2004 - Corrected misnumbering of \fIShapeInputSelected
+and \fIShapeGetRectangles requests in encoding section.
+.LP
+1.1 - February 2006 - Added Input regions.
+-->
+</glossary>
+</book>
diff --git a/specs/shm.xml b/specs/shm.xml
new file mode 100755 (executable)
index 0000000..24c989c
--- /dev/null
@@ -0,0 +1,474 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<!-- lifted from troff+ms+XMan by doclifter -->
+<book id="mit-shm">
+
+<bookinfo>
+   <title>MIT-SHM(The MIT Shared Memory Extension)</title>
+   <subtitle>How the shared memory extension works</subtitle>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Jonathan</firstname><surname>Corbet</surname>
+         <affiliation><orgname>Atmospheric Technology Division National Center for Atmospheric Research</orgname></affiliation>
+      <email>corbet@ncar.ucar.edu</email>
+      </author>
+      <othercredit>
+         <contrib>Formatted and edited for release 5 by</contrib>
+         <firstname>Keith</firstname><surname>Packard</surname>
+         <affiliation><orgname>MIT X Consortium</orgname></affiliation>
+      </othercredit>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1991</year><holder>X Consortium</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 7</productnumber>
+
+<abstract>
+<para>
+This document briefly describes how to use the MIT-SHM shared memory
+extension.  I have tried to make it accurate, but it would not surprise me
+if some errors remained.  If you find anything wrong, do let me know and I
+will incorporate the corrections.  Meanwhile, please take this document "as
+is" (eman improvement over what was there before, but certainly not the
+definitive word.)
+</para>
+</abstract>
+
+<legalnotice>
+<para>
+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:
+</para>
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+<para>
+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.
+</para>
+<para>
+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.
+</para>
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<sect1 id="REQUIREMENTS">
+<title>REQUIREMENTS</title>
+<para>
+The shared memory extension is provided only by some X servers.  To find out
+if your server supports the extension, use xdpyinfo(1).  In particular, to
+be able to use this extension, your system must provide the SYSV shared
+memory primitives.  There is not an mmap-based version of this extension.
+To use shared memory on Sun systems, you must have built your kernel with
+SYSV shared memory enabled -- which is not the default configuration.
+Additionally, the shared memeory maximum size will need to be increased on
+both Sun and Digital systems; the defaults are far too small for any useful
+work.
+</para>
+</sect1>
+
+<sect1 id="WHAT_IS_PROVIDED">
+<title>WHAT IS PROVIDED</title>
+
+<para>
+The basic capability provided is that of shared memory XImages.  This is
+essentially a version of the ximage interface where the actual image data
+is stored in a shared memory segment, and thus need not be moved through
+the Xlib interprocess communication channel.  For large images, use of this
+facility can result in some real performance increases.
+</para>
+
+<para>
+Additionally, some implementations provided shared memory pixmaps.  These
+are 2 dimensional arrays of pixels in a format specified by the X server,
+where the image data is stored in the shared memory segment.  Through use of
+shared memory pixmaps, it is possible to change the contents of these
+pixmaps without using any Xlib routines at all.  Shared memory pixmaps can
+only be supported when the X server can use regular virtual memory for
+pixmap data; if the pixmaps are stored in some magic graphics hardware, your
+application will not be able to share them with the server.  Xdpyinfo(1)
+doesn't print this particular nugget of information.
+</para>
+</sect1>
+
+<sect1 id="HOW_TO_USE_THE_SHARED_MEMORY_EXTENSION">
+<title>HOW TO USE THE SHARED MEMORY EXTENSION</title>
+<para>
+Code which uses the shared memory extension must include a number of header
+files:
+</para>
+
+<literallayout class="monospaced">
+#include &lt;X11/Xlib.h&gt;          /* of course */
+#include &lt;sys/ipc.h&gt;
+#include &lt;sys/shm.h&gt;
+#include &lt;X11/extensions/XShm.h&gt;
+</literallayout>
+
+<para>
+Of course, if the system you are building on does not support shared
+memory, the file XShm.h may not be present.  You may want to make
+liberal use of #ifdefs.
+</para>
+
+<para>
+Any code which uses the shared memory extension should first check to see
+that the server provides the extension.  You could always be running over
+the net, or in some other environment where the extension will not work.
+To perform this check, call either
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function>XShmQueryExtension</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+or
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function>XShmQueryVersion</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>int <parameter>*major</parameter></paramdef>
+    <paramdef>int <parameter>*minor</parameter></paramdef>
+    <paramdef>Bool <parameter>*pixmaps</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+Where "display" is, of course, the display on which you are running.  If
+the shared memory extension may be used, the return value from either
+function will be True; otherwise your program should operate using
+conventional Xlib calls.  When the extension is available,
+\fCXShmQueryVersion\fP also returns "major" and "minor" which are the
+version numbers of the extension implementation, and "pixmaps" which is
+True iff shared memory pixmaps are supported.
+</para>
+</sect1>
+
+<sect1 id="USE_OF_SHARED_MEMORY_XIMAGES">
+<title>USE OF SHARED MEMORY XIMAGES</title>
+<para>
+The basic sequence of operations for shared memory XImages is as follows:
+</para>
+
+<orderedlist>
+  <listitem>
+    <para>
+Create the shared memory XImage structure
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Create a shared memory segment to store the image data
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Inform the server about the shared memory segment
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Use the shared memory XImage, much like a normal one.
+    </para>
+  </listitem>
+</orderedlist>
+
+<para>
+To create a shared memory XImage, use:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>XImage <function>*XShmCreateImage</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Visual <parameter>*visual</parameter></paramdef>
+    <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+    <paramdef>int <parameter>format</parameter></paramdef>
+    <paramdef>char <parameter>*data</parameter></paramdef>
+    <paramdef>XShmSegmentInfo <parameter>*shminfo</parameter></paramdef>
+    <paramdef>unsigned int <parameter>width</parameter></paramdef>
+    <paramdef>unsigned int <parameter>height</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+Most of the arguments are the same as for XCreateImage; I will not go
+through them here.  Note, however, that there are no "offset", "bitmap_pad",
+or "bytes_per_line" arguments.  These quantities will be defined by the
+server itself, and your code needs to abide by them.  Unless you have already
+allocated the shared memory segment (see below), you should pass in NULL for
+the "data" pointer.
+</para>
+
+<para>
+There is one additional argument: "shminfo", which is a pointer to a
+structure of type XShmSegmentInfo.  You must allocate one of these
+structures such that it will have a lifetime at least as long as that of
+the shared memory XImage.  There is no need to initialize this structure
+before the call to XShmCreateImage.
+</para>
+
+<para>
+The return value, if all goes well, will be an XImage structure, which you
+can use for the subsequent steps.
+</para>
+
+<para>
+The next step is to create the shared memory segment.  This is
+best done after the creation of the XImage, since you need to make use of
+the information in that XImage to know how much memory to allocate.  To
+create the segment, you need a call like:
+</para>
+
+
+<literallayout class="monospaced">
+shminfo.shmid = shmget (IPC_PRIVATE,
+          image-&gt;bytes_per_line * image-&gt;height, IPC_CREAT|0777);
+</literallayout>
+
+<para>
+(assuming that you have called your shared memory XImage "image").  You
+should, of course, follow the Rules and do error checking on all of these
+system calls.  Also, be sure to use the bytes_per_line field, not the width
+you used to create the XImage as they may well be different.
+</para>
+
+<para>
+Note that the shared memory ID returned by the system is stored in the
+shminfo structure.  The server will need that ID to attach itself to the
+segment.
+</para>
+
+<para>
+Also note that, on many systems for security reasons, the X server
+will only accept to attach to the shared memory segment if it's
+readable and writeable by "other". On systems where the X server is
+able to determine the uid of the X client over a local transport, the
+shared memory segment can be readable and writeable only by the uid of
+the client.
+</para>
+
+<para>
+Next, attach this shared memory segment to your process:
+</para>
+
+<para>
+shminfo.shmaddr = image-&gt;data = shmat (shminfo.shmid, 0, 0);
+</para>
+
+<para>
+The address returned by shmat should be stored in *both* the XImage
+structure and the shminfo structure.
+</para>
+
+<para>
+To finish filling in the shminfo structure, you need to decide how you want
+the server to attach to the shared memory segment, and set the "readOnly"
+field as follows.  Normally, you would code:
+</para>
+<para>
+shminfo.readOnly = False;
+</para>
+
+<para>
+If you set it to True, the server will not be able to write to this
+segment, and thus XShmGetImage calls will fail.
+</para>
+
+<para>
+Finally, tell the server to attach to your shared memory segment with:
+</para>
+
+<literallayout class="monospaced">
+Status XShmAttach (display, shminfo);
+</literallayout>
+
+<para>
+If all goes well, you will get a non-zero status back, and your XImage is
+ready for use.
+</para>
+
+<para>
+To write a shared memory XImage into an X drawable, use XShmPutImage:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function>XShmPutImage </function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>d</parameter></paramdef>
+    <paramdef>GC <parameter>gc</parameter></paramdef>
+    <paramdef>XImage <parameter>*image</parameter></paramdef>
+    <paramdef>int <parameter>src_x</parameter></paramdef>
+    <paramdef>int <parameter>src_y</parameter></paramdef>
+    <paramdef>int <parameter>dest_x</parameter></paramdef>
+    <paramdef>int <parameter>dest_y</parameter></paramdef>
+    <paramdef>unsigned int <parameter>width</parameter></paramdef>
+    <paramdef>unsigned int <parameter>height</parameter></paramdef>
+    <paramdef>bool <parameter>send_event</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+The interface is identical to that of XPutImage, so I will spare my fingers
+and not repeat that documentation here.  There is one additional parameter,
+however, called "send_event".  If this parameter is passed as True, the
+server will generate a "completion" event when the image write is complete;
+thus your program can know when it is safe to begin manipulating the shared
+memory segment again.
+</para>
+
+<para>
+The completion event has type XShmCompletionEvent, which is defined as the
+following:
+</para>
+
+<literallayout class="monospaced">
+typedef struct {
+    int type;              /* of event */
+    unsigned long serial;  /* # of last request processed */
+    Bool send_event;       /* true if came from a SendEvent request */
+    Display *display;      /* Display the event was read from */
+    Drawable drawable;     /* drawable of request */
+    int major_code;        /* ShmReqCode */
+    int minor_code;        /* X_ShmPutImage */
+    ShmSeg shmseg;         /* the ShmSeg used in the request */
+    unsigned long offset;  /* the offset into ShmSeg used */
+} XShmCompletionEvent;
+</literallayout>
+
+<para>
+The event type value that will be used can be determined at run time with a
+line of the form:
+</para>
+
+<para>
+int CompletionType = XShmGetEventBase (display) + ShmCompletion;
+</para>
+
+<para>
+If you modify the shared memory segment before the arrival of the
+completion event, the results you see on the screen may be inconsistent.
+</para>
+
+<para>
+To read image data into a shared memory XImage, use the following:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function>XShmGetImage </function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>d</parameter></paramdef>
+    <paramdef>XImage <parameter>*image</parameter></paramdef>
+    <paramdef>int <parameter>x</parameter></paramdef>
+    <paramdef>int <parameter>y</parameter></paramdef>
+    <paramdef>unsigned long <parameter>plane_mask</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+Where "display" is the display of interest, "d" is the source drawable,
+"image" is the destination XImage, "x" and "y" are the offsets within
+"d", and "plane_mask" defines which planes are to be read.
+</para>
+
+<para>
+To destroy a shared memory XImage, you should first instruct the server to
+detach from it, then destroy the segment itself, as follows:
+</para>
+
+<literallayout class="monospaced">
+XShmDetach (display, shminfo);
+XDestroyImage (image);
+shmdt (shminfo.shmaddr);
+shmctl (shminfo.shmid, IPC_RMID, 0);
+</literallayout>
+
+</sect1>
+
+<sect1 id="USE_OF_SHARED_MEMORY_PIXMAPS">
+<title>USE OF SHARED MEMORY PIXMAPS</title>
+<para>
+Unlike X images, for which any image format is usable, the shared memory
+extension supports only a single format (i.e. XYPixmap or ZPixmap) for the
+data stored in a shared memory pixmap.  This format is independent of the
+depth of the image (for 1-bit pixmaps it doesn't really matter what this
+format is) and independent of the screen.  Use XShmPixmapFormat to get the
+format for the server:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>int <function>XShmPixmapFormat</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+If your application can deal with the server pixmap data format (including
+bits-per-pixel et al.), create a shared memory segment and "shminfo"
+structure in exactly the same way as is listed above for shared memory
+XImages.  While it is, not strictly necessary to create an XImage first,
+doing so incurs little overhead and will give you an appropriate
+bytes_per_line value to use.
+</para>
+
+<para>
+Once you have your shminfo structure filled in, simply call:
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Pixmap <function>XShmCreatePixmap</function></funcdef>
+    <paramdef>Display <parameter>*display</parameter></paramdef>
+    <paramdef>Drawable <parameter>d</parameter></paramdef>
+    <paramdef>char <parameter>*data</parameter></paramdef>
+    <paramdef>XShmSegmentInfo <parameter>*shminfo</parameter></paramdef>
+    <paramdef>unsigned int <parameter>width</parameter></paramdef>
+    <paramdef>unsigned int <parameter>height</parameter></paramdef>
+    <paramdef>unsigned int <parameter>depth</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<para>
+The arguments are all the same as for XCreatePixmap, with two additions:
+"data" and "shminfo".  The second of the two is the same old shminfo
+structure that has been used before.  The first is the pointer to the shared
+memory segment, and should be the same as the shminfo.shmaddr field.  I am
+not sure why this is a separate parameter.
+</para>
+
+<para>
+If everything works, you will get back a pixmap, which you can manipulate in
+all of the usual ways, with the added bonus of being able to tweak its
+contents directly through the shared memory segment.  Shared memory pixmaps
+are destroyed in the usual manner with XFreePixmap, though you should detach
+and destroy the shared memory segment itself as shown above.
+</para>
+</sect1>
+</chapter>
+</book>
diff --git a/specs/sync.xml b/specs/sync.xml
new file mode 100755 (executable)
index 0000000..a8064a9
--- /dev/null
@@ -0,0 +1,1062 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
+<!--translated from sync.tex, on 2010-06-29 10:52:00,
+by TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/) xhtml,docbook,html,refcaption -->
+
+
+<book id="sync">
+
+<bookinfo>
+   <title>X Synchronization Extention Protocol</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>X Version 11, Release 6.6.84</releaseinfo>
+   <authorgroup>
+     <author>
+       <firstname>Tim</firstname><surname>Glauert</surname>
+       <affiliation><orgname>Olivetti Research/MultiWorks</orgname></affiliation>
+     </author>
+     <othercredit>
+        <firstname>Dave</firstname>
+        <surname>Carver</surname>
+        <affiliation><orgname>Digital EquipmentCorporation, MIT/Project Athena</orgname></affiliation>
+     </othercredit>
+     <othercredit>
+       <firstname>Jim</firstname>
+       <surname>Gettys</surname>
+       <affiliation><orgname>Digital EquipmentCorporation, Cambridge Research Laboratory</orgname></affiliation>
+     </othercredit>
+     <othercredit>
+       <firstname>David</firstname>
+       <surname>Wiggins</surname>
+       <affiliation><orgname>X Consortium, Inc.</orgname></affiliation>
+     </othercredit>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+
+   <copyright>
+     <year>1991</year>
+       <holder>
+Olivetti Research Limited, Cambridge England and
+Digital Equipment Corporation, Maynard, Massachusetts
+       </holder>
+   </copyright>
+   <copyright><year>1991</year><holder>X Consortium</holder></copyright>
+
+   <releaseinfo>Version 3.0</releaseinfo>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+
+<legalnotice>
+<para>
+Permission to use, copy, modify, and distribute this documentation for any
+purpose and without fee is hereby granted, provided that the above
+copyright notice appear in all copies. Olivetti, Digital, MIT, and the
+X Consortium make no representations about the suitability for any purpose
+of the information in this document. This documentation is provided as
+is without express or implied warranty.
+</para>
+
+<para>
+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:
+</para>
+
+<para>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</para>
+
+<para>THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, 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.</para>
+
+<para>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.</para>
+</legalnotice>
+
+</bookinfo>
+
+<chapter id="synchronization_protocol">
+<title>Synchronization Protocol</title>
+<para>
+The core X protocol makes no guarantees about the relative order of execution
+of requests for different clients. This means that any synchronization between
+clients must be done at the client level in an operating system-dependent and
+network-dependent manner. Even if there was an accepted standard for such
+synchronization, the use of a network introduces unpredictable delays between
+the synchronization of the clients and the delivery of the resulting requests
+to the X server.
+</para>
+
+<para>
+The core X protocol also makes no guarantees about the time at which requests
+are executed, which means that all clients with real-time constraints must
+implement their timing on the host computer. Any such timings are subject to
+error introduced by delays within the operating system and network and are
+inefficient because of the need for round-trip requests that keep the client
+and server synchronized.
+</para>
+
+<para>
+The synchronization extension provides primitives that allow synchronization
+between clients to take place entirely within the X server. This removes any
+error introduced by the network and makes it possible to synchronize clients
+on different hosts running different operating systems. This is important for
+multimedia applications, where audio, video, and graphics data streams are
+being synchronized.  The extension also provides internal timers within the
+X server to which client requests can be synchronized. This allows simple
+animation applications to be implemented without any round-trip requests and
+makes best use of buffering within the client, network, and server.
+</para>
+
+<sect1 id="description">
+<title>Description</title>
+<para>
+The mechanism used by this extension for synchronization within the X
+server is to block the processing of requests from a client until a
+specific synchronization condition occurs. When the condition occurs, the
+client is released and processing of requests continues. Multiple clients
+may block on the same condition to give inter-client synchronization.
+Alternatively, a single client may block on a condition such as an animation
+frame marker.
+</para>
+
+<para>
+The extension adds <function>Counter</function> and
+<function>Alarm</function> to the set of resources managed by the
+server. A counter has a 64-bit integer value that may be increased or
+decreased by client requests or by the server internally. A client can block
+by sending an Await request that waits until one of a set of synchronization
+conditions, called TRIGGERs, becomes TRUE.
+</para>
+
+<para>
+The <function>CreateCounter</function> request allows a client to create a
+<function>Counter</function> that can be changed by explicit
+<function>SetCounter</function> and <function>ChangeCounter</function>
+requests. These can be used to implement synchronization between different
+clients.
+</para>
+
+<para>
+There are some counters, called <function>System Counters</function>, that
+are changed by the server internally rather than by client requests. The
+effect of any change to a system counter is not visible until the server
+has finished processing the current request. In other words, system
+counters are apparently updated in the gaps between the execution of
+requests rather than during the actual execution of a request. The extension
+provides a system counter that advances with the server time as defined by
+the core protocol, and it may also provide counters that advance with the
+real-world time or that change each time the CRT screen is refreshed.
+Other extensions may provide their own extension-specific system counters.
+</para>
+
+<para>
+The extension provides an <function>Alarm</function> mechanism that allows
+clients to receive an event on a regular basis when a particular counter
+is changed.
+</para>
+
+</sect1>
+<sect1 id="types">
+<title>Types</title>
+<para>
+Please refer to the X11 Protocol specification as this document uses
+syntactic conventions established there and references types defined there.
+</para>
+
+<para>The following new types are used by the extension.</para>
+
+<literallayout class="monospaced">
+INT64:                 64-bit signed integer
+COUNTER:               XID
+VALUETYPE:             {Absolute,Relative};
+TESTTYPE:              {PositiveTransition,NegativeTransition,
+                        PositiveComparison,NegativeComparison}
+TRIGGER:               [
+                        counter:COUNTER,
+                        value-type:VALUETYPE,
+                        wait-value:INT64,
+                        test-type:TESTTYPE
+                       ]
+WAITCONDITION:         [
+                        trigger:TRIGGER,
+                        event-threshold:INT64
+                       ]
+SYSTEMCOUNTER:         [
+                        name:STRING8,
+                        counter:COUNTER,
+                        resolution:INT64
+                       ]
+ALARM:                 XID
+ALARMSTATE:            {Active,Inactive,Destroyed}
+</literallayout>
+
+<para>
+The COUNTER type defines the client-side handle on a server
+<function>Counter</function>. The value of a counter is an INT64.
+</para>
+
+<para>
+The TRIGGER type defines a test on a counter that is either TRUE or FALSE. The
+value of the test is determined by the combination of a test value, the value
+of the counter, and the specified test-type.
+</para>
+
+<para>
+The test value for a trigger is calculated using the value-type and
+wait-value fields when the trigger is initialized. If the value-type field
+is not one of the named VALUETYPE constants, the request that initialized the
+trigger will return a <function>Value</function> error. If the value-type
+field is <function>Absolute</function>, the test value is given by the
+wait-value field. If the value-type field is <function>Relative</function>,
+the test value is obtained by adding the wait-value field to the value of the
+counter. If the resulting test value would lie outside the range for an
+INT64, the request that initialized the trigger will return a
+<function>Value</function> error. If counter is <function>None</function>
+and the value-type is <function>Relative</function>, the request that
+initialized the trigger will return a <function>Match</function> error. If
+counter is not None and does not name a valid counter, a Counter error is
+generated.
+</para>
+
+<para>
+If the test-type is <function>PositiveTransition</function>, the trigger is
+initialized to FALSE, and it will become TRUE when the counter changes from
+a value less than the test value to a value greater than or equal to the
+test value. If the test-type is <function>NegativeTransition</function>,
+the trigger is initialize to FALSE, and it will become TRUE when the counter
+changes from a value greater than the test value to a value less than or
+equal to the test value. If the test-type is
+<function>PositiveComparison</function>, the trigger is TRUE if the
+counter is greater than or equal to the test value and FALSE otherwise. If the
+test-type is <function>NegativeComparison</function>, the trigger is TRUE
+if the counter is less than or equal to the test value and FALSE otherwise.
+If the test-type is not one of the named TESTTYPE constants, the request that
+initialized the trigger will return a Value error. A trigger with a counter
+value of <function>None</function> and a valid test-type is always TRUE.
+</para>
+
+<para>
+The WAITCONDITION type is simply a trigger with an associated event-threshold.
+The event threshold is used by the <function>Await</function> request to
+decide whether or not to generate an event to the client after the trigger has
+become TRUE. By setting the event-threshold to an appropriate value, it is
+possible to detect the situation where an <function>Await</function> request
+was processed after the TRIGGER became TRUE, which usually indicates that
+the server is not processing requests as fast as the client expects.
+</para>
+
+<para>
+The SYSTEMCOUNTER type provides the client with information about a
+<function>System</function>Counter. The name field is the textual name of
+the counter that identifies the counter to the client. The counter field
+is the client-side handle that should be used in requests that require a
+counter. The resolution field gives the approximate step size of the system
+counter. This is a hint to the client
+that the extension may not be able to resolve two wait conditions with test
+values that differ by less than this step size. A microsecond clock, for
+example, may advance in steps of 64 microseconds, so a counter based on this
+clock would have a resolution of 64.
+</para>
+
+<para>
+The only system counter that is guaranteed to be present is called SERVERTIME,
+which counts milliseconds from some arbitrary starting point. The least
+significant 32 bits of this counter track the value of Time used by the
+server in Events and Requests. Other system counters may be provided by
+different implementations of the extension. The X Consortium will maintain a
+registry of system counter names to avoid collisions in the name space.
+</para>
+
+<para>
+An ALARM is the client-side handle on an <function>Alarm</function> resource.
+</para>
+</sect1>
+
+<sect1 id="errors">
+<title>Errors</title>
+
+<variablelist>
+  <varlistentry>
+    <term>Counter</term>
+    <listitem>
+      <para>
+This error is generated if the value for a COUNTER argument in a request
+does not name a defined COUNTER.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Alarm</term>
+    <listitem>
+      <para>
+This error is generated if the value for an ALARM argument in a request
+does not name a defined ALARM.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+<sect1 id="requests">
+
+<title>Requests</title>
+
+<variablelist>
+  <varlistentry>
+    <term>Initialize</term>
+    <listitem>
+<literallayout class="monospaced">
+version-major,version-minor: CARD8
+=>
+version-major,version-minor: CARD8
+</literallayout>
+
+     <para>
+This request must be executed before any other requests for this extension. If a
+client violates this rule, the results of all SYNC requests that it issues are
+undefined. The request takes the version number of the extension that the
+client wishes to use and returns the actual version number being implemented
+by the extension for this client. The extension may return different
+version numbers to a client depending of the version number supplied by
+that client. This request should be executed only once for each client
+connection.
+     </para>
+     <para>
+Given two different versions of the SYNC protocol, v1 and v2, v1 is
+compatible with v2 if and only if v1.version_major = v2.version_major
+and v1.version_minor &lt;= v2.version_minor.  Compatible means that the
+functionality is fully supported in an identical fashion in the two versions.
+     </para>
+     <para>
+This document describes major version 3, minor version 0 of the SYNC protocol.
+     </para>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>ListSystemCounters</term>
+    <listitem>
+<literallayout class="monospaced">
+=>
+system-counters: LISTofSYSTEMCOUNTER
+Errors: Alloc
+</literallayout>
+      <para>
+This request returns a list of all the system counters that are available at
+the time the request is executed, which includes the system counters
+that are maintained by other extensions. The list returned by this
+request may change as counters are created and destroyed by other extensions.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term>CreateCounter</term>
+  <listitem>
+<literallayout class="monospaced">
+id: COUNTER
+initial-value: INT64
+Errors: IDChoice,Alloc
+</literallayout>
+      <para>
+This request creates a counter and assigns the specified id to it. The counter
+value is initialized to the specified initial-value and there are no clients
+waiting on the counter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>DestroyCounter</term>
+    <listitem>
+<literallayout class="monospaced">
+counter: COUNTER
+Errors: Counter,Access
+</literallayout>
+      <para>
+This request destroys the given counter and sets the counter fields for all
+triggers that specify this counter to <function>None</function>. All clients
+waiting on the counter are released and a <function>CounterNotify</function>
+event with the destroyed field set to TRUE is sent to each waiting client,
+regardless of the event-threshold. All alarms specifying the counter become
+<function>Inactive</function> and an <function>AlarmNotify</function>
+event with a state field of <function>Inactive</function> is generated. A
+counter is destroyed automatically when the connection to the creating client
+is closed down if the close-down mode is Destroy. An
+<function>Access</function> error is generated if counter is a system
+counter. A <function>Counter</function> error is generated if counter does
+not name a valid counter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>QueryCounter</term>
+    <listitem>
+<literallayout class="monospaced">
+counter: COUNTER
+=>
+value: INT64
+Errors: <function>Counter</function>
+</literallayout>
+      <para>
+This request returns the current value of the given counter or a generates
+Counter error if counter does not name a valid counter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Await</term>
+    <listitem>
+<literallayout class="monospaced">
+wait-list: LISTofWAITCONDITION
+Errors: Counter,Alloc,Value
+</literallayout>
+      <para>
+When this request is executed, the triggers in the wait-list are initialized
+using the wait-value and value-type fields, as described in the definition of
+TRIGGER above. The processing of further requests for the client is blocked
+until one or more of the triggers becomes TRUE. This may happen immediately,
+as a result of the initialization, or at some later time, as a result of
+a subsequent <function>SetCounter</function>,
+<function>ChangeCounter</function> or
+<function>DestroyCounter</function> request.
+      </para>
+      <para>
+A Value error is generated if wait-list is empty.
+      </para>
+      <para>
+When the client becomes unblocked, each trigger is checked to determine
+whether a <function>CounterNotify</function> event should be generated.
+The difference between the counter and the test value is calculated by
+subtracting the test value from the value of the counter. If the test-type
+is <function>PositiveTransition</function> or
+<function>PositiveComparison</function>, a
+<function>CounterNotify</function> event is generated if the difference is
+at least event-threshold. If the test-type is
+<function>NegativeTransition</function> or
+<function>NegativeComparison</function>, a
+<function>CounterNotify</function> event is generated if the difference
+is at most event-threshold. If the difference lies outside the range for an
+INT64, an event is not generated.
+      </para>
+      <para>
+This threshold check is made for each trigger in the list and a
+<function>CounterNotify</function> event is generated for every trigger for
+which the check succeeds. The check for
+<function>CounterNotify</function> events is performed even if one of the
+triggers is TRUE when the request is first executed. Note that a
+<function>CounterNotify</function> event may be generated for a trigger
+that is FALSE if there are multiple triggers in the request. A
+<function>CounterNotify</function> event with the destroyed flag set to
+TRUE is always generated if the counter for one of the triggers is
+destroyed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>ChangeCounter</term>
+    <listitem>
+<literallayout class="monospaced">
+counter: COUNTER
+amount: INT64
+Errors: <function>Counter,Access,Value</function>
+</literallayout>
+      <para>
+This request changes the given counter by adding amount to the current
+counter value. If the change to this counter satisfies a trigger for which a client
+is waiting, that client is unblocked and one or more
+<function>CounterNotify</function> events may be generated. If the change to
+the counter satisfies the trigger for an alarm, an
+<function>AlarmNotify</function> event is generated and the
+alarm is updated. An <function>Access</function> error is generated if
+counter is a system counter. A <function>Counter</function> error is
+generated if counter does not name a valid counter. If the resulting value
+for the counter would be outside the range for an INT64, a
+<function>Value</function> error is generated and the counter is not changed.
+      </para>
+      <para>
+It should be noted that all the clients whose triggers are satisfied by this
+change are unblocked, so this request cannot be used to implement mutual
+exclusion.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>SetCounter</term>
+    <listitem>
+<literallayout class="monospaced">
+counter: COUNTER
+value: INT64
+Errors: <function>Counter,Access</function>
+</literallayout>
+      <para>
+This request sets the value of the given counter to value. The effect is
+equivalent to executing the appropriate ChangeCounter request to change
+the counter value to value. An Access error is generated if counter names a
+system counter. A Counter error is generated if counter does not name a valid
+counter.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>CreateAlarm</term>
+    <listitem>
+<literallayout class="monospaced">
+id: ALARM
+values-mask: CARD32
+values-list: LISTofVALUE
+left">Errors: IDChoice,Counter,Match,Value,Alloc
+</literallayout>
+      <para>
+This request creates an alarm and assigns the identifier id to it. The
+values-mask and values-list specify the attributes that are to be explicitly
+initialized. The attributes for an Alarm and their defaults are:
+      </para>
+      <informaltable>
+        <tgroup cols="4">
+          <colspec colname="c1"/>
+          <colspec colname="c2"/>
+          <colspec colname="c3"/>
+          <colspec colname="c4"/>
+          <tbody>
+            <row>
+              <entry align="left">Attribute</entry>
+              <entry align="left">Type</entry>
+              <entry align="left">Default</entry>
+            </row>
+            <row role="hline">
+              <entry rowsep="1"></entry>
+              <entry rowsep="1"></entry>
+              <entry rowsep="1"></entry>
+              <entry rowsep="1"></entry>
+            </row>
+            <row>
+              <entry align="left">trigger</entry>
+              <entry align="left">TRIGGER</entry>
+              <entry align="left">counter</entry>
+              <entry align="left">None</entry>
+            </row>
+            <row>
+              <entry align="left"></entry>
+              <entry align="left"></entry>
+              <entry align="left">value-type</entry>
+              <entry align="left">Absolute</entry>
+            </row>
+            <row>
+              <entry align="left"></entry>
+              <entry align="left"></entry>
+              <entry align="left">value</entry>
+              <entry align="left">0</entry>
+            </row>
+            <row>
+              <entry align="left"></entry>
+              <entry align="left"></entry>
+              <entry align="left">test-type</entry>
+              <entry align="left">PositiveComparison</entry>
+            </row>
+            <row>
+              <entry align="left">delta</entry>
+              <entry align="left">INT64</entry>
+              <entry align="left">1</entry>
+            </row>
+            <row>
+              <entry align="left">events</entry>
+              <entry align="left">BOOL</entry>
+              <entry align="left">TRUE</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </informaltable>
+      <para>
+The trigger is initialized as described in the definition of TRIGGER, with an
+error being generated if necessary.
+      </para>
+      <para>
+If the counter is <function>None</function>, the state of the alarm is set
+to <function>Inactive</function>, else it is set to Active.
+      </para>
+      <para>
+Whenever the trigger becomes TRUE, either as a result of this request or as the
+result of a <function>SetCounter</function>,
+<function>ChangeCounter</function>, <function>DestroyCounter</function>, or
+<function>ChangeAlarm</function> request, an
+<function>AlarmNotify</function> event is generated and the alarm is
+updated. The alarm is updated by repeatedly adding delta to the value of the
+trigger and reinitializing it until it becomes FALSE. If this update would
+cause value to fall outside the range for an INT64, or if the counter
+value is <function>None</function>, or if the delta is 0 and test-type
+is <function>PositiveComparison</function> or
+<function>NegativeComparison</function>, no change is made to value and
+the alarm state is changed to <function>Inactive</function> before the
+event is generated. No further events are generated by an
+<function>Inactive</function> alarm until a <function>ChangeAlarm</function>
+or <function>DestroyAlarm </function> request is executed.
+      </para>
+      <para>
+If the test-type is <function>PositiveComparison</function> or
+<function>PositiveTransition and</function> delta is less than zero, or
+if the test-type is <function>NegativeComparison</function> or
+<function>NegativeTransition</function> and delta is greater than zero,
+a <function>Match</function> error is generated.
+      </para>
+      <para>
+The events value enables or disables delivery of
+<function>AlarmNotify</function> events
+to the requesting client. The alarm keeps a separate event flag for
+each client so that other clients may select to receive events from this
+alarm.
+      </para>
+      <para>
+An <function>AlarmNotify</function> event is always generated at some time
+after the execution of a <function>CreateAlarm</function> request. This
+will happen immediately if the trigger is TRUE, or it will happen later
+when the trigger becomes TRUE or the Alarm is destroyed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>ChangeAlarm</term>
+    <listitem>
+<literallayout class="monospaced">
+id: ALARM
+values-mask: CARD32
+values-list: LISTofVALUE
+Errors: Alarm,Counter,Value,Match
+</literallayout>
+      <para>
+This request changes the parameters of an Alarm. All of the parameters
+specified for the <function>CreateAlarm</function> request may be changed
+using this request.  The trigger is reinitialized and an
+<function>AlarmNotify</function> event is generated if appropriate, as
+explained in the description of the <function>CreateAlarm</function> request.
+      </para>
+      <para>
+Changes to the events flag affect the event delivery to the requesting
+client only and may be used by a client to select or deselect event delivery
+from an alarm created by another client.
+      </para>
+      <para>
+The order in which attributes are verified and altered is server-dependent.
+If an error is generated, a subset of the attributes may have been altered.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>DestroyAlarm</term>
+    <listitem>
+<literallayout class="monospaced">
+alarm: ALARM
+Errors: Alarm
+</literallayout>
+      <para>
+This request destroys an alarm. An alarm is automatically destroyed when the
+creating client is closed down if the close-down mode is
+<function>Destroy</function>. When an alarm is destroyed, an
+<function>AlarmNotify</function> event is generated with a state value of
+<function>Destroyed</function>.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>QueryAlarm</term>
+    <listitem>
+<literallayout class="monospaced">
+alarm: ALARM
+=>
+trigger: TRIGGER
+delta: INT64
+events: ALARMEVENTMASK
+state: ALARMSTATE
+Errors: <function>Alarm</function>
+</literallayout>
+      <para>This request retrieves the current parameters for an Alarm.</para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>SetPriority</term>
+    <listitem>
+<literallayout class="monospaced">
+client-resource: XID
+priority: INT32
+Errors: <function>Match</function>
+</literallayout>
+      <para>
+This request changes the scheduling priority of the client that created
+client-resource. If client-resource is <function>None</function>, then
+the priority for the client making the request is changed. A
+<function>Match</function> error is generated if client-resource is not
+<function>None</function> and does not name an existing resource in the
+server. For any two priority values, A and B, A is higher priority if
+and only if A is greater than B.
+      </para>
+      <para>
+The priority of a client is set to 0 when the initial client connection is
+ made.
+      </para>
+      <para>
+The effect of different client priorities depends on the particular
+implementation of the extension, and in some cases it may have no effect at
+all. However, the intention is that higher priority clients will have
+their requests executed before those of lower priority clients.
+      </para>
+      <para>
+For most animation applications, it is desirable that animation clients be
+given priority over nonrealtime clients. This improves the smoothness of the
+animation on a loaded server. Because a server is free to implement very strict
+priorities, processing requests for the highest priority client to the
+exclusion of all others, it is important that a client that may potentially
+monopolize the whole server, such as an animation that produces continuous
+output as fast as it can with no rate control, is run at low rather than high
+priority.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>GetPriority</term>
+    <listitem>
+<literallayout class="monospaced">
+client-resource: XID
+=>
+priority: INT32
+Errors: <function>Match</function>
+</literallayout>
+      <para>
+This request returns the scheduling priority of the client that created
+client-resource. If client-resource is <function>None</function>, then the
+priority for the client making the request is returned. A
+<function>Match</function> error is generated if client-resource is
+not <function>None</function> and does not name an existing resource in the
+server.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</sect1>
+
+<sect1 id="events">
+<title>Events</title>
+
+<variablelist>
+  <varlistentry>
+    <term>CounterNotify</term>
+    <listitem>
+<literallayout class="monospaced">
+counter: COUNTER
+wait-value: INT64
+counter-value: INT64
+time: TIME
+count: CARD16
+destroyed: BOOL
+</literallayout>
+      <para>
+<function>CounterNotify</function> events may be generated when a client
+becomes unblocked after an <function>Await</function> request has been
+processed. The wait-value is the value being waited for, and counter-value
+is the actual value of the counter at the time the event was generated.
+The destroyed flag is TRUE if this request was generated as the result of
+the destruction of the counter and FALSE otherwise. The time is the server
+time at which the event was generated.
+      </para>
+      <para>
+When a client is unblocked, all the <function>CounterNotify</function>
+events for the Await request are generated contiguously. If count is 0,
+there are no more events to follow for this request. If count is n,
+there are at least n more events to follow.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>AlarmNotify</term>
+    <listitem>
+<literallayout class="monospaced">
+alarm: ALARM
+counter-value: INT64
+alarm-value: INT64
+state: ALARMSTATE
+time: TIME
+</literallayout>
+      <para>
+An <function>AlarmNotify</function> event is generated when an alarm is
+triggered. alarm-value is the test value of the trigger in the alarm when
+it was triggered, counter-value is the value of the counter that triggered
+the alarm, and time is the server time at which the event was generated.
+The state is the new state of the alarm. If state is
+<function>Inactive</function>, no more events will be generated by this
+alarm until a <function>ChangeAlarm</function> request is executed, the alarm
+is destroyed, or the counter for the alarm is destroyed.
+      </para>
+    </listitem>
+  </varlistentry>
+</variablelist>
+</sect1>
+</chapter>
+
+<chapter id="encoding">
+<title>Encoding</title>
+<para>
+Please refer to the X11 Protocol Encoding document as this section uses
+syntactic conventions established there and references types defined there.
+</para>
+<para>The name of this extension is "SYNC".</para>
+
+<sect1 id="encoding_new_types">
+<title>Encoding New Types</title>
+<para>
+The following new types are used by the extension.
+</para>
+
+<literallayout class="monospaced">
+ALARM: CARD32
+ALARMSTATE:
+       0         Active
+       1         Inactive
+       2         Destroyed
+COUNTER: CARD32
+INT64: 64-bit signed integer
+SYSTEMCOUNTER:
+       4         COUNTER                 counter
+       8         INT64                   resolution
+       2         n                       length of name in bytes
+       n         STRING8                 name
+       p                                 pad,p=pad(n+2)
+TESTTYPE:
+       0         PositiveTransition
+       1         NegativeTransition
+       2         PositiveComparison
+       3         NegativeComparison
+TRIGGER:
+       4         COUNTER                 counter
+       4         VALUETYPE               wait-type
+       8         INT64                   wait-value
+       4         TESTTYPE                test-type  VALUETYPE:
+       0         Absolute
+       1         Relative
+WAITCONDITION:
+       20        TRIGGER                 trigger
+       8         INT64                   event threshold
+</literallayout>
+
+<para>
+An INT64 is encoded in 8 bytes with the most significant 4 bytes
+first followed by the least significant 4 bytes. Within these 4-byte
+groups, the byte ordering determined during connection setup is used.
+</para>
+</sect1>
+
+<sect1 id="encoding_errors">
+<title>Encoding Errors</title>
+<literallayout class="monospaced">
+<function>Counter</function>
+        1    0            Error
+        1    Base + 0     code
+        2    CARD16       sequence number
+        4    CARD32       bad counter
+        2    CARD16       minor opcode
+        1    CARD8        major opcode
+        21                unused
+<function>Alarm</function>
+        1    0            Error
+        1    Base + 1     code
+        2    CARD16       sequence number
+        4    CARD32       bad alarm
+        2    CARD16       minor opcode
+        1    CARD8        major opcode
+        21                unused
+</literallayout>
+
+</sect1>
+
+<sect1 id="encoding_requests">
+<title>Encoding Requests</title>
+
+<literallayout class="monospaced">
+<function>Initialize</function>
+        1    CARD8        major opcode
+        1    0            minor opcode
+        2    2            request length
+        1    CARD8        major version
+        1    CARD8        minor version
+        2                 unused
+=>
+        1    1            Reply
+        1                 unused
+        2    CARD16       sequence number
+        4    0            reply length
+        1    CARD8        major version
+        1    CARD8        minor version
+        2                 unused
+        20                unused
+
+<function>ListSystemCounters</function>
+        1    CARD8                  major opcode
+        1    1                      minor opcode
+        2    1                      request length
+=>
+        1    1                      Reply
+        1                           unused
+        2    CARD16                 sequence number
+        4    0                      reply length
+        4    INT32                  list length
+        20                          unused
+        4n   list of SYSTEMCOUNTER  system counters
+
+<function>CreateCounter</function>
+        1    CARD8                  major opcode
+        1    2                      minor opcode
+        2    4                      request length
+        4    COUNTER                id
+        8    INT64                  initial value
+
+<function>DestroyCounter</function>
+        1    CARD8                  major opcode
+        1    6                      minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode</para></footnote>
+        2    2                      request length
+        4    COUNTER                counter
+=>
+        1    1                      Reply
+        1                           unused
+        2    CARD16                 sequence number
+        4    0                      reply length
+        8    INT64                  counter value
+        16                          unused
+
+Await
+        1    CARD8                  major opcode
+        1    7                      minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode.</para></footnote>
+        2    1 + 7*n                request length
+        28n  LISTofWAITCONDITION    wait conditions
+
+ChangeCounter
+        1    CARD8                  major opcode
+        1    4                      minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode.</para></footnote>
+        2    4                      request length
+        4    COUNTER                counter
+        8    INT64                  amount
+
+SetCounter
+        1    CARD8                  major opcode
+        1    3                      minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode.</para></footnote>
+        2    4                      request length
+        4    COUNTER                counter
+        8    INT64                  value
+
+CreateAlarm
+        1    CARD8                  major opcode
+        1    8                      minor opcode
+        2    3+n                    request length
+        4    ALARM                  id
+        4    BITMASK                values mask
+
+             #x00000001             counter
+             #x00000002             value-type
+             #x00000004             value
+             #x00000008             test-type
+             #x00000010             delta
+             #x00000020             events
+
+        4n   LISTofVALUE            values
+
+VALUES
+        4    COUNTER                counter
+        4    VALUETYPE              value-type
+        8    INT64                  value
+        4    TESTTYPE               test-type
+        8    INT64                  delta
+        4    BOOL                   events
+
+ChangeAlarm
+        1    CARD8                  major opcode
+        1    9                      minor opcode
+        2    3+n                    request length
+        4    ALARM                  id
+        4    BITMASK                values mask
+             encodings as for <function>CreateAlarm</function>
+        4n   LISTofVALUE            values
+             encodings as for <function>CreateAlarm</function>
+
+DestroyAlarm
+        1    CARD8        major opcode
+        1    11           minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode.</para></footnote>
+        2    2            request length
+        4    ALARM        alarm
+
+QueryAlarm
+        1    CARD8        major opcode
+        1    10           minor opcode<footnote><para>A previous version of this document gave an incorrect minor opcode.</para></footnote>
+        2    2            request length
+        4    ALARM        alarm
+=>
+        1    1            Reply
+        1                 unused
+        2    CARD16       sequence number
+        4    2            reply length
+        20   TRIGGER      trigger
+        8    INT64        delta
+        1    BOOL         events
+        1    ALARMSTATE   state
+        2                 unused
+
+SetPriority
+        1    CARD8        major opcode
+        1    12           minor opcode
+        2    3            request length
+        4    CARD32       id
+        4    INT32        priority
+
+GetPriority
+        1    CARD8        major opcode
+        1    13           minor opcode
+        2    1            request length
+        4    CARD32       id
+=>
+        1    1            Reply
+        1                 unused
+        2    CARD16       sequence number
+        4    0            reply length
+        4    INT32        priority
+        20                unused
+
+</literallayout>
+
+</sect1>
+
+<sect1 id="encoding_events">
+<title>Encoding Events</title>
+
+<literallayout class="monospaced">
+<function>CounterNotify</function>
+        1    Base + 0     code
+        1    0            kind
+        2    CARD16       sequence number
+        4    COUNTER      counter
+        8    INT64        wait value
+        8    INT64        counter value
+        4    TIME         timestamp
+        2    CARD16       count
+        1    BOOL         destroyed
+        1                 unused
+
+<function>AlarmNotify</function>
+        1    Base + 1     code
+        1    1            kind
+        2    CARD16       sequence number
+        4    ALARM        alarm
+        8    INT64        counter value
+        8    INT64        alarm value
+        4    TIME         timestamp
+        1    ALARMSTATE   state
+        3                 unused
+</literallayout>
+</sect1>
+</chapter>
+</book>
diff --git a/specs/tog-cup.xml b/specs/tog-cup.xml
new file mode 100755 (executable)
index 0000000..08bb19b
--- /dev/null
@@ -0,0 +1,562 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+
+<book id="tog-cup">
+
+<bookinfo>
+   <title>Colormap Utilization Policy and Extension</title>
+   <subtitle>X Project Team Standard</subtitle>
+   <releaseinfo>Version 1.0</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Kaleb</firstname>
+         <othername>S.</othername>
+         <surname>Keithley</surname>
+         <affiliation><orgname>The Open Group</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <corpname>X Consortium Standard</corpname>
+   <copyright><year>1986-1997</year><holder>The Open Group</holder></copyright>
+   <affiliation><orgname>X Consortium</orgname></affiliation>
+   <productnumber>X Version 11, Release 6.8</productnumber>
+
+<legalnotice>
+
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this
+software and associated documentation files (the Software), to use the
+Software
+without restriction, including, without limitation, the rights to copy,
+modify, merge,
+publish, distribute and sublicense the Software, to make, have made,
+license and
+distribute derivative works thereof, and to permit persons to whom the
+Software is
+furnished to do so, subject to the following conditions:
+</para>
+<para>
+The above copyright notice and the following permission notice shall be
+included in all copies of the Software:
+</para>
+<para>
+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 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
+CONNNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN
+THE SOFTWARE.
+</para>
+<para>
+Except as contained in this notice, the name of The Open Group shall not be
+used in
+advertising or otherwise to promote the use or other dealings in this
+Software without prior written authorization from The Open Group.
+</para>
+<para>
+X Window System is a trademark of The Open Group.
+</para>
+
+</legalnotice>
+</bookinfo>
+
+<chapter>
+<title>TITLE</title>
+<sect1 id="Overview">
+<title>Overview</title>
+<para>
+This extension has three purposes: a) to provide mechanism for a special
+application (a colormap manager) to discover any special colormap
+requirements, e.g. the colormap entries that are nominally reserved for
+desktop colors in the MS-Windows environment and initialize the default
+colormap so that it can be more easily shared; and b) to encourage colormap
+sharing and reduce colormap flashing on low-end 8-bit frame buffers by
+providing a policy for sharing; and c) when colormaps aren't shared,
+define a behavior in the X server color allocation scheme to reduce
+colormap flashing.
+</para>
+
+<para>
+To encourage colormap sharing and accomodate special colormap requirements
+two new protocols are defined: the first provides a way to query the
+server for a list of reserved colormap entries, and the second is a way
+to initialize read-only (shareable) colormap entries at specific locations
+in a colormap.
+</para>
+
+<para>
+To minimize colormap flashing when the root window's default visual is one
+of GrayScale, PseudoColor, or DirectColor, and a private colormap for the
+default visual is being used, a minor (but compatible) change to the
+server implementation of the AllocColor and AllocNamedColor requests is
+required. Where the core protocol says nothing about the pixel values
+returned, when this extension is in effect, the AllocColor and AllocNamedColor
+requests will first look for a matching color in the default colormap, and,
+if a match is found and the same cell in the private colormap has not
+already been allocated, the color will be allocated in the private colormap
+at the same locaton as in the default colormap (instead of in the first
+available location.)
+</para>
+</sect1>
+
+<sect1 id="Requests">
+<title>Requests</title>
+<para>
+<function>QueryVersion</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+client_major_version: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+client_minor_version: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+server_major_version: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+server_minor_version: CARD16
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If supplied, the client_major_version and client_minor_version indicate
+what version of the protocol the client wants the server to implement.
+The server version numbers returned indicate the protocol this extension
+actually supports. This might not equal the version sent by the client.
+An implementation can (but need not) support more than one version
+simultaneously. The server_major_version and the server_minor_version
+are a mechanism to support future revisions of the TOG-CUP protocol that
+may be necessary. In general, the major version would increment for
+incompatible changes, and the minor version would increment for small
+upward-compatible changes. Servers that support the protocol defined in
+this document will return a server_major_version of one (1), and a
+server_minor_version of zero (0).
+</para>
+
+<para>
+<function>GetReservedColormapEntries</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+screen: CARD32
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+entries: LISTofCOLORITEM
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request returns a list of colormap entries (pixels) that are reserved
+by the system, e.g. MS-Windows reserved desktop colors. This list will, at a
+minimum, contain entries for the BlackPixel and WhitePixel of the specified
+screen. The do-red, do-green, and do-blue elements of the COLORITEMs are
+unused in this reply.
+</para>
+
+<para>
+Rationale: There are colormap entries (pixels) that, e.g., MS-Windows
+desktop reserves as desktop colors, that should not be altered. If they
+are altered then X programs will cause colormap flashing between X and
+MS-Windows applications running/displaying on the same desktop.
+</para>
+
+<para>
+<function>StoreColors</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+cmap: COLORMAP
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+items: LISTofCOLORITEM
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+items: LISTofCOLORITEM
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request changes the colormap entries of the specified pixels. The
+colormap entries are allocated as if by an AllocColor request. The do-red,
+do-green, and do-blue elements of the COLORITEMs are unused in this request.
+A boolean alloc-ok element (a bit) is returned indicating whether the
+particular pixel was successfully allocated or not. If successfully
+allocated the RGB and pixel are returned.
+</para>
+
+<para>
+A Value error is generated if a pixel is not a valid index into cmap. A
+BadMatch error is generated if if cmap does not belong to a GrayScale,
+PseudoColor, or DirectColor visual.
+</para>
+
+</sect1>
+
+<sect1 id="Events_and_Errors">
+<title>Events and Errors</title>
+<para>
+No new events or errors are defined by this extension.
+</para>
+
+</sect1>
+<sect1 id="Changes_to_existing_protocol_">
+<title>Changes to existing protocol.</title>
+<para>
+None.
+</para>
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+<para>
+The name of this extension is "TOG-CUP".
+</para>
+
+<para>
+The conventions used here are the same as those for the core X11
+Protocol Encoding.
+</para>
+
+<literallayout class="monospaced">
+<function>QueryVersion</function>
+     1     CARD8               opcode
+     1     0                   TOG-CUP opcode
+     2     2                   request length
+     2     CARD16              client_major_version
+     2     CARD16              client_minor_version
+=&gt;
+     1     1                   reply
+     1                         unused
+     2     CARD16              sequence number
+     4     0                   length
+     2     CARD16              server_major_version
+     2     CARD16              server_minor_number
+     20                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>GetReservedColormapEntries</function>
+     1     CARD8               opcode
+     1     1                   TOG-CUP opcode
+     2     2                   request length
+     4     CARD32              screen
+=&gt;
+     1     1                   reply
+     1                         unused
+     2     CARD16              sequence number
+     4     3n                  length
+     24                        unused
+     12n   LISTofCOLORITEM     items
+</literallayout>
+
+<literallayout class="monospaced">
+<function>StoreColors</function>
+     1     CARD8               opcode
+     1     2                   TOG-CUP opcode
+     2     2+3n                request length
+     4     COLORMAP            cmap
+     12n   LISTofCOLORITEM     items
+=&gt;
+     1     1                   reply
+     1                         unused
+     2     CARD16              sequence number
+     4     3n                  length
+     24                        unused
+     12n   LISTofCOLORITEM     items
+</literallayout>
+
+<para>
+(The definition of COLORITEM here is only for the purpose of defining the
+additional alloc-ok member in the CUPStoreColors reply.)
+</para>
+
+<literallayout class="monospaced">
+  COLORITEM
+     4     CARD32              pixel
+     2     CARD16              red
+     2     CARD16              green
+     2     CARD16              blue
+     1                         alloc-ok
+           #x07                unused
+           #x08                alloc-ok (1 is True, 0 is False)
+           #xF0                unused
+     1                         unused
+</literallayout>
+</sect1>
+
+<sect1 id="C_Language_Binding">
+<title>C Language Binding</title>
+
+<para>
+The C functions provide direct access to the protocol and add no additional
+semantics.  For complete details on the effects of these functions, refer
+to the appropriate protocol request, which can be derived by deleting XCup
+at the start of the function. All functions that have return type Status
+will return nonzero for success and zero for failure.
+</para>
+
+<para>
+The include file for this extension is
+<function>&lt;X11/extensions/Xcup.h&gt;</function>.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function> XCupQueryVersion</function></funcdef>
+  <paramdef>Display*<parameter> display</parameter></paramdef>
+  <paramdef>int*<parameter> major_version_return</parameter></paramdef>
+  <paramdef>int*<parameter> minor_version_return</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>major_version_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the major version supported by the server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>minor_version_return</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the minor version supported by the server.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+
+<para>
+XCupQueryVersions sets major_version_return and minor_version_return to
+the major and minor TOG-CUP protocol version supported by the server.  If
+the TOG-CUP library is compatible with the version returned by the server,
+it returns nonzero.  If dpy does not support the TOG-CUP extension, or if
+there was an error during communication with the server, or if the server
+and library protocol versions are incompatible, it returns zero.  No other
+XCup functions may be called before this function. If a client violates
+this rule, the effects of all subsequent XCup calls that it makes are
+undefined.
+</para>
+
+<para>
+To get the list of reserved colormap entries, use
+XCupGetReservedColormapEntries.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function> XCupGetReservedColormapEntries</function></funcdef>
+  <paramdef>Display*<parameter> display</parameter></paramdef>
+  <paramdef>int<parameter> screen</parameter></paramdef>
+  <paramdef>XColor**<parameter> colors_out</parameter></paramdef>
+  <paramdef>int*<parameter> ncolors</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the values reserved by the server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Returns the number of items in colors_out.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The XCupGetReservedColormapEntries function gets system specific colormap
+entries. E.g. the MS-Windows desktop uses N colormap entries at the beginning
+(0..N) and end (256-N..255) of the colormap. Use XFree to free colors_out.
+</para>
+
+<para>
+To allocate one or more read-only color cells with RGB values, use
+XCupStoreColors.
+</para>
+
+<funcsynopsis>
+<funcprototype>
+  <funcdef>Status <function> XCupStoreColors</function></funcdef>
+  <paramdef>Display*<parameter> display</parameter></paramdef>
+  <paramdef>Colormap<parameter> colormap</parameter></paramdef>
+  <paramdef>XColor*<parameter> colors_in_out</parameter></paramdef>
+  <paramdef>int<parameter> ncolors</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>display</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the connection to the X server.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colormap</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the colormap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>colors_in_out</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies and returns the values actually used in the colormap.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>ncolors</emphasis>
+    </term>
+    <listitem>
+      <para>
+Specifies the number of items in colors_in_out.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+The XCupStoreColors function changes the colormap entries of the pixel
+values specified in the pixel members of the XColor structures. The colormap
+entries are allocated as if an AllocColor had been used instead, i.e. the
+colors are read-only (shareable). XCupStoreColors returns the number of
+colors that were successfully allocated in the colormap.
+</para>
+
+</sect1>
+
+<sect1 id="Using_the_TOG_CUP_extension_and_Colormap_Utilization_Policy">
+<title>Using the TOG-CUP extension and Colormap Utilization Policy</title>
+<para>
+The X server preallocates any hardware or desktop special colors in the
+default colormap; e.g. UNIX X servers preallocate Black and White pixels.
+PC X servers should also preallocate the MS-Windows desktop colors. (Note
+to implementors: in the Sample Implementation special colors are allocated
+in the default colormap in cfbCreateDefColormap for dumb memory framebuffers.)
+</para>
+
+<para>
+To minimize colormap flash an application which installs its own private
+colormap should query the special colors by calling
+XCupGetReservedColormapEntries, and can then store those entries (in the
+proper location) in its private colormap using XCupStoreColors.
+</para>
+
+<para>
+Applications which allocate many colors in a screen's default colormap, e.g.
+a color-cube or a gray-ramp, should allocate them with XCupStoreColors. By
+using XCupStoreColors the colors will be allocated sharable (read-only) and
+any other application which allocates the same color will share that color
+cell.
+</para>
+</sect1>
+</chapter>
+</book>
diff --git a/specs/xtest.xml b/specs/xtest.xml
new file mode 100755 (executable)
index 0000000..6da29f1
--- /dev/null
@@ -0,0 +1,722 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<book id="xtest">
+
+<bookinfo>
+   <title>XTEST Extension Protocol</title>
+   <subtitle>X Consortium Standard</subtitle>
+   <releaseinfo>Version 2.2</releaseinfo>
+   <authorgroup>
+      <author>
+         <firstname>Kieron</firstname><surname>Drake</surname>
+         <affiliation><orgname>UniSoft Ltd.</orgname></affiliation>
+      </author>
+   </authorgroup>
+   <copyright><year>1992</year><holder>UniSoft Group Ltd.</holder></copyright>
+   <copyright><year>1992,1994</year><holder>X Consortium</holder></copyright>
+
+<legalnotice>
+<para>
+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.  UniSoft makes no
+representations about the suitability for any purpose of the information in
+this document.  This documentation is provided "as is" without express or
+implied warranty.
+</para>
+
+<para>
+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:
+</para>
+
+<para>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</para>
+
+<para>
+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.
+</para>
+
+<para>
+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.
+</para>
+</legalnotice>
+</bookinfo>
+
+
+<chapter>
+<title>TITLE</title>
+
+<sect1 id="Overview">
+<title>Overview</title>
+<para>
+This extension is a minimal set of client and server extensions
+required to completely test the X11 server with no user intervention.
+</para>
+
+<para>
+This extension is not intended to support general journaling and
+playback of user actions.  This is a difficult area [XTrap, 89] as it attempts
+to synchronize synthetic user interactions with their effects; it is at the
+higher level of dialogue recording/playback rather than at the strictly lexical
+level.  We are interested only in the latter, simpler, case.  A more detailed
+discussion and justification of the extension functionality is given in
+[Drake, 91].
+</para>
+
+<para>
+We are aiming only to provide a minimum set of facilities that
+solve immediate testing and validation problems.  The testing extension
+itself needs testing, where possible, and so should be as simple as possible.
+</para>
+
+<para>
+We have also tried to:
+</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+Confine the extension to an appropriate high level within the server
+to minimize portability problems.  In practice this means that the extension
+should be at the DIX level or use the DIX/DDX interface, or both.  This
+has effects, in particular, on the level at which "input synthesis"
+can occur.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Minimize the changes required in the rest of the server.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+Minimize performance penalties on normal server operation.
+    </para>
+  </listitem>
+</itemizedlist>
+</sect1>
+
+<sect1 id="Description">
+<title>Description</title>
+<para>
+The functions provided by this extension fall into two groups:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>Client Operations</term>
+    <listitem>
+      <para>
+These routines manipulate otherwise hidden client-side behavior.  The
+actual implementation will depend on the details of the actual language
+binding and what degree of request buffering, GContext caching, and so on, is
+provided.
+In the C binding, defined in "XTEST Extension Library", routines are
+provided to access the internals of two opaque data structures
+-- <function>GC</function>s
+and
+<function>Visual</function>s --
+and to discard any requests pending within the
+output buffer of a connection.  The exact details can be expected to differ for
+other language bindings.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>Server Requests</term>
+    <listitem>
+      <para>
+The first of these requests is similar to that provided in most
+extensions: it allows a client to specify a major and minor version
+number to the server and for the server to respond with major and minor
+versions of its own.  The remaining two requests allow the following:
+<!-- .RS -->
+      </para>
+      <itemizedlist>
+        <listitem>
+          <para>
+Access to an otherwise "write-only" server resource: the cursor
+associated with a given window
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+Perhaps most importantly, limited synthesis of input device events,
+almost as if a cooperative user had moved the pointing device
+or pressed a key or button.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+  </varlistentry>
+</variablelist>
+
+</sect1>
+
+<sect1 id="Types">
+<title>Types</title>
+<para>
+The following types are used in the request and event definitions in
+subsequent sections:
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='2' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <colspec colname='c2' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry namest="c1" nameend="c2">
+FAKE_EVENT_TYPE
+{ <function>KeyPress</function>,
+<function>KeyRelease</function>,
+<function>MotionNotify</function>,
+<function>ButtonPress</function>,
+<function>ButtonRelease</function> }
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry></entry>
+    </row>
+    <row>
+      <entry>FAKE_EVENT</entry>
+      <entry>[type: FAKE_EVENT_TYPE,</entry>
+    </row>
+    <row rowsep="0">
+      <entry></entry>
+      <entry>detail: BYTE,</entry>
+    </row>
+    <row rowsep="0">
+      <entry></entry>
+      <entry>time: TIME,</entry>
+    </row>
+    <row rowsep="0">
+      <entry></entry>
+      <entry>root: WINDOW,</entry>
+    </row>
+    <row rowsep="0">
+      <entry></entry>
+      <entry>rootX, rootY: INT16]</entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+CURSOR { <function>CurrentCursor</function>, <function> None</function> }
+or a cursor as defined by the X11 Protocol.
+</para>
+
+</sect1>
+
+<sect1 id="Client_Operations">
+<title>Client Operations</title>
+
+<para>
+These are abstract definitions of functionality.  They refer to client-side
+objects such as "GC" and "VISUAL" that are quoted to
+denote their abstract nature.  Concrete versions of these functions are
+defined only for particular language bindings.  In some circumstances
+a particular language binding may not implement the relevant abstract
+type or may provide it as a transparent, rather than opaque, type, with
+the result that the corresponding function does not make sense or is
+not required, respectively.
+</para>
+
+<para>
+<function>XTestSetGContextOfGC</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>gc</emphasis>: "GC"
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>gid</emphasis>: GCONTEXT
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Sets the GCONTEXT within the "GC" gc to have
+the value specified by gid.
+</para>
+
+<para>
+<function>XTestSetVisualIDOfVisual</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>visual</emphasis>: "VISUAL"
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>visualid</emphasis>: VISUALID
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Sets the VISUALID within the "VISUAL" visual to have
+the value specified by visualid.
+</para>
+
+<para>
+<function>XTestDiscard</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>dpy</emphasis>: "CONNECTION"
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+status: BOOL
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+Discards any requests that are present in the request buffer associated with
+the "CONNECTION" dpy.
+The status returned is
+<function>True</function>
+if there were one or more requests
+in the buffer and
+<function>False</function>
+otherwise.
+</para>
+</sect1>
+
+<sect1 id="Server_Requests">
+<title>Server Requests</title>
+<para>
+<function>XTestGetVersion</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>clientMajorVersion</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>clientMinorVersion</emphasis>: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+   =&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+serverMajorVersion: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+serverMinorVersion: CARD16
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors: <function>Length</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+
+<para>
+This request can be used to ensure that the server version of the XTEST
+extension is usable by the client.  This document defines major version two
+(2), minor version one (1).
+</para>
+
+<para>
+<function>XTestCompareCursor</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>window</emphasis>: WINDOW
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>cursor-id</emphasis>: CURSOR or
+<function>CurrentCursor</function>
+or
+<function>None</function>
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+=&gt;
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+same: BOOL
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Length</function>,
+<function>Cursor</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request looks up the cursor associated with the window and
+compares it with either the null cursor if cursor-id is
+<function>None ,</function>
+or the current cursor (that is, the one being displayed),
+or the cursor whose ID is cursor-id, and returns
+the result of the comparison in same.
+</para>
+
+<para>
+<function>XTestFakeInput</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>events</emphasis>: LISTofFAKE_EVENT
+      </entry>
+    </row>
+    <row rowsep="0">
+      <entry>
+Errors:
+<function>Window</function>,
+<function>Length</function>,
+<function>Alloc</function>,
+<function>Value</function>
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+This request simulates the limited set of core protocol
+events within the set FAKE_EVENT_TYPE.  Only the following event fields,
+defined in FAKE_EVENT, are interpreted:
+</para>
+
+<variablelist>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>type</emphasis>
+    </term>
+    <listitem>
+      <para>
+This must be one of
+<function>KeyPress</function>,
+<function>KeyRelease</function>,
+<function>MotionNotify</function>,
+<function>ButtonPress</function>,
+or
+<function>ButtonRelease</function>,
+or else a
+<function>Value</function>
+error occurs.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>detail</emphasis>
+    </term>
+    <listitem>
+      <para>
+For key events, this field is interpreted as the physical keycode.
+If the keycode is less than min-keycode or greater than max-keycode,
+as returned in the connection setup, then a
+<function>Value</function>
+error occurs.
+For button events, this field is interpreted as the physical (or core) button,
+meaning it will be mapped to the corresponding logical button according to
+the most recent
+<function>SetPointerMapping</function>
+request.
+If the button number is less than one or greater than the number of physical
+buttons, then a
+<function>Value</function>
+error occurs.
+For motion events, if this field is
+<function>True ,</function>
+then rootX and rootY
+are relative distances from the current pointer location; if this field is
+<function>False,</function>
+then they are absolute positions.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>time</emphasis>
+    </term>
+    <listitem>
+      <para>
+This is either
+<function>CurrentTime</function>
+(meaning no delay)
+or the delay in milliseconds that the server should wait before
+simulating this event.  No other requests from this client will be
+processed until this delay, if any, has expired and subsequent processing
+of the simulated event has been completed.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>root</emphasis>
+    </term>
+    <listitem>
+      <para>
+In the case of motion events this field is the ID of the root window on
+which the new motion is to take place.  If
+<function>None</function>
+is specified, the root window of the screen the pointer is currently on
+is used instead.
+If this field is not a valid window, then a
+<function>Window</function>
+error occurs.
+      </para>
+    </listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>
+      <emphasis remap='I'>rootX</emphasis> &amp;
+      <emphasis remap='I'>rootY</emphasis>
+    </term>
+    <listitem>
+      <para>
+In the case of motion events these fields indicate relative distance or
+absolute pointer coordinates, according to the setting of detail.
+If the specified coordinates are off-screen, the closest on-screen
+coordinates will be substituted.
+    </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>
+When the simulated event(s) are processed, they cause event propagation,
+passive grab activation, and so on, just as if the corresponding input device
+action had occurred.  However, motion events might not be recorded in the
+motion history buffer.
+</para>
+
+<para>
+For the currently supported event types, the event list must have length one,
+otherwise a
+<function>BadLength</function>
+error occurs.
+</para>
+
+<para>
+<function>XTestGrabControl</function>
+</para>
+
+<informaltable frame="none">
+  <tgroup cols='1' align='left'>
+  <colspec colname='c1' colsep="0" colwidth="1*"/>
+  <tbody>
+    <row rowsep="0">
+      <entry>
+<emphasis remap='I'>impervious</emphasis>: BOOL
+      </entry>
+    </row>
+  </tbody>
+  </tgroup>
+</informaltable>
+
+<para>
+If impervious is
+<function>True</function>,
+then the executing client becomes impervious to server grabs;
+that is, it can continue executing requests even if another client
+grabs the server.
+If impervious is
+<function>False</function>,
+then the executing client returns to the normal state of being
+susceptible to server grabs.
+</para>
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+<para>
+Please refer to the X11 Protocol Encoding document as this document uses
+conventions established there.
+</para>
+
+<para>
+The name of this extension is "XTEST".
+</para>
+
+<sect2 id="New_Types">
+<title>New Types</title>
+<literallayout class="monospaced">
+FAKE_EVENT_TYPE
+     2     KeyPress
+     3     KeyRelease
+     4     ButtonPress
+     5     ButtonRelease
+     6     MotionNotify
+</literallayout>
+
+<para>
+NOTE that the above values are defined to be the same as those for
+the corresponding core protocol event types.
+</para>
+</sect2>
+
+<sect2 id="Requests">
+<title>Requests</title>
+
+<literallayout class="monospaced">
+<function>XTestGetVersion</function>
+     1     CARD8               opcode
+     1     0                   xtest opcode
+     2     2                   request length
+     1     CARD8               client major version
+     1                         unused
+     2     CARD16              client minor version
+=&gt;
+     1     1                   Reply
+     1     CARD8               server major version
+     2     CARD16              sequence number
+     4     0                   reply length
+     2     CARD16              server minor version
+     22                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>XTestCompareCursor</function>
+     1     CARD8               opcode
+     1     1                   xtest opcode
+     2     3                   request length
+     4     WINDOW              window
+     4     CURSOR              cursor-id
+           0     None
+           1     CurrentCursor
+=&gt;
+     1     1                   Reply
+     1     BOOL                cursors are the same
+     2     CARD16              sequence number
+     4     0                   reply length
+     24                        unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>XTestFakeInput</function>
+     1     CARD8               opcode
+     1     2                   xtest opcode
+     2     1+(1*8)             request length
+     1     FAKE_EVENT_TYPE     fake device event type
+     1     BYTE                detail: button or keycode
+     2                         unused
+     4     TIME                delay (milliseconds)
+           0     CurrentTime
+     4     WINDOW              root window for MotionNotify
+           0     None
+     8                         unused
+     2     INT16               x position for MotionNotify
+     2     INT16               y position for MotionNotify
+     8                         unused
+</literallayout>
+
+<literallayout class="monospaced">
+<function>XTestGrabControl</function>
+     1     CARD8               opcode
+     1     3                   xtest opcode
+     2     2                   request length
+     1     BOOL                impervious
+     3                         unused
+</literallayout>
+</sect2>
+</sect1>
+
+<sect1 id="References">
+<title>References</title>
+<para>
+Annicchiarico, D., et al.,
+<emphasis remap='I'>XTrap: The XTrap Architecture</emphasis>.
+Digital Equipment Corporation, July 1991.
+</para>
+
+<para>
+Drake, K. J.,
+<emphasis remap='I'>Some Proposals for a
+Minimum X11 Testing Extension</emphasis>.
+UniSoft Ltd., June 1991.
+</para>
+</sect1>
+</chapter>
+</book>
diff --git a/syncconst.h b/syncconst.h
new file mode 100755 (executable)
index 0000000..3acc387
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+
+Copyright 1991, 1993, 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.
+
+*/
+
+/***********************************************************
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+                        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 names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY 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 _SYNCCONST_H_
+#define _SYNCCONST_H_
+
+#define SYNC_NAME "SYNC"
+
+#define SYNC_MAJOR_VERSION     3
+#define SYNC_MINOR_VERSION     1
+
+
+#define XSyncCounterNotify              0
+#define XSyncAlarmNotify               1
+#define XSyncAlarmNotifyMask           (1L << XSyncAlarmNotify)
+
+#define XSyncNumberEvents              2L
+
+#define XSyncBadCounter                        0L
+#define XSyncBadAlarm                  1L
+#define XSyncBadFence           2L
+#define XSyncNumberErrors              (XSyncBadFence + 1)
+
+/*
+ * Flags for Alarm Attributes
+ */
+#define XSyncCACounter                 (1L<<0)
+#define XSyncCAValueType               (1L<<1)
+#define XSyncCAValue                   (1L<<2)
+#define XSyncCATestType                        (1L<<3)
+#define XSyncCADelta                   (1L<<4)
+#define XSyncCAEvents                  (1L<<5)
+
+/*  The _XSync macros below are for library internal use only.  They exist
+ *  so that if we have to make a fix, we can change it in this one place
+ *  and have both the macro and function variants inherit the fix.
+ */
+
+#define _XSyncIntToValue(pv, i)     ((pv)->hi=((i<0)?~0:0),(pv)->lo=(i))
+#define _XSyncIntsToValue(pv, l, h) ((pv)->lo = (l), (pv)->hi = (h))
+#define _XSyncValueGreaterThan(a, b)\
+    ((a).hi>(b).hi || ((a).hi==(b).hi && (a).lo>(b).lo))
+#define _XSyncValueLessThan(a, b)\
+    ((a).hi<(b).hi || ((a).hi==(b).hi && (a).lo<(b).lo))
+#define _XSyncValueGreaterOrEqual(a, b)\
+    ((a).hi>(b).hi || ((a).hi==(b).hi && (a).lo>=(b).lo))
+#define _XSyncValueLessOrEqual(a, b)\
+    ((a).hi<(b).hi || ((a).hi==(b).hi && (a).lo<=(b).lo))
+#define _XSyncValueEqual(a, b) ((a).lo==(b).lo && (a).hi==(b).hi)
+#define _XSyncValueIsNegative(v) (((v).hi & 0x80000000) ? 1 : 0)
+#define _XSyncValueIsZero(a)   ((a).lo==0 && (a).hi==0)
+#define _XSyncValueIsPositive(v) (((v).hi & 0x80000000) ? 0 : 1)
+#define _XSyncValueLow32(v)    ((v).lo)
+#define _XSyncValueHigh32(v)   ((v).hi)
+#define _XSyncValueAdd(presult,a,b,poverflow) {\
+       int t = (a).lo;\
+       Bool signa = XSyncValueIsNegative(a);\
+       Bool signb = XSyncValueIsNegative(b);\
+       ((presult)->lo = (a).lo + (b).lo);\
+       ((presult)->hi = (a).hi + (b).hi);\
+       if (t>(presult)->lo) (presult)->hi++;\
+       *poverflow = ((signa == signb) && !(signa == XSyncValueIsNegative(*presult)));\
+     }
+#define _XSyncValueSubtract(presult,a,b,poverflow) {\
+       int t = (a).lo;\
+       Bool signa = XSyncValueIsNegative(a);\
+       Bool signb = XSyncValueIsNegative(b);\
+       ((presult)->lo = (a).lo - (b).lo);\
+       ((presult)->hi = (a).hi - (b).hi);\
+       if (t<(presult)->lo) (presult)->hi--;\
+       *poverflow = ((signa == signb) && !(signa == XSyncValueIsNegative(*presult)));\
+     }
+#define _XSyncMaxValue(pv) ((pv)->hi = 0x7fffffff, (pv)->lo = 0xffffffff)
+#define _XSyncMinValue(pv) ((pv)->hi = 0x80000000, (pv)->lo = 0)
+
+/*
+ *  These are the publically usable macros.  If you want the function version
+ *  of one of these, just #undef the macro to uncover the function.
+ *  (This is the same convention that the ANSI C library uses.)
+ */
+
+#define XSyncIntToValue(pv, i) _XSyncIntToValue(pv, i)
+#define XSyncIntsToValue(pv, l, h) _XSyncIntsToValue(pv, l, h)
+#define XSyncValueGreaterThan(a, b) _XSyncValueGreaterThan(a, b)
+#define XSyncValueLessThan(a, b) _XSyncValueLessThan(a, b)
+#define XSyncValueGreaterOrEqual(a, b) _XSyncValueGreaterOrEqual(a, b)
+#define XSyncValueLessOrEqual(a, b) _XSyncValueLessOrEqual(a, b)
+#define XSyncValueEqual(a, b) _XSyncValueEqual(a, b)
+#define XSyncValueIsNegative(v) _XSyncValueIsNegative(v)
+#define XSyncValueIsZero(a) _XSyncValueIsZero(a)
+#define XSyncValueIsPositive(v) _XSyncValueIsPositive(v)
+#define XSyncValueLow32(v) _XSyncValueLow32(v)
+#define XSyncValueHigh32(v) _XSyncValueHigh32(v)
+#define XSyncValueAdd(presult,a,b,poverflow) _XSyncValueAdd(presult,a,b,poverflow)
+#define XSyncValueSubtract(presult,a,b,poverflow) _XSyncValueSubtract(presult,a,b,poverflow)
+#define XSyncMaxValue(pv) _XSyncMaxValue(pv)
+#define XSyncMinValue(pv) _XSyncMinValue(pv)
+
+/*
+ * Constants for the value_type argument of various requests
+ */
+typedef enum {
+    XSyncAbsolute,
+    XSyncRelative
+} XSyncValueType;
+
+/*
+ * Alarm Test types
+ */
+typedef enum {
+    XSyncPositiveTransition,
+    XSyncNegativeTransition,
+    XSyncPositiveComparison,
+    XSyncNegativeComparison
+} XSyncTestType;
+
+/*
+ * Alarm state constants
+ */
+typedef enum {
+    XSyncAlarmActive,
+    XSyncAlarmInactive,
+    XSyncAlarmDestroyed
+} XSyncAlarmState;
+
+
+typedef XID XSyncCounter;
+typedef XID XSyncAlarm;
+typedef XID XSyncFence;
+typedef struct _XSyncValue {
+    int hi;
+    unsigned int lo;
+} XSyncValue;
+#endif /* _SYNCCONST_H_ */
diff --git a/syncproto.h b/syncproto.h
new file mode 100755 (executable)
index 0000000..1453e44
--- /dev/null
@@ -0,0 +1,474 @@
+/*
+
+Copyright 1991, 1993, 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.
+
+*/
+
+/***********************************************************
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+                        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 names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY 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 _SYNCPROTO_H_
+#define _SYNCPROTO_H_
+
+#include <X11/extensions/syncconst.h>
+
+#define X_SyncInitialize               0
+#define X_SyncListSystemCounters       1
+#define X_SyncCreateCounter            2
+#define X_SyncSetCounter               3
+#define X_SyncChangeCounter            4
+#define X_SyncQueryCounter              5
+#define X_SyncDestroyCounter           6
+#define X_SyncAwait                    7
+#define X_SyncCreateAlarm               8
+#define X_SyncChangeAlarm              9
+#define X_SyncQueryAlarm              10
+#define X_SyncDestroyAlarm            11
+#define X_SyncSetPriority             12
+#define X_SyncGetPriority             13
+#define X_SyncCreateFence             14
+#define X_SyncTriggerFence            15
+#define X_SyncResetFence              16
+#define X_SyncDestroyFence            17
+#define X_SyncQueryFence              18
+#define X_SyncAwaitFence              19
+
+/* cover up types from sync.h to make sure they're the right size for
+ * protocol packaging.  These will be undef'ed after all the protocol
+ * structures are defined.
+ */
+#define XSyncCounter CARD32
+#define XSyncAlarm   CARD32
+#define XSyncFence   CARD32
+#define Drawable     CARD32
+
+/*
+ * Initialize
+ */
+typedef struct _xSyncInitialize {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    CARD8      majorVersion;
+    CARD8      minorVersion;
+    CARD16     pad B16;
+} xSyncInitializeReq;
+#define sz_xSyncInitializeReq          8
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD8      majorVersion;
+    CARD8      minorVersion;
+    CARD16     pad B16;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xSyncInitializeReply;
+#define sz_xSyncInitializeReply        32
+
+/*
+ * ListSystemCounters
+ */
+typedef struct _xSyncListSystemCounters
+{
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+} xSyncListSystemCountersReq;
+#define sz_xSyncListSystemCountersReq  4
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    INT32      nCounters B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xSyncListSystemCountersReply;
+#define sz_xSyncListSystemCountersReply        32
+
+typedef struct {
+    XSyncCounter counter B32;
+    INT32      resolution_hi B32;
+    CARD32     resolution_lo B32;
+    CARD16     name_length B16;
+} xSyncSystemCounter;
+#define sz_xSyncSystemCounter 14
+
+/*
+ * Create Counter
+ */
+typedef struct _xSyncCreateCounterReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncCounter cid B32;
+    INT32       initial_value_hi B32;
+    CARD32     initial_value_lo B32;
+} xSyncCreateCounterReq;
+#define sz_xSyncCreateCounterReq       16
+
+/*
+ * Change Counter
+ */
+typedef struct _xSyncChangeCounterReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncCounter cid B32;
+    INT32       value_hi B32;
+    CARD32     value_lo B32;
+} xSyncChangeCounterReq;
+#define sz_xSyncChangeCounterReq       16
+
+/*
+ * Set Counter
+ */
+typedef struct _xSyncSetCounterReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncCounter cid B32;
+    INT32       value_hi B32;
+    CARD32     value_lo B32;
+} xSyncSetCounterReq;
+#define sz_xSyncSetCounterReq  16
+
+/*
+ * Destroy Counter
+ */
+typedef struct _xSyncDestroyCounterReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncCounter counter B32;
+} xSyncDestroyCounterReq;
+#define sz_xSyncDestroyCounterReq      8
+
+/*
+ * Query Counter
+ */
+typedef struct _xSyncQueryCounterReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncCounter counter B32;
+} xSyncQueryCounterReq;
+#define sz_xSyncQueryCounterReq                8
+
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    INT32      value_hi B32;
+    CARD32     value_lo B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+} xSyncQueryCounterReply;
+#define sz_xSyncQueryCounterReply      32
+
+/*
+ * Await
+ */
+typedef struct _xSyncAwaitReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+} xSyncAwaitReq;
+#define sz_xSyncAwaitReq               4
+
+typedef struct _xSyncWaitCondition {
+    XSyncCounter counter B32;
+    CARD32     value_type B32;
+    INT32       wait_value_hi B32;
+    CARD32      wait_value_lo B32;
+    CARD32     test_type B32;
+    INT32      event_threshold_hi B32;
+    CARD32     event_threshold_lo B32;
+} xSyncWaitCondition;
+#define sz_xSyncWaitCondition          28
+
+/*
+ * Create Alarm
+ */
+typedef struct _xSyncCreateAlarmReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncAlarm id B32;
+    CARD32      valueMask B32;
+} xSyncCreateAlarmReq;
+#define sz_xSyncCreateAlarmReq         12
+
+/*
+ * Destroy Alarm
+ */
+typedef struct _xSyncDestroyAlarmReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncAlarm alarm B32;
+} xSyncDestroyAlarmReq;
+#define sz_xSyncDestroyAlarmReq                8
+
+/*
+ * Query Alarm
+ */
+typedef struct _xSyncQueryAlarmReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncAlarm alarm B32;
+} xSyncQueryAlarmReq;
+#define sz_xSyncQueryAlarmReq          8
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    XSyncCounter counter B32;
+    CARD32     value_type B32;
+    INT32      wait_value_hi B32;
+    CARD32     wait_value_lo B32;
+    CARD32     test_type      B32;
+    INT32      delta_hi B32;
+    CARD32     delta_lo B32;
+    BOOL        events;
+    BYTE        state;
+    BYTE       pad0;
+    BYTE       pad1;
+} xSyncQueryAlarmReply;
+#define sz_xSyncQueryAlarmReply                40
+
+/*
+ * Change Alarm
+ */
+typedef struct _xSyncChangeAlarmReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncAlarm alarm B32;
+    CARD32     valueMask B32;
+} xSyncChangeAlarmReq;
+#define sz_xSyncChangeAlarmReq         12
+
+/*
+ * SetPriority
+ */
+typedef struct _xSyncSetPriority{
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    CARD32     id B32;
+    INT32      priority B32;
+} xSyncSetPriorityReq;
+#define sz_xSyncSetPriorityReq         12
+
+/*
+ * Get Priority
+ */
+typedef struct _xSyncGetPriority{
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    CARD32     id B32; /*XXX XID? */
+} xSyncGetPriorityReq;
+#define sz_xSyncGetPriorityReq          8
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    INT32      priority B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+} xSyncGetPriorityReply;
+#define sz_xSyncGetPriorityReply       32
+
+/*
+ * Create Fence
+ */
+typedef struct _xSyncCreateFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    Drawable   d B32;
+    XSyncFence fid B32;
+    BOOL       initially_triggered;
+    CARD8      pad0;
+    CARD16     pad1;
+} xSyncCreateFenceReq;
+#define sz_xSyncCreateFenceReq         16
+
+/*
+ * Put a fence object in the "triggered" state.
+ */
+typedef struct _xSyncTriggerFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncFence fid B32;
+} xSyncTriggerFenceReq;
+#define sz_xSyncTriggerFenceReq                8
+
+/*
+ * Put a fence in the "untriggered" state.
+ */
+typedef struct _xSyncResetFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncFence fid B32;
+} xSyncResetFenceReq;
+#define sz_xSyncResetFenceReq          8
+
+/*
+ * Destroy a fence object
+ */
+typedef struct _xSyncDestroyFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncFence fid B32;
+} xSyncDestroyFenceReq;
+#define sz_xSyncDestroyFenceReq                8
+
+/*
+ * Query a fence object
+ */
+typedef struct _xSyncQueryFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+    XSyncFence fid B32;
+} xSyncQueryFenceReq;
+#define sz_xSyncQueryFenceReq          8
+
+/*
+ * Wait for any of a list of fence sync objects
+ * to reach the "triggered" state.
+ */
+typedef struct _xSyncAwaitFenceReq {
+    CARD8      reqType;
+    CARD8      syncReqType;
+    CARD16     length B16;
+} xSyncAwaitFenceReq;
+#define sz_xSyncAwaitFenceReq          4
+
+typedef struct {
+    BYTE       type;
+    CARD8      unused;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    BOOL       triggered;
+    BYTE       pad0;
+    CARD16     pad1 B16;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+    CARD32     pad6 B32;
+} xSyncQueryFenceReply;
+#define sz_xSyncQueryFenceReply                32
+
+/*
+ * Events
+ */
+
+typedef struct _xSyncCounterNotifyEvent {
+    BYTE       type;
+    BYTE       kind;
+    CARD16     sequenceNumber B16;
+    XSyncCounter counter B32;
+    INT32      wait_value_hi B32;
+    CARD32     wait_value_lo B32;
+    INT32      counter_value_hi B32;
+    CARD32     counter_value_lo B32;
+    CARD32     time B32;
+    CARD16     count B16;
+    BOOL       destroyed;
+    BYTE        pad0;
+} xSyncCounterNotifyEvent;
+
+typedef struct _xSyncAlarmNotifyEvent {
+    BYTE       type;
+    BYTE       kind;
+    CARD16     sequenceNumber B16;
+    XSyncAlarm alarm B32;
+    INT32      counter_value_hi B32;
+    CARD32     counter_value_lo B32;
+    INT32      alarm_value_hi B32;
+    CARD32     alarm_value_lo B32;
+    CARD32     time B32;
+    CARD8       state;
+    BYTE        pad0;
+    BYTE        pad1;
+    BYTE        pad2;
+} xSyncAlarmNotifyEvent;
+
+#undef XSyncCounter
+#undef XSyncAlarm
+#undef XSyncFence
+#undef Drawable
+
+
+#endif /* _SYNCPROTO_H_ */
diff --git a/syncstr.h b/syncstr.h
new file mode 100755 (executable)
index 0000000..87697a2
--- /dev/null
+++ b/syncstr.h
@@ -0,0 +1,184 @@
+/* $Xorg: syncstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */
+/*
+
+Copyright 1991, 1993, 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.
+
+*/
+
+/***********************************************************
+Copyright 1991,1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+                        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 names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY 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/syncstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */
+
+#ifndef _SYNCSTR_H_
+#define _SYNCSTR_H_
+
+#include <X11/extensions/syncproto.h>
+
+#ifdef _SYNC_SERVER
+
+#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
+
+typedef struct _SyncCounter {
+    ClientPtr          client; /* Owning client. 0 for system counters */
+    XSyncCounter       id;             /* resource ID */
+    CARD64             value;          /* counter value */
+    struct _SyncTriggerList *pTriglist;        /* list of triggers */
+    Bool               beingDestroyed; /* in process of going away */
+    struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
+} SyncCounter;
+
+/*
+ * The System Counter interface
+ */
+
+typedef enum {
+    XSyncCounterNeverChanges,
+    XSyncCounterNeverIncreases,
+    XSyncCounterNeverDecreases,
+    XSyncCounterUnrestricted
+} SyncCounterType;
+
+typedef struct _SysCounterInfo {
+    char       *name;
+    CARD64     resolution;
+    CARD64     bracket_greater;
+    CARD64     bracket_less;
+    SyncCounterType counterType;  /* how can this counter change */
+    void        (*QueryValue)(
+                             pointer /*pCounter*/,
+                             CARD64 * /*freshvalue*/
+);
+    void       (*BracketValues)(
+                                pointer /*pCounter*/,
+                                CARD64 * /*lessthan*/,
+                                CARD64 * /*greaterthan*/
+);
+} SysCounterInfo;
+
+
+
+typedef struct _SyncTrigger {
+    SyncCounter *pCounter;
+    CARD64     wait_value;     /* wait value */
+    unsigned int value_type;     /* Absolute or Relative */
+    unsigned int test_type;    /* transition or Comparision type */
+    CARD64     test_value;     /* trigger event threshold value */
+    Bool       (*CheckTrigger)(
+                               struct _SyncTrigger * /*pTrigger*/,
+                               CARD64 /*newval*/
+                               );
+    void       (*TriggerFired)(
+                               struct _SyncTrigger * /*pTrigger*/
+                               );
+    void       (*CounterDestroyed)(
+                               struct _SyncTrigger * /*pTrigger*/
+                                   );
+} SyncTrigger;
+
+typedef struct _SyncTriggerList {
+    SyncTrigger *pTrigger;
+    struct _SyncTriggerList *next;
+} SyncTriggerList;
+
+typedef struct _SyncAlarmClientList {
+    ClientPtr  client;
+    XID                delete_id;
+    struct _SyncAlarmClientList *next;
+} SyncAlarmClientList;
+
+typedef struct _SyncAlarm {
+    SyncTrigger trigger;
+    ClientPtr  client;
+    XSyncAlarm         alarm_id;
+    CARD64     delta;
+    int                events;
+    int                state;
+    SyncAlarmClientList *pEventClients;
+} SyncAlarm;
+
+typedef struct {
+    ClientPtr  client;
+    CARD32     delete_id;
+    int                num_waitconditions;
+} SyncAwaitHeader;
+
+typedef struct {
+    SyncTrigger trigger;
+    CARD64     event_threshold;
+    SyncAwaitHeader *pHeader;
+} SyncAwait;
+
+typedef union {
+    SyncAwaitHeader header;
+    SyncAwait      await;
+} SyncAwaitUnion;
+
+
+extern pointer SyncCreateSystemCounter(
+    char *     /* name */,
+    CARD64     /* inital_value */,
+    CARD64     /* resolution */,
+    SyncCounterType /* change characterization */,
+    void        (* /*QueryValue*/ ) (
+        pointer /* pCounter */,
+        CARD64 * /* pValue_return */), /* XXX prototype */
+    void        (* /*BracketValues*/) (
+        pointer /* pCounter */, 
+        CARD64 * /* pbracket_less */,
+        CARD64 * /* pbracket_greater */)
+);
+
+extern void SyncChangeCounter(
+    SyncCounter *      /* pCounter*/,
+    CARD64             /* new_value */
+);
+
+extern void SyncDestroySystemCounter(
+    pointer pCounter
+);
+extern void InitServertime(void);
+
+#endif /* _SYNC_SERVER */
+
+#endif /* _SYNCSTR_H_ */
diff --git a/xextproto.pc.in b/xextproto.pc.in
new file mode 100644 (file)
index 0000000..e85200f
--- /dev/null
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+Name: XExtProto
+Description: XExt extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/xtestconst.h b/xtestconst.h
new file mode 100644 (file)
index 0000000..e74b904
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+
+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 _XTEST_CONST_H_
+#define _XTEST_CONST_H_
+
+#define XTestNumberEvents      0
+
+#define XTestNumberErrors      0
+
+#define XTestCurrentCursor ((Cursor)1)
+
+#define XTestMajorVersion      2
+#define XTestMinorVersion      2
+
+#define XTestExtensionName     "XTEST"
+
+#endif
diff --git a/xtestext1const.h b/xtestext1const.h
new file mode 100644 (file)
index 0000000..656edc6
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * xtestext1.h
+ *
+ * X11 Input Synthesis Extension include file
+ */
+
+/*
+
+
+Copyright 1986, 1987, 1988, 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 1986, 1987, 1988 by Hewlett-Packard Corporation
+
+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 makes no representations about the
+suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+
+*/
+
+#ifndef _XTESTEXT1CONST_H
+#define _XTESTEXT1CONST_H 1
+
+#define XTestMAX_ACTION_LIST_SIZE       64
+#define XTestACTIONS_SIZE      28
+
+
+/*
+ * used in the XTestPressButton and XTestPressKey functions
+ */
+#define XTestPRESS                      1 << 0
+#define XTestRELEASE                    1 << 1
+#define XTestSTROKE                     1 << 2
+
+/*
+ * When doing a key or button stroke, the number of milliseconds
+ * to delay between the press and the release of a key or button
+ * in the XTestPressButton and XTestPressKey functions.
+ */
+
+#define XTestSTROKE_DELAY_TIME         10
+
+/*
+ * used in the XTestGetInput function
+ */
+#define XTestEXCLUSIVE                  1 << 0
+#define XTestPACKED_ACTIONS             1 << 1
+#define XTestPACKED_MOTION              1 << 2
+
+/*
+ * used in the XTestFakeInput function
+ */
+#define XTestFAKE_ACK_NOT_NEEDED        0
+#define XTestFAKE_ACK_REQUEST           1
+
+/*
+ * used in the XTest extension initialization routine
+ */
+#define XTestEXTENSION_NAME             "XTestExtension1"
+#define XTestEVENT_COUNT                2
+
+/*
+ * This is the definition for the format of the header byte
+ * in the input action structures.
+ */
+#define XTestACTION_TYPE_MASK   0x03    /* bits 0 and 1          */
+#define XTestKEY_STATE_MASK     0x04    /* bit 2 (key action)    */
+#define XTestX_SIGN_BIT_MASK    0x04    /* bit 2 (motion action) */
+#define XTestY_SIGN_BIT_MASK    0x08    /* bit 3 (motion action) */
+#define XTestDEVICE_ID_MASK     0xf0    /* bits 4 through 7      */
+
+#define XTestMAX_DEVICE_ID     0x0f
+#define XTestPackDeviceID(x)   (((x) & XTestMAX_DEVICE_ID) << 4)
+#define XTestUnpackDeviceID(x) (((x) & XTestDEVICE_ID_MASK) >> 4)
+
+/*
+ * These are the possible action types.
+ */
+#define XTestDELAY_ACTION       0
+#define XTestKEY_ACTION         1
+#define XTestMOTION_ACTION      2
+#define XTestJUMP_ACTION        3
+
+/*
+ * These are the definitions for key/button motion input actions.
+ */
+#define XTestKEY_UP             0x04
+#define XTestKEY_DOWN           0x00
+
+/*
+ * These are the definitions for pointer relative motion input
+ * actions.
+ *
+ * The sign bits for the x and y relative motions are contained
+ * in the header byte.  The x and y relative motions are packed
+ * into one byte to make things fit in 32 bits.  If the relative
+ * motion range is larger than +/-15, use the pointer jump action.
+ */
+#define XTestMOTION_MAX            15
+#define XTestMOTION_MIN            -15
+
+#define XTestX_NEGATIVE            0x04
+#define XTestY_NEGATIVE            0x08
+
+#define XTestX_MOTION_MASK         0x0f
+#define XTestY_MOTION_MASK         0xf0
+
+#define XTestPackXMotionValue(x)   ((x) & XTestX_MOTION_MASK)
+#define XTestPackYMotionValue(x)   (((x) << 4) & XTestY_MOTION_MASK)
+
+#define XTestUnpackXMotionValue(x) ((x) & XTestX_MOTION_MASK)
+#define XTestUnpackYMotionValue(x) (((x) & XTestY_MOTION_MASK) >> 4)
+/*
+ * These are the definitions for a long delay input action.  It is
+ * used when more than XTestSHORT_DELAY_TIME milliseconds of delay
+ * (approximately one minute) is needed.
+ *
+ * The device ID for a delay is always set to XTestDELAY_DEVICE_ID.
+ * This guarantees that a header byte with a value of 0 is not
+ * a valid header, so it can be used as a flag to indicate that
+ * there are no more input actions in an XTestInputAction event.
+ */
+
+#define XTestSHORT_DELAY_TIME  0xffff
+#define XTestDELAY_DEVICE_ID    0x0f
+
+#endif /* _XTESTEXT1CONST_H */
diff --git a/xtestext1proto.h b/xtestext1proto.h
new file mode 100644 (file)
index 0000000..e9bdee0
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * xtestext1.h
+ *
+ * X11 Input Synthesis Extension include file
+ */
+
+/*
+Copyright 1986, 1987, 1988, 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 1986, 1987, 1988 by Hewlett-Packard Corporation
+
+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 makes no representations about the
+suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
+
+This software is not subject to any license of the American
+Telephone and Telegraph Company or of the Regents of the
+University of California.
+
+*/
+
+#ifndef _XTESTEXT1PROTO_H
+#define _XTESTEXT1PROTO_H 1
+
+#include <X11/extensions/xtestext1const.h>
+
+/*
+ * the typedefs for CARD8, CARD16, and CARD32 are defined in Xmd.h
+ */
+
+/*
+ * XTest request type values
+ *
+ * used in the XTest extension protocol requests
+ */
+#define X_TestFakeInput                  1
+#define X_TestGetInput                   2
+#define X_TestStopInput                  3
+#define X_TestReset                      4
+#define X_TestQueryInputSize             5
+
+/*
+ * This defines the maximum size of a list of input actions
+ * to be sent to the server.  It should always be a multiple of
+ * 4 so that the entire xTestFakeInputReq structure size is a
+ * multiple of 4.
+ */
+
+typedef struct {
+        CARD8   reqType;        /* always XTestReqCode             */
+        CARD8   XTestReqType;   /* always X_TestFakeInput           */
+        CARD16  length B16;     /* 2 + XTestMAX_ACTION_LIST_SIZE/4 */
+        CARD32  ack B32;
+        CARD8   action_list[XTestMAX_ACTION_LIST_SIZE];
+} xTestFakeInputReq;
+#define sz_xTestFakeInputReq (XTestMAX_ACTION_LIST_SIZE + 8)
+
+typedef struct {
+        CARD8   reqType;        /* always XTestReqCode  */
+        CARD8   XTestReqType;   /* always X_TestGetInput */
+        CARD16  length B16;     /* 2                    */
+        CARD32  mode B32;
+} xTestGetInputReq;
+#define sz_xTestGetInputReq 8
+
+typedef struct {
+        CARD8   reqType;        /* always XTestReqCode   */
+        CARD8   XTestReqType;   /* always X_TestStopInput */
+        CARD16  length B32;     /* 1                     */
+} xTestStopInputReq;
+#define sz_xTestStopInputReq 4
+
+typedef struct {
+        CARD8   reqType;        /* always XTestReqCode */
+        CARD8   XTestReqType;   /* always X_TestReset   */
+        CARD16  length B16;     /* 1                   */
+} xTestResetReq;
+#define sz_xTestResetReq 4
+
+typedef struct {
+        CARD8   reqType;        /* always XTestReqCode        */
+        CARD8   XTestReqType;   /* always X_TestQueryInputSize */
+        CARD16  length B16;     /* 1                          */
+} xTestQueryInputSizeReq;
+#define sz_xTestQueryInputSizeReq 4
+
+/*
+ * This is the definition of the reply for the xTestQueryInputSize
+ * request.  It should remain the same minimum size as other replies
+ * (32 bytes).
+ */
+typedef struct {
+        CARD8   type;           /* always X_Reply  */
+        CARD8   pad1;
+        CARD16  sequenceNumber B16;
+        CARD32  length B32;     /* always 0 */
+        CARD32  size_return B32;
+        CARD32  pad2 B32;
+        CARD32  pad3 B32;
+        CARD32  pad4 B32;
+        CARD32  pad5 B32;
+        CARD32  pad6 B32;
+} xTestQueryInputSizeReply;
+
+/*
+ * This is the definition for the input action wire event structure.
+ * This event is sent to the client when the server has one or
+ * more user input actions to report to the client.  It must
+ * remain the same size as all other wire events (32 bytes).
+ */
+typedef struct {
+        CARD8   type;           /* always XTestInputActionType */
+        CARD8   pad00;
+        CARD16  sequenceNumber B16;
+        CARD8   actions[XTestACTIONS_SIZE];
+} xTestInputActionEvent;
+
+/*
+ * This is the definition for the xTestFakeAck wire event structure.
+ * This event is sent to the client when the server has completely
+ * processed its input action buffer, and is ready for more.
+ * It must remain the same size as all other wire events (32 bytes).
+ */
+typedef struct {
+        CARD8   type;           /* always XTestFakeAckType */
+        CARD8   pad00;
+        CARD16  sequenceNumber B16;
+        CARD32  pad02 B32;
+        CARD32  pad03 B32;
+        CARD32  pad04 B32;
+        CARD32  pad05 B32;
+        CARD32  pad06 B32;
+        CARD32  pad07 B32;
+        CARD32  pad08 B32;
+} xTestFakeAckEvent;
+
+/*
+ * These are the definitions for key/button motion input actions.
+ */
+typedef struct {
+        CARD8   header;         /* which device, key up/down */
+        CARD8   keycode;        /* which key/button to move  */
+        CARD16  delay_time B16; /* how long to delay (in ms) */
+} XTestKeyInfo;
+
+/*
+ * This is the definition for pointer jump input actions.
+ */
+typedef struct {
+        CARD8   header;         /* which pointer             */
+        CARD8   pad1;           /* unused padding byte       */
+        CARD16  jumpx B16;      /* x coord to jump to        */
+        CARD16  jumpy B16;      /* y coord to jump to        */
+        CARD16  delay_time B16; /* how long to delay (in ms) */
+} XTestJumpInfo;
+
+/*
+ * These are the definitions for pointer relative motion input
+ * actions.
+ *
+ * The sign bits for the x and y relative motions are contained
+ * in the header byte.  The x and y relative motions are packed
+ * into one byte to make things fit in 32 bits.  If the relative
+ * motion range is larger than +/-15, use the pointer jump action.
+ */
+
+typedef struct {
+        CARD8   header;         /* which pointer             */
+        CARD8   motion_data;    /* x,y relative motion       */
+        CARD16  delay_time B16; /* how long to delay (in ms) */
+} XTestMotionInfo;
+
+/*
+ * These are the definitions for a long delay input action.  It is
+ * used when more than XTestSHORT_DELAY_TIME milliseconds of delay
+ * (approximately one minute) is needed.
+ *
+ * The device ID for a delay is always set to XTestDELAY_DEVICE_ID.
+ * This guarantees that a header byte with a value of 0 is not
+ * a valid header, so it can be used as a flag to indicate that
+ * there are no more input actions in an XTestInputAction event.
+ */
+
+typedef struct {
+        CARD8   header;         /* always XTestDELAY_DEVICE_ID */
+        CARD8   pad1;           /* unused padding byte         */
+        CARD16  pad2 B16;       /* unused padding word         */
+        CARD32  delay_time B32; /* how long to delay (in ms)   */
+} XTestDelayInfo;
+
+#endif /* _XTESTEXT1PROTO_H */
diff --git a/xtestproto.h b/xtestproto.h
new file mode 100644 (file)
index 0000000..4f8db26
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+
+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 _XTESTPROTO_H_
+#define _XTESTPROTO_H_
+
+#include <X11/extensions/xtestconst.h>
+
+#define Window CARD32
+#define Time CARD32
+#define Cursor CARD32
+
+#define X_XTestGetVersion      0
+#define X_XTestCompareCursor   1
+#define X_XTestFakeInput       2
+#define X_XTestGrabControl     3
+
+typedef struct {
+    CARD8      reqType;        /* always XTestReqCode */
+    CARD8      xtReqType;      /* always X_XTestGetVersion */
+    CARD16     length B16;
+    CARD8      majorVersion;
+    CARD8      pad;
+    CARD16     minorVersion B16;
+} xXTestGetVersionReq;
+#define sz_xXTestGetVersionReq 8
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    CARD8      majorVersion;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD16     minorVersion B16;
+    CARD16     pad0 B16;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xXTestGetVersionReply;
+#define sz_xXTestGetVersionReply 32
+
+typedef struct {
+    CARD8      reqType;        /* always XTestReqCode */
+    CARD8      xtReqType;      /* always X_XTestCompareCursor */
+    CARD16     length B16;
+    Window     window B32;
+    Cursor     cursor B32;
+} xXTestCompareCursorReq;
+#define sz_xXTestCompareCursorReq 12
+
+typedef struct {
+    BYTE       type;                   /* X_Reply */
+    BOOL       same;
+    CARD16     sequenceNumber B16;
+    CARD32     length B32;
+    CARD32     pad0 B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    CARD32     pad3 B32;
+    CARD32     pad4 B32;
+    CARD32     pad5 B32;
+} xXTestCompareCursorReply;
+#define sz_xXTestCompareCursorReply 32
+
+/* used only on the client side */
+typedef struct {
+    CARD8      reqType;        /* always XTestReqCode */
+    CARD8      xtReqType;      /* always X_XTestFakeInput */
+    CARD16     length B16;
+    BYTE       type;
+    BYTE       detail;
+    CARD16     pad0 B16;
+    Time       time B32;
+    Window     root B32;
+    CARD32     pad1 B32;
+    CARD32     pad2 B32;
+    INT16      rootX B16, rootY B16;
+    CARD32     pad3 B32;
+    CARD16     pad4 B16;
+    CARD8      pad5;
+    CARD8      deviceid;
+} xXTestFakeInputReq;
+#define sz_xXTestFakeInputReq 36
+
+typedef struct {
+    CARD8      reqType;        /* always XTestReqCode */
+    CARD8      xtReqType;      /* always X_XTestGrabControl */
+    CARD16     length B16;
+    BOOL       impervious;
+    CARD8      pad0;
+    CARD8      pad1;
+    CARD8      pad2;
+} xXTestGrabControlReq;
+#define sz_xXTestGrabControlReq 8
+
+#undef Window
+#undef Time
+#undef Cursor
+
+#endif /* _XTESTPROTO_H_ */